Class: LexerChannelAction
- Inherits:
-
LexerAction
- Object
- LexerAction
- LexerChannelAction
- Defined in:
- lib/antlr4/atn/LexerAction.rb
Overview
Lexer#setChannel with the assigned channel.
Instance Attribute Summary collapse
-
#channel ⇒ Object
Constructs a new channel action with the specified channel value.
Attributes inherited from LexerAction
#actionType, #isPositionDependent
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#execute(lexer) ⇒ Object
<p>This action is implemented by calling Lexer#setChannel with the value provided by #getChannel.</p>.
- #hash ⇒ Object
-
#initialize(_channel) ⇒ LexerChannelAction
constructor
A new instance of LexerChannelAction.
- #to_s ⇒ Object
Methods inherited from LexerAction
Constructor Details
#initialize(_channel) ⇒ LexerChannelAction
Returns a new instance of LexerChannelAction.
244 245 246 247 |
# File 'lib/antlr4/atn/LexerAction.rb', line 244 def initialize(_channel) super(LexerActionType::CHANNEL) self.channel = _channel end |
Instance Attribute Details
#channel ⇒ Object
Constructs a new channel action with the specified channel value.
243 244 245 |
# File 'lib/antlr4/atn/LexerAction.rb', line 243 def channel @channel end |
Instance Method Details
#==(other) ⇒ Object
258 259 260 261 |
# File 'lib/antlr4/atn/LexerAction.rb', line 258 def ==(other) self.equal?(other) or other.kind_of?(LexerChannelAction) \ and self.channel == other.channel end |
#execute(lexer) ⇒ Object
<p>This action is implemented by calling Lexer#setChannel with the value provided by #getChannel.</p>
251 252 253 |
# File 'lib/antlr4/atn/LexerAction.rb', line 251 def execute(lexer) lexer.channel = self.channel end |
#hash ⇒ Object
254 255 256 |
# File 'lib/antlr4/atn/LexerAction.rb', line 254 def hash "#{self.actionType}#{self.channel}".hash end |
#to_s ⇒ Object
263 264 265 |
# File 'lib/antlr4/atn/LexerAction.rb', line 263 def to_s return "channel(#{self.channel})" end |