Class LexerMoreAction

java.lang.Object
org.antlr.v4.runtime.atn.LexerMoreAction
All Implemented Interfaces:
LexerAction

public final class LexerMoreAction extends Object implements LexerAction
Implements the more lexer action by calling Lexer.more().

The more command does not have any parameters, so this action is implemented as a singleton instance exposed by INSTANCE.

Since:
4.2
  • Field Details

    • INSTANCE

      public static final LexerMoreAction INSTANCE
      Provides a singleton instance of this parameterless lexer action.
  • Constructor Details

    • LexerMoreAction

      private LexerMoreAction()
      Constructs the singleton instance of the lexer more command.
  • Method Details

    • getActionType

      public LexerActionType getActionType()
      Gets the serialization type of the lexer action.
      Specified by:
      getActionType in interface LexerAction
      Returns:
      This method returns LexerActionType.MORE.
    • isPositionDependent

      public boolean isPositionDependent()
      Gets whether the lexer action is position-dependent. Position-dependent actions may have different semantics depending on the CharStream index at the time the action is executed.

      Many lexer commands, including type, skip, and more, do not check the input index during their execution. Actions like this are position-independent, and may be stored more efficiently as part of the LexerATNConfig.lexerActionExecutor.

      Specified by:
      isPositionDependent in interface LexerAction
      Returns:
      This method returns false.
    • execute

      public void execute(Lexer lexer)
      Execute the lexer action in the context of the specified Lexer.

      For position-dependent actions, the input stream must already be positioned correctly prior to calling this method.

      This action is implemented by calling Lexer.more().

      Specified by:
      execute in interface LexerAction
      Parameters:
      lexer - The lexer instance.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object