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)
      Creates a token manager for the given input stream.
      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)
      Creates a token manager for the given input stream and 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)
      Sets the debug output stream.
      Parameters:
      ds - the new debug output stream
    • ReInit

      public void ReInit(SimpleCharStream stream)
      Reinitializes the token manager with a new input stream.
      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.
      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()
      Gets the next token.
      Returns:
      the next token