class Antlr4::Runtime::LexerChannelAction

Attributes

channel[R]

Public Class Methods

new(channel) click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 6
def initialize(channel)
  @channel = channel
end

Public Instance Methods

action_type() click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 10
def action_type
  LexerActionType::CHANNEL
end
eql?(other) click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 37
def eql?(other)
  if other == self
    return true
  else
    return false unless other.is_a? LexerChannelAction
  end

  @channel == other.channel
end
execute(lexer) click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 18
def execute(lexer)
  lexer._channel = @channel
end
hash() click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 22
def hash
  return @_hash unless @_hash.nil?

  hash_code = RumourHash.calculate([action_type, @channel])

  unless @_hash.nil?
    if hash_code == @_hash
      puts 'Same hash_code for LexerChannelAction'
    else
      puts 'Different hash_code for LexerChannelAction'
    end
  end
  @_hash = hash_code
end
position_dependent?() click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 14
def position_dependent?
  false
end
to_s() click to toggle source
# File lib/antlr4/runtime/lexer_channel_action.rb, line 47
def to_s
  'channel(' << @channel.to_s << ')'
end