LexerActionExecutor class

Represents an executor for a sequence of lexer actions which traversed during the matching operation of a lexer rule (token).

The executor tracks position information for position-dependent lexer actions efficiently, ensuring that actions appearing only at the end of the rule do not cause bloating of the [DFA] created for the lexer.

@since 4.2

Constructors

LexerActionExecutor(List<LexerAction> lexerActions)
Constructs an executor for a sequence of LexerAction actions. @param lexerActions The lexer actions to execute.

Properties

hashCode int
Caches the result of {@link #hashCode} since the hash code is an element of the performance-critical {@link LexerATNConfig#hashCode} operation.
no setteroverride
lexerActions List<LexerAction>
Gets the lexer actions to be executed by this executor. @return The lexer actions to be executed by this executor.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute(Lexer lexer, CharStream input, int startIndex) → void
Execute the actions encapsulated by this executor within the context of a particular Lexer.
fixOffsetBeforeMatch(int offset) LexerActionExecutor
Creates a LexerActionExecutor which encodes the current offset for position-dependent lexer actions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

append(LexerActionExecutor? lexerActionExecutor, LexerAction lexerAction) LexerActionExecutor
Creates a LexerActionExecutor which executes the actions for the input lexerActionExecutor followed by a specified lexerAction.