public interface TreeBuilder
Modifier and Type | Method and Description |
---|---|
void |
endAmbiguity(int id,
int leftExtent,
int rightExtent)
Called at the end of an ambiguity that is not marked by a single nonterminal.
|
void |
endNonterminal(NonterminalSymbol symbol,
java.util.Map<java.lang.String,java.lang.String> attributes,
int leftExtent,
int rightExtent)
Called when a nonterminal ends.
|
void |
endTree(boolean ambiguous,
boolean absolutelyAmbiguous,
boolean infinitelyAmbiguous)
Called last, when construction finishes.
|
void |
startAmbiguity(int id,
int leftExtent,
int rightExtent)
Called at the start of an ambiguity that is not marked by a single nonterminal.
|
void |
startNonterminal(NonterminalSymbol symbol,
java.util.Map<java.lang.String,java.lang.String> attributes,
int leftExtent,
int rightExtent)
Called when a new nonterminal begins.
|
void |
startTree()
Called first, when construction begins.
|
void |
token(Token token,
java.util.Map<java.lang.String,java.lang.String> attributes,
int leftExtent,
int rightExtent)
Called when a terminal occurs.
|
void startTree()
void endTree(boolean ambiguous, boolean absolutelyAmbiguous, boolean infinitelyAmbiguous)
ambiguous
- was the parse ambiguous?absolutelyAmbiguous
- is the graph ambiguous?infinitelyAmbiguous
- is the graph infinitely ambiguous?void startNonterminal(NonterminalSymbol symbol, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
symbol
- The symbol.attributes
- Its attributes.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.void endNonterminal(NonterminalSymbol symbol, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
symbol
- The symbol.attributes
- Its attributes.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.void token(Token token, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
token
- The terminal token.attributes
- Its attributes.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.void startAmbiguity(int id, int leftExtent, int rightExtent)
The ambiguity id will distinguish this ambiguity from any other ambiguity. The numbers are not sequential or guaranteed stable across parses.
id
- The ambiguity id.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.void endAmbiguity(int id, int leftExtent, int rightExtent)
id
- The ambiguity id.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.