LexerAction is used for tracking input offsets
for position-dependent actions within a LexerActionExecutor.
This action is not serialized as part of the ATN, and is only required for
position-dependent lexer actions which appear at a location other than the
end of a rule. For more information about DFA optimizations employed for
lexer actions, see LexerActionExecutor#append and
LexerActionExecutor#fixOffsetBeforeMatch.
| Modifier and Type | Field and Description |
|---|---|
| private final LexerAction | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | LexerIndexedCustomAction(int
The offset into the input offset, LexerAction CharStream, relative to
the token start index, at which the specified lexer action should be
executed.The lexer action to execute at a particular offset in the
input action)CharStream.Constructs a new indexed custom action by associating a character offset
with a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public void | execute(Lexer
The lexer instance. lexer)Implements org. Lexer.
|
| public LexerAction | Returns: ALexerAction object which executes the lexer action.Gets the lexer action to execute. |
| public LexerActionType | Returns: This method returns the result of callinggetActionType
on the LexerAction returned by getAction.Implements org. |
| public int | Returns: The location in the inputCharStream at which the lexer
action should be executed.Gets the location in the input |
| public int | |
| public boolean | Returns: This method returnstrue.Implements org. |
| action | back to summary |
|---|---|
| private final LexerAction action | |
| offset | back to summary |
|---|---|
| private final int offset | |
| LexerIndexedCustomAction | back to summary |
|---|---|
| public LexerIndexedCustomAction(int offset, LexerAction action) Constructs a new indexed custom action by associating a character offset
with a Note This class is only required for lexer actions for which
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| execute | back to summary |
|---|---|
| public void execute(Lexer lexer) Implements org. Doc from org. Execute the lexer action in the context of the specified For position-dependent actions, the input stream must already be positioned correctly prior to calling this method. This method calls | |
| getAction | back to summary |
|---|---|
| public LexerAction getAction() Gets the lexer action to execute.
| |
| getActionType | back to summary |
|---|---|
| public LexerActionType getActionType() Implements org. Doc from org. Gets the serialization type of the lexer action.
| |
| getOffset | back to summary |
|---|---|
| public int getOffset() Gets the location in the input
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isPositionDependent | back to summary |
|---|---|
| public boolean isPositionDependent() Implements org. Doc from org. Gets whether the lexer action is position-dependent. Position-dependent
actions may have different semantics depending on the Many lexer commands, including
| |