Creates a
LexerActionExecutor which encodes the current offset for position-dependent lexer actions.
Normally, when the executor encounters lexer actions where ILexerAction.IsPositionDependent() returns , it calls Antlr4.Runtime.IIntStream.Seek(int) on the input Antlr4.Runtime.ICharStream to set the input position to the end of the current token. This behavior provides for efficient DFA representation of lexer actions which appear at the end of a lexer rule, even when the lexer rule matches a variable number of characters.
Prior to traversing a match transition in the ATN, the current offset from the token start index is assigned to all position-dependent lexer actions which have not already been assigned a fixed offset. By storing the offsets relative to the token start index, the DFA representation of lexer actions which appear in the middle of tokens remains efficient due to sharing among tokens of the same length, regardless of their absolute position in the input stream.
If the current executor already has offsets assigned to all position-dependent lexer actions, the method returns this
.