Top Description Fields Constructors Methods
org.jparsec

pack-priv final Class ScannerState

extends ParseContext
Class Inheritance
Imports
org.jparsec.error.ParserException

Parser state for scanner.
Author
Ben Yu

Field Summary

Modifier and TypeField and Description
private final int
Inherited from org.jparsec.ParseContext:
atEOFlocatormoduleresultsourcestep

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ScannerState(String module, CharSequence source, int from, SourceLocator locator)

pack-priv
ScannerState(String
the current module name for error reporting
module
,
CharSequence
the source string
source
,
int
from where do we start to scan?
from
,
int
till where do we stop scanning? (exclusive)
end
,
SourceLocator
the locator for mapping index to line and column number
locator
,
Object
the original result value
originalResult
)

Method Summary

Modifier and TypeMethod and Description
private boolean
pack-priv CharSequence
characters()

Implements abstract org.jparsec.ParseContext.characters.

Reads the characters as input.

pack-priv String
getInputName(int pos)

Implements abstract org.jparsec.ParseContext.getInputName.

Returns the string representation of the current input (character or token).

pack-priv Token
getToken()

Implements abstract org.jparsec.ParseContext.getToken.

Returns the current token.

pack-priv boolean
isEof()

Implements abstract org.jparsec.ParseContext.isEof.

pack-priv char
peekChar()

Implements abstract org.jparsec.ParseContext.peekChar.

Peeks the current character.

pack-priv final <T> T
run(Parser<T> parser)

pack-priv int
toIndex(int pos)

Implements abstract org.jparsec.ParseContext.toIndex.

Translates the logical position to physical index in the original source.

Inherited from org.jparsec.ParseContext:
applyAsDelimiterapplyNestedapplyNewNodebuildErrorParseTreebuildParseTreeenableTraceerrorIndexexpectedfailgetIndexgetTracemissingnextnextraiserenderErrorrepeatrepeatsetsetAtstillTheretoStringunexpectedwithErrorSuppressed

Field Detail

endback to summary
private final int end

Constructor Detail

ScannerStateback to summary
pack-priv ScannerState(CharSequence source)
ScannerStateback to summary
pack-priv ScannerState(String module, CharSequence source, int from, SourceLocator locator)
ScannerStateback to summary
pack-priv ScannerState(String module, CharSequence source, int from, int end, SourceLocator locator, Object originalResult)
Parameters
module:String

the current module name for error reporting

source:CharSequence

the source string

from:int

from where do we start to scan?

end:int

till where do we stop scanning? (exclusive)

locator:SourceLocator

the locator for mapping index to line and column number

originalResult:Object

the original result value

Method Detail

applyWithExceptionWrappedback to summary
private boolean applyWithExceptionWrapped(Parser<?> parser)
charactersback to summary
pack-priv CharSequence characters()

Implements abstract org.jparsec.ParseContext.characters.

Doc from org.jparsec.ParseContext.characters.

Reads the characters as input. Only applicable to character level parsers.

Annotations
@Override
getInputNameback to summary
pack-priv String getInputName(int pos)

Implements abstract org.jparsec.ParseContext.getInputName.

Doc from org.jparsec.ParseContext.getInputName.

Returns the string representation of the current input (character or token).

Annotations
@Override
getTokenback to summary
pack-priv Token getToken()

Implements abstract org.jparsec.ParseContext.getToken.

Doc from org.jparsec.ParseContext.getToken.

Returns the current token. Only applicable to token level parser.

Annotations
@Override
isEofback to summary
pack-priv boolean isEof()

Implements abstract org.jparsec.ParseContext.isEof.

Annotations
@Override
peekCharback to summary
pack-priv char peekChar()

Implements abstract org.jparsec.ParseContext.peekChar.

Doc from org.jparsec.ParseContext.peekChar.

Peeks the current character. Only applicable to character level parser.

Annotations
@Override
runback to summary
pack-priv final <T> T run(Parser<T> parser)
toIndexback to summary
pack-priv int toIndex(int pos)

Implements abstract org.jparsec.ParseContext.toIndex.

Doc from org.jparsec.ParseContext.toIndex.

Translates the logical position to physical index in the original source.

Annotations
@Override