class Antlr4::Runtime::LexerIndexedCustomAction

Attributes

action[R]
offset[R]

Public Class Methods

new(offset, action) click to toggle source
# File lib/antlr4/runtime/lexer_indexed_custom_action.rb, line 7
def initialize(offset, action)
  @offset = offset
  @action = action
end

Public Instance Methods

action_type() click to toggle source
# File lib/antlr4/runtime/lexer_indexed_custom_action.rb, line 12
def action_type
  @action.action_type
end
eql?(other) click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# 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?() click to toggle source
# File lib/antlr4/runtime/lexer_indexed_custom_action.rb, line 16
def position_dependent?
  true
end