Class DelpParserTokenManager

java.lang.Object
org.tweetyproject.arg.delp.parser.DelpParserTokenManager
All Implemented Interfaces:
DelpParserConstants

public class DelpParserTokenManager extends Object implements DelpParserConstants
Token Manager.
  • Field Details

    • debugStream

      public PrintStream debugStream
      Debug output.
    • jjstrLiteralImages

      public static final String[] jjstrLiteralImages
      Token literal values.
    • lexStateNames

      public static final String[] lexStateNames
      Lexer state names.
  • Constructor Details

    • DelpParserTokenManager

      public DelpParserTokenManager(SimpleCharStream stream)
      Constructor for initializing the token manager with the specified input stream.

      This constructor sets up the token manager with the provided character stream. It also verifies that the static flag of the character stream is not set.

      Parameters:
      stream - The SimpleCharStream to be used for token input.
      Throws:
      Error - if the static flag of the character stream is set.
    • DelpParserTokenManager

      public DelpParserTokenManager(SimpleCharStream stream, int lexState)
      Constructor for initializing the token manager with the specified input stream and lexical state.

      This constructor sets up the token manager with the provided character stream and switches to the specified lexical state.

      Parameters:
      stream - The SimpleCharStream to be used for token input.
      lexState - The initial lexical state to switch to.
  • Method Details

    • setDebugStream

      public void setDebugStream(PrintStream ds)
      Set debug output.
      Parameters:
      ds - printstream
    • ReInit

      public void ReInit(SimpleCharStream stream)
      Reinitializes the token manager with a new input stream.

      This method resets the token manager's state and prepares it to process tokens from the new input stream. It also resets the current lexical state to the default.

      Parameters:
      stream - The new SimpleCharStream to be used for token input.
    • ReInit

      public void ReInit(SimpleCharStream stream, int lexState)
      Reinitializes the token manager with a new input stream and lexical state.

      This method reinitializes the token manager to process tokens from a new input stream and switch to the specified lexical state.

      Parameters:
      stream - The new SimpleCharStream to be used for token input.
      lexState - The initial lexical state to switch to.
    • SwitchTo

      public void SwitchTo(int lexState)
      Switches to the specified lexical state.

      This method changes the current lexical state of the token manager to the specified state. If the provided state is invalid, an error is thrown.

      Parameters:
      lexState - The lexical state to switch to.
      Throws:
      TokenMgrError - if the specified lexical state is invalid.
    • getNextToken

      public Token getNextToken()
      Get the next Token.
      Returns:
      the token