Class DelpParserTokenManager
java.lang.Object
org.tweetyproject.arg.delp.parser.DelpParserTokenManager
-
Field Summary
Modifier and TypeFieldDescriptionDebug output.static final String[]
Token literal values.static final String[]
Lexer state names.Fields inherited from interface org.tweetyproject.arg.delp.parser.DelpParserConstants
DEFAULT, EOF, NAME, QUOTED, tokenImage
-
Constructor Summary
ConstructorDescriptionConstructor for initializing the token manager with the specified input stream.DelpParserTokenManager
(SimpleCharStream stream, int lexState) Constructor for initializing the token manager with the specified input stream and lexical state. -
Method Summary
Modifier and TypeMethodDescriptionGet the next Token.void
ReInit
(SimpleCharStream stream) Reinitializes the token manager with a new input stream.void
ReInit
(SimpleCharStream stream, int lexState) Reinitializes the token manager with a new input stream and lexical state.void
Set debug output.void
SwitchTo
(int lexState) Switches to the specified lexical state.
-
Field Details
-
debugStream
Debug output. -
jjstrLiteralImages
Token literal values. -
lexStateNames
Lexer state names.
-
-
Constructor Details
-
DelpParserTokenManager
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
- TheSimpleCharStream
to be used for token input.- Throws:
Error
- if the static flag of the character stream is set.
-
DelpParserTokenManager
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
- TheSimpleCharStream
to be used for token input.lexState
- The initial lexical state to switch to.
-
-
Method Details
-
setDebugStream
-
ReInit
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 newSimpleCharStream
to be used for token input.
-
ReInit
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 newSimpleCharStream
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
-