Class: LexerCustomAction
- Inherits:
-
LexerAction
- Object
- LexerAction
- LexerCustomAction
- Defined in:
- lib/antlr4/atn/LexerAction.rb
Overview
command argument could not be evaluated when the grammar was compiled.</p>
Instance Attribute Summary collapse
-
#actionIndex ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
-
#isPositionDependent ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
-
#ruleIndex ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
Attributes inherited from LexerAction
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#execute(lexer) ⇒ Object
<p>Custom actions are implemented by calling Lexer#action with the appropriate rule and action indexes.</p>.
- #hash ⇒ Object
-
#initialize(rule_index, action_index) ⇒ LexerCustomAction
constructor
A new instance of LexerCustomAction.
Methods inherited from LexerAction
Constructor Details
#initialize(rule_index, action_index) ⇒ LexerCustomAction
Returns a new instance of LexerCustomAction.
217 218 219 220 221 222 |
# File 'lib/antlr4/atn/LexerAction.rb', line 217 def initialize(rule_index, action_index) super(LexerActionType::CUSTOM) @ruleIndex = rule_index @actionIndex = action_index @isPositionDependent = true end |
Instance Attribute Details
#actionIndex ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
Recognizer#action. Recognizer#action. /
216 217 218 |
# File 'lib/antlr4/atn/LexerAction.rb', line 216 def actionIndex @actionIndex end |
#isPositionDependent ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
Recognizer#action. Recognizer#action. /
216 217 218 |
# File 'lib/antlr4/atn/LexerAction.rb', line 216 def isPositionDependent @isPositionDependent end |
#ruleIndex ⇒ Object
Constructs a custom lexer action with the specified rule and action indexes.
Recognizer#action. Recognizer#action. /
216 217 218 |
# File 'lib/antlr4/atn/LexerAction.rb', line 216 def ruleIndex @ruleIndex end |
Instance Method Details
#==(other) ⇒ Object
232 233 234 235 |
# File 'lib/antlr4/atn/LexerAction.rb', line 232 def ==( other) self.equal?(other) or other.kind_of?( LexerCustomAction) \ and self.ruleIndex == other.ruleIndex and self.actionIndex == other.actionIndex end |
#execute(lexer) ⇒ Object
<p>Custom actions are implemented by calling Lexer#action with the appropriate rule and action indexes.</p>
225 226 227 |
# File 'lib/antlr4/atn/LexerAction.rb', line 225 def execute(lexer) lexer.action(nil, self.ruleIndex, self.actionIndex) end |
#hash ⇒ Object
228 229 230 |
# File 'lib/antlr4/atn/LexerAction.rb', line 228 def hash "#{self.actionType}#{self.ruleIndex}#{self.actionIndex}".hash end |