Class: LexerPopModeAction

Inherits:
LexerAction show all
Defined in:
lib/antlr4/atn/LexerAction.rb

Overview

Implements the popMode lexer action by calling Lexer#popMode.

<p>The popMode command does not have any parameters, so this action is implemented as a singleton instance exposed by #INSTANCE.</p>

Constant Summary collapse

@@INSTANCE =
nil

Instance Attribute Summary

Attributes inherited from LexerAction

#actionType, #isPositionDependent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LexerAction

#==, #eql?, #hash

Constructor Details

#initializeLexerPopModeAction

Returns a new instance of LexerPopModeAction.



129
130
131
# File 'lib/antlr4/atn/LexerAction.rb', line 129

def initialize 
    super(LexerActionType::POP_MODE)
end

Class Method Details

.INSTANCEObject



124
125
126
127
# File 'lib/antlr4/atn/LexerAction.rb', line 124

def self.INSTANCE 
   @@INSTANCE = new() if @@INSTANCE.nil? 
   @@INSTANCE 
end

Instance Method Details

#execute(lexer) ⇒ Object

<p>This action is implemented by calling Lexer#popMode.</p>



134
135
136
# File 'lib/antlr4/atn/LexerAction.rb', line 134

def execute(lexer)
    lexer.popMode()
end

#to_sObject



138
139
140
# File 'lib/antlr4/atn/LexerAction.rb', line 138

def to_s
    return "popMode"
end