Class UPParserTokenManager
java.lang.Object
org.tweetyproject.preferences.io.UPParserTokenManager
- All Implemented Interfaces:
UPParserConstants
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.preferences.io.UPParserConstants
DEFAULT, ELEMENT, EOF, EOL, INDEX, LBRA, OPERATION, RBRA, tokenImage -
Constructor Summary
ConstructorsConstructorDescriptionUPParserTokenManager(SimpleCharStream stream) Token manager for parsing with the given input stream.UPParserTokenManager(SimpleCharStream stream, int lexState) Token manager for parsing with the given input stream and initial lexical state. -
Method Summary
Modifier and TypeMethodDescriptionGet the next Token.voidReInit(SimpleCharStream stream) Reinitializes the parser with a new input stream, resetting to default lexical state.voidReInit(SimpleCharStream stream, int lexState) Reinitializes the parser with a new input stream and sets the lexical state.voidSet debug output.voidSwitchTo(int lexState) Switches the lexical analyzer to a specified lexical state.
-
Field Details
-
debugStream
Debug output. -
jjstrLiteralImages
Token literal values. -
lexStateNames
Lexer state names.
-
-
Constructor Details
-
UPParserTokenManager
Token manager for parsing with the given input stream.- Parameters:
stream- the simple
-
UPParserTokenManager
Token manager for parsing with the given input stream and initial lexical state.- Parameters:
stream- The input stream to be used by the token manager.lexState- The initial lexical state to switch to.
-
-
Method Details
-
setDebugStream
-
ReInit
Reinitializes the parser with a new input stream, resetting to default lexical state.- Parameters:
stream- The new input stream to be used.
-
ReInit
Reinitializes the parser with a new input stream and sets the lexical state.- Parameters:
stream- The new input stream to be used.lexState- The lexical state to switch to.
-
SwitchTo
public void SwitchTo(int lexState) Switches the lexical analyzer to a specified lexical state.- Parameters:
lexState- The new lexical state to switch to.- Throws:
TokenMgrError- If the specified lexical state is invalid.
-
getNextToken
-