Package eu.bandm.tools.ramus.ogma
Interface ParserFactory.Locator<D,T>
- Type Parameters:
D- the type of source document identifiersT- the type of token types; typically an enum type
- Enclosing class:
ParserFactory
public static interface ParserFactory.Locator<D,T>
Interface for location tracking service.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetLocation(State state) Retrieves recorded location information after tracked parsing.Returns a list of fragments for scoping that includes location tracking for this locator.Adds start and end location tracking to a given parser.
-
Method Details
-
track
Adds start and end location tracking to a given parser.- Parameters:
parser- the parser to extend- Returns:
- a parser that behaves equivalently to
body, but additionally records the start and end locations of its consumed input for later retrieval - Throws:
NullPointerException- ifparseris null- See Also:
-
getLocation
Retrieves recorded location information after tracked parsing.Behavior is unspecified if the given semantic state does not result from a tracking parser.
- Parameters:
state- a semantic state after parsing- Returns:
- an interval location spanning the consumed input
- Throws:
NullPointerException- ifstateis null- See Also:
-
getScope
Returns a list of fragments for scoping that includes location tracking for this locator.- Parameters:
args- the fragments to scope in addition to location tracking- Returns:
- a list of fragments that includes
argsand location tracking for this locator - Throws:
NullPointerException- ifargsis or contains null
-