Package org.jparsec
Class ScannerState
java.lang.Object
org.jparsec.ParseContext
org.jparsec.ScannerState
Parser state for scanner.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jparsec.ParseContext
ParseContext.ErrorType, ParseContext.ParserTrace -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScannerState(CharSequence source) ScannerState(String module, CharSequence source, int from, int end, SourceLocator locator, Object originalResult) ScannerState(String module, CharSequence source, int from, SourceLocator locator) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanapplyWithExceptionWrapped(Parser<?> parser) (package private) CharSequenceReads the characters as input.(package private) 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) final <T> T(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 Details
-
end
private final int end
-
-
Constructor Details
-
ScannerState
ScannerState(CharSequence source) -
ScannerState
ScannerState(String module, CharSequence source, int from, SourceLocator locator) -
ScannerState
ScannerState(String module, CharSequence source, int from, int end, SourceLocator locator, Object originalResult) - Parameters:
module- the current module name for error reportingsource- the source stringfrom- from where do we start to scan?end- till where do we stop scanning? (exclusive)locator- the locator for mapping index to line and column numberoriginalResult- the original result value
-
-
Method Details
-
peekChar
char peekChar()Description copied from class:ParseContextPeeks the current character. Only applicable to character level parser.- Specified by:
peekCharin classParseContext
-
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
-
getInputName
Description copied from class:ParseContextReturns the string representation of the current input (character or token).- Specified by:
getInputNamein classParseContext
-
characters
CharSequence characters()Description copied from class:ParseContextReads the characters as input. Only applicable to character level parsers.- Specified by:
charactersin classParseContext
-
getToken
Token getToken()Description copied from class:ParseContextReturns the current token. Only applicable to token level parser.- Specified by:
getTokenin classParseContext
-
run
-
applyWithExceptionWrapped
-