Package org.jparsec
Class ParserState
java.lang.Object
org.jparsec.ParseContext
org.jparsec.ParserState
Represents
ParseContext
for token level parsing.-
Nested Class Summary
Nested classes/interfaces inherited from class org.jparsec.ParseContext
ParseContext.ErrorType, ParseContext.ParserTrace
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParserState
(String module, CharSequence source, Token[] input, int at, SourceLocator locator, int endIndex, Object result) -
Method Summary
Modifier and TypeMethodDescription(package private) CharSequence
Reads the characters as input.(package private) String
getInputName
(int pos) Returns the string representation of the current input (character or token).(package private) Token
getToken()
Returns the current token.(package private) boolean
isEof()
(package private) char
peekChar()
Peeks the current character.(package private) int
toIndex
(int pos) Translates the logical position to physical index in the original source.Methods inherited from class org.jparsec.ParseContext
applyAsDelimiter, applyNested, applyNewNode, buildErrorParseTree, buildParseTree, enableTrace, errorIndex, expected, fail, getIndex, getTrace, missing, next, next, raise, renderError, repeat, repeat, set, setAt, stillThere, toString, unexpected, withErrorSuppressed
-
Field Details
-
USED_ON_TOKEN_INPUT
- See Also:
-
input
-
endIndex
private final int endIndex
-
-
Constructor Details
-
ParserState
ParserState(String module, CharSequence source, Token[] input, int at, SourceLocator locator, int endIndex, Object result)
-
-
Method Details
-
isEof
boolean isEof()- Specified by:
isEof
in classParseContext
-
toIndex
int toIndex(int pos) Description copied from class:ParseContext
Translates the logical position to physical index in the original source.- Specified by:
toIndex
in classParseContext
-
getToken
Token getToken()Description copied from class:ParseContext
Returns the current token. Only applicable to token level parser.- Specified by:
getToken
in classParseContext
-
peekChar
char peekChar()Description copied from class:ParseContext
Peeks the current character. Only applicable to character level parser.- Specified by:
peekChar
in classParseContext
-
characters
CharSequence characters()Description copied from class:ParseContext
Reads the characters as input. Only applicable to character level parsers.- Specified by:
characters
in classParseContext
-
getInputName
Description copied from class:ParseContext
Returns the string representation of the current input (character or token).- Specified by:
getInputName
in classParseContext
-