LexerCustomAction

@uml Executes a custom lexer action by calling {@link Recognizer#action} with the rule and action indexes assigned to the custom action. The implementation of a custom action is added to the generated code for the lexer in an override of {@link Recognizer#action} when the grammar is compiled.

<p>This class may represent embedded actions created with the <code>{...}</code> syntax in ANTLR 4, as well as actions created for lexer commands where the command argument could not be evaluated when the grammar was compiled.</p>

Constructors

this
this(int ruleIndex, int actionIndex)

@uml Constructs a custom lexer action with the specified rule and action indexes.

Members

Functions

equals
bool equals(Object obj)
Undocumented in source. Be warned that the author may not have intended to support it.
execute
void execute(InterfaceLexer lexer)

@uml @override <p>Custom actions are implemented by calling {@link Lexer#action} with the appropriate rule and action indexes.</p>

getActionIndex
int getActionIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
getActionType
LexerActionType getActionType()

@uml This method returns {@link LexerActionType#CUSTOM}. @safe @nothrow

getRuleIndex
int getRuleIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
isPositionDependent
bool isPositionDependent()

@uml @override Gets whether the lexer action is position-dependent. Position-dependent actions may have different semantics depending on the {@link CharStream} index at the time the action is executed <p>Custom actions are position-dependent since they may represent a user-defined embedded action which makes calls to methods like {@link Lexer#getText}.</p>

toHash
size_t toHash()

@uml @safe @nothrow @override

Variables

actionIndex
int actionIndex;
Undocumented in source.
ruleIndex
int ruleIndex;
Undocumented in source.

Inherited Members

From LexerAction

getActionType
LexerActionType getActionType()

Gets the serialization type of the lexer action.

isPositionDependent
bool isPositionDependent()

Gets whether the lexer action is position-dependent. Position-dependent actions may have different semantics depending on the {@link CharStream} index at the time the action is executed.

execute
void execute(InterfaceLexer lexer)

Execute the lexer action in the context of the specified {@link Lexer}.

toHash
size_t toHash()

@uml @nothrow

Meta