public class NopTreeBuilder extends java.lang.Object implements TreeBuilder
TreeBuilder interface, but discards all the output.
It is a "no-op" tree builder.
| Constructor and Description |
|---|
NopTreeBuilder() |
| 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.
|
public void startTree()
TreeBuilderstartTree in interface TreeBuilderpublic void endTree(boolean ambiguous,
boolean absolutelyAmbiguous,
boolean infinitelyAmbiguous)
TreeBuilderendTree in interface TreeBuilderambiguous - was the parse ambiguous?absolutelyAmbiguous - is the graph ambiguous?infinitelyAmbiguous - is the graph infinitely ambiguous?public void startNonterminal(NonterminalSymbol symbol, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
TreeBuilderstartNonterminal in interface TreeBuildersymbol - The symbol.attributes - Its attributes.leftExtent - The starting position in the input.rightExtent - The ending position in the input.public void endNonterminal(NonterminalSymbol symbol, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
TreeBuilderendNonterminal in interface TreeBuildersymbol - The symbol.attributes - Its attributes.leftExtent - The starting position in the input.rightExtent - The ending position in the input.public void token(Token token, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
TreeBuildertoken in interface TreeBuildertoken - The terminal token.attributes - Its attributes.leftExtent - The starting position in the input.rightExtent - The ending position in the input.public void startAmbiguity(int id,
int leftExtent,
int rightExtent)
TreeBuilderThe ambiguity id will distinguish this ambiguity from any other ambiguity. The numbers are not sequential or guaranteed stable across parses.
startAmbiguity in interface TreeBuilderid - The ambiguity id.leftExtent - The starting position in the input.rightExtent - The ending position in the input.public void endAmbiguity(int id,
int leftExtent,
int rightExtent)
TreeBuilderendAmbiguity in interface TreeBuilderid - The ambiguity id.leftExtent - The starting position in the input.rightExtent - The ending position in the input.