Class: LexerIndexedCustomAction
- Inherits:
-
LexerAction
- Object
- LexerAction
- LexerIndexedCustomAction
- Defined in:
- lib/antlr4/atn/LexerAction.rb
Overview
LexerActionExecutor#fixOffsetBeforeMatch.</p>
Instance Attribute Summary collapse
-
#action ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
-
#isPositionDependent ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
-
#offset ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
Attributes inherited from LexerAction
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#execute(lexer) ⇒ Object
<p>This method calls #execute on the result of #getAction using the provided lexer.</p>.
- #hash ⇒ Object
-
#initialize(_offset, _action) ⇒ LexerIndexedCustomAction
constructor
A new instance of LexerIndexedCustomAction.
Methods inherited from LexerAction
Constructor Details
#initialize(_offset, _action) ⇒ LexerIndexedCustomAction
Returns a new instance of LexerIndexedCustomAction.
289 290 291 292 293 294 |
# File 'lib/antlr4/atn/LexerAction.rb', line 289 def initialize(_offset, _action) super(action.actionType) self.offset = _offset self.action = _action self.isPositionDependent = true end |
Instance Attribute Details
#action ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
<p>Note: This class is only required for lexer actions for which LexerAction#isPositionDependent returns true.</p>
the token start index, at which the specified lexer action should be executed. input CharStream.
288 289 290 |
# File 'lib/antlr4/atn/LexerAction.rb', line 288 def action @action end |
#isPositionDependent ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
<p>Note: This class is only required for lexer actions for which LexerAction#isPositionDependent returns true.</p>
the token start index, at which the specified lexer action should be executed. input CharStream.
288 289 290 |
# File 'lib/antlr4/atn/LexerAction.rb', line 288 def isPositionDependent @isPositionDependent end |
#offset ⇒ Object
Constructs a new indexed custom action by associating a character offset with a LexerAction.
<p>Note: This class is only required for lexer actions for which LexerAction#isPositionDependent returns true.</p>
the token start index, at which the specified lexer action should be executed. input CharStream.
288 289 290 |
# File 'lib/antlr4/atn/LexerAction.rb', line 288 def offset @offset end |
Instance Method Details
#==(other) ⇒ Object
307 308 309 310 |
# File 'lib/antlr4/atn/LexerAction.rb', line 307 def ==(other) self.equal?(other) or other.kind_of?(LexerIndexedCustomAction) \ and self.offset == other.offset and self.action == other.action end |
#execute(lexer) ⇒ Object
<p>This method calls #execute on the result of #getAction using the provided lexer.</p>
298 299 300 301 |
# File 'lib/antlr4/atn/LexerAction.rb', line 298 def execute(lexer) # assume the input stream position was properly set by the calling code self.action.execute(lexer) end |
#hash ⇒ Object
303 304 305 |
# File 'lib/antlr4/atn/LexerAction.rb', line 303 def hash "#{self.actionType}#{self.offset}#{self.action}".hash end |