Package org.antlr.v4.runtime.atn
Class LexerSkipAction
java.lang.Object
org.antlr.v4.runtime.atn.LexerSkipAction
- All Implemented Interfaces:
LexerAction
Implements the
skip
lexer action by calling Lexer.skip()
.
The skip
command does not have any parameters, so this action is
implemented as a singleton instance exposed by INSTANCE
.
- Since:
- 4.2
- Author:
- Sam Harwell
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LexerSkipAction
Provides a singleton instance of this parameterless lexer action. -
Method Summary
-
Field Details
-
INSTANCE
Provides a singleton instance of this parameterless lexer action.
-
-
Method Details
-
getActionType
Gets the serialization type of the lexer action.- Specified by:
getActionType
in interfaceLexerAction
- Returns:
- This method returns
LexerActionType.SKIP
.
-
isPositionDependent
public boolean isPositionDependent()Gets whether the lexer action is position-dependent. Position-dependent actions may have different semantics depending on theCharStream
index at the time the action is executed.Many lexer commands, including
type
,skip
, andmore
, do not check the input index during their execution. Actions like this are position-independent, and may be stored more efficiently as part of theLexerATNConfig.lexerActionExecutor
.- Specified by:
isPositionDependent
in interfaceLexerAction
- Returns:
- This method returns
false
.
-
execute
Execute the lexer action in the context of the specifiedLexer
.For position-dependent actions, the input stream must already be positioned correctly prior to calling this method.
This action is implemented by calling
Lexer.skip()
.- Specified by:
execute
in interfaceLexerAction
- Parameters:
lexer
- The lexer instance.
-
hashCode
public int hashCode() -
equals
-
toString
-