Class: LexerTypeAction
- Inherits:
-
LexerAction
- Object
- LexerAction
- LexerTypeAction
- Defined in:
- lib/antlr4/atn/LexerAction.rb
Overview
Implements the type lexer action by calling Lexer#setType with the assigned type.
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from LexerAction
#actionType, #isPositionDependent
Instance Method Summary collapse
- #==(other) ⇒ Object
- #execute(lexer) ⇒ Object
- #hash ⇒ Object
-
#initialize(_type) ⇒ LexerTypeAction
constructor
A new instance of LexerTypeAction.
- #to_s ⇒ Object
Methods inherited from LexerAction
Constructor Details
#initialize(_type) ⇒ LexerTypeAction
Returns a new instance of LexerTypeAction.
68 69 70 71 |
# File 'lib/antlr4/atn/LexerAction.rb', line 68 def initialize(_type) super(LexerActionType::TYPE) self.type = _type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
67 68 69 |
# File 'lib/antlr4/atn/LexerAction.rb', line 67 def type @type end |
Instance Method Details
#==(other) ⇒ Object
80 81 82 |
# File 'lib/antlr4/atn/LexerAction.rb', line 80 def ==(other) self.equal?(other) or other.kind_of?(LexerTypeAction) and self.type == other.type end |
#execute(lexer) ⇒ Object
72 73 74 |
# File 'lib/antlr4/atn/LexerAction.rb', line 72 def execute(lexer) lexer.type = self.type end |
#hash ⇒ Object
76 77 78 |
# File 'lib/antlr4/atn/LexerAction.rb', line 76 def hash return "#{self.actionType}#{self.type}".hash end |
#to_s ⇒ Object
83 84 85 |
# File 'lib/antlr4/atn/LexerAction.rb', line 83 def to_s return "type(#{self.type})" end |