public class GllResult extends java.lang.Object implements GearleyResult
Modifier and Type | Field and Description |
---|---|
boolean |
success |
Constructor and Description |
---|
GllResult(GllParser parser,
BinarySubtree bsr) |
Modifier and Type | Method and Description |
---|---|
GearleyResult |
continueParsing()
After a successful prefix parse, this method continues parsing.
|
GearleyResult |
continueParsing(GearleyParser parser)
After a successful prefix parse, this method continues parsing with a new parser.
|
Arborist |
getArborist()
Get an arborist to extract trees from the forest.
|
Arborist |
getArborist(Axe axe)
Get an arborist to extract trees from the forest.
|
int |
getColumnNumber()
Returns the column number of the last character on the last line read by the parser.
|
ParseForest |
getForest()
Return the parse forest created by the parser.
|
Token |
getLastToken()
Return the last token parsed.
|
int |
getLineNumber()
Returns the line number of the last line read by the parser.
|
int |
getOffset()
Returns the last offset read by the parser.
|
GearleyParser |
getParser()
The parser used.
|
long |
getParseTime()
Returns the number of milliseconds spent parsing.
|
java.util.Set<TerminalSymbol> |
getPredictedTerminals()
Returns the symbols predicted as possibly next in the case where a parse fails.
|
int |
getTokenCount()
Return the number of tokens parsed.
|
boolean |
isAmbiguous()
Returns true if the parse was ambiguous.
|
boolean |
isInfinitelyAmbiguous()
Returns true if the parse was infinitely ambiguous.
|
boolean |
prefixSucceeded()
Returns true if the parser successfully processed a prefix of the input.
|
boolean |
succeeded()
Returns true of the parse was successful.
|
public GllResult(GllParser parser, BinarySubtree bsr)
public GearleyResult continueParsing()
GearleyResult
continueParsing
in interface GearleyResult
public GearleyResult continueParsing(GearleyParser parser)
GearleyResult
continueParsing
in interface GearleyResult
parser
- The (next) parser.public ParseForest getForest()
GearleyResult
This method returns null
if the parse was unsuccessful.
getForest
in interface GearleyResult
public Arborist getArborist()
GearleyResult
The default arborist is created with Arborist.getArborist(ParseForest)
.
getArborist
in interface GearleyResult
public Arborist getArborist(Axe axe)
GearleyResult
The arborist is created with Arborist.getArborist(ParseForest, Axe)
.
getArborist
in interface GearleyResult
axe
- the arborists axepublic boolean isAmbiguous()
GearleyResult
isAmbiguous
in interface GearleyResult
public boolean isInfinitelyAmbiguous()
GearleyResult
The parse will only be infinitely ambiguous if the grqmmar contained a loop.
isInfinitelyAmbiguous
in interface GearleyResult
public int getTokenCount()
GearleyResult
getTokenCount
in interface GearleyResult
public Token getLastToken()
GearleyResult
getLastToken
in interface GearleyResult
public int getOffset()
GearleyResult
getOffset
in interface GearleyResult
public int getLineNumber()
GearleyResult
getLineNumber
in interface GearleyResult
public int getColumnNumber()
GearleyResult
getColumnNumber
in interface GearleyResult
public java.util.Set<TerminalSymbol> getPredictedTerminals()
GearleyResult
getPredictedTerminals
in interface GearleyResult
public GearleyParser getParser()
GearleyResult
getParser
in interface GearleyResult
public boolean prefixSucceeded()
GearleyResult
Note that the GLL parser does not support prefix parsing.
prefixSucceeded
in interface GearleyResult
public long getParseTime()
GearleyResult
getParseTime
in interface GearleyResult
public boolean succeeded()
GearleyResult
succeeded
in interface GearleyResult