Class DelpParserTokenManager
java.lang.Object
org.tweetyproject.arg.delp.parser.DelpParserTokenManager
- All Implemented Interfaces:
DelpParserConstants
Token Manager.
-
Field Summary
FieldsModifier 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
ConstructorsConstructorDescriptionCreates a token manager for the given input stream.DelpParserTokenManager(SimpleCharStream stream, int lexState) Creates a token manager for the given input stream and lexical state. -
Method Summary
Modifier and TypeMethodDescriptionGets the next token.voidReInit(SimpleCharStream stream) Reinitializes the token manager with a new input stream.voidReInit(SimpleCharStream stream, int lexState) Reinitializes the token manager with a new input stream and lexical state.voidSets the debug output stream.voidSwitchTo(int lexState) Switches to the specified lexical state.
-
Field Details
-
debugStream
Debug output. -
jjstrLiteralImages
Token literal values. -
lexStateNames
Lexer state names.
-
-
Constructor Details
-
DelpParserTokenManager
Creates a token manager for the given input stream.- Parameters:
stream- theSimpleCharStreamto be used for token input- Throws:
Error- if the static flag of the character stream is set
-
DelpParserTokenManager
Creates a token manager for the given input stream and lexical state.- Parameters:
stream- theSimpleCharStreamto be used for token inputlexState- the initial lexical state to switch to
-
-
Method Details
-
setDebugStream
Sets the debug output stream.- Parameters:
ds- the new debug output stream
-
ReInit
Reinitializes the token manager with a new input stream.- Parameters:
stream- the newSimpleCharStreamto be used for token input
-
ReInit
Reinitializes the token manager with a new input stream and lexical state.- Parameters:
stream- the newSimpleCharStreamto be used for token inputlexState- 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
Gets the next token.- Returns:
- the next token
-