Class: Antlr4::Runtime::LexerIndexedCustomAction
- Inherits:
-
LexerAction
- Object
- LexerAction
- Antlr4::Runtime::LexerIndexedCustomAction
- Defined in:
- lib/antlr4/runtime/lexer_indexed_custom_action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
Instance Method Summary collapse
- #action_type ⇒ Object
- #eql?(other) ⇒ Boolean
-
#execute(lexer) ⇒ Object
assume the input stream position was properly set by the calling code.
- #hash ⇒ Object
-
#initialize(offset, action) ⇒ LexerIndexedCustomAction
constructor
A new instance of LexerIndexedCustomAction.
- #position_dependent? ⇒ Boolean
Constructor Details
#initialize(offset, action) ⇒ LexerIndexedCustomAction
Returns a new instance of LexerIndexedCustomAction.
7 8 9 10 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 7 def initialize(offset, action) @offset = offset @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
4 5 6 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 4 def action @action end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
5 6 7 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 5 def offset @offset end |
Instance Method Details
#action_type ⇒ Object
12 13 14 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 12 def action_type @action.action_type end |
#eql?(other) ⇒ Boolean
39 40 41 42 43 44 45 46 47 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 39 def eql?(other) if other == self return true else return false unless other.is_a? LexerIndexedCustomAction end @offset == other.offset && @action == other.action end |
#execute(lexer) ⇒ Object
assume the input stream position was properly set by the calling code
20 21 22 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 20 def execute(lexer) # assume the input stream position was properly set by the calling code @action.execute(lexer) end |
#hash ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 24 def hash return @_hash unless @_hash.nil? hash_code = RumourHash.calculate([offset, action]) unless @_hash.nil? if hash_code == @_hash puts 'Same hash_code for LexerIndexedCustomAction' else puts 'Different hash_code for LexerIndexedCustomAction' end end @_hash = hash_code end |
#position_dependent? ⇒ Boolean
16 17 18 |
# File 'lib/antlr4/runtime/lexer_indexed_custom_action.rb', line 16 def position_dependent? true end |