Package org.jparsec
Class ParserState
- java.lang.Object
-
- org.jparsec.ParseContext
-
- org.jparsec.ParserState
-
final class ParserState extends ParseContext
RepresentsParseContextfor token level parsing.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jparsec.ParseContext
ParseContext.ErrorType, ParseContext.ParserTrace
-
-
Constructor Summary
Constructors Constructor Description ParserState(java.lang.String module, java.lang.CharSequence source, Token[] input, int at, SourceLocator locator, int endIndex, java.lang.Object result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.CharSequencecharacters()Reads the characters as input.(package private) java.lang.StringgetInputName(int pos)Returns the string representation of the current input (character or token).(package private) TokengetToken()Returns the current token.(package private) booleanisEof()(package private) charpeekChar()Peeks the current character.(package private) inttoIndex(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 Detail
-
USED_ON_TOKEN_INPUT
private static final java.lang.String USED_ON_TOKEN_INPUT
- See Also:
- Constant Field Values
-
input
private final Token[] input
-
endIndex
private final int endIndex
-
-
Constructor Detail
-
ParserState
ParserState(java.lang.String module, java.lang.CharSequence source, Token[] input, int at, SourceLocator locator, int endIndex, java.lang.Object result)
-
-
Method Detail
-
isEof
boolean isEof()
- Specified by:
isEofin classParseContext
-
toIndex
int toIndex(int pos)
Description copied from class:ParseContextTranslates the logical position to physical index in the original source.- Specified by:
toIndexin classParseContext
-
getToken
Token getToken()
Description copied from class:ParseContextReturns the current token. Only applicable to token level parser.- Specified by:
getTokenin classParseContext
-
peekChar
char peekChar()
Description copied from class:ParseContextPeeks the current character. Only applicable to character level parser.- Specified by:
peekCharin classParseContext
-
characters
java.lang.CharSequence characters()
Description copied from class:ParseContextReads the characters as input. Only applicable to character level parsers.- Specified by:
charactersin classParseContext
-
getInputName
java.lang.String getInputName(int pos)
Description copied from class:ParseContextReturns the string representation of the current input (character or token).- Specified by:
getInputNamein classParseContext
-
-