public interface TreeSelector
Modifier and Type | Method and Description |
---|---|
void |
endNonterminal(NonterminalSymbol symbol,
java.util.Map<java.lang.String,java.lang.String> attributes,
int leftExtent,
int rightExtent)
Enda a nonterminal.
|
boolean |
getMadeAmbiguousChoice()
Did the tree selector make an arbitrary choice?
|
void |
reset()
Reset the state of the tree selector.
|
Family |
select(java.util.List<Family> choices,
java.util.List<Family> otherChoices)
Make a selection.
|
void |
startNonterminal(NonterminalSymbol symbol,
java.util.Map<java.lang.String,java.lang.String> attributes,
int leftExtent,
int rightExtent)
Start a nonterminal.
|
boolean getMadeAmbiguousChoice()
A non-arbitrary choice, resolved by priority or some other mechanism does not necessarily count as an ambiguous choice.
void startNonterminal(NonterminalSymbol symbol, java.util.Map<java.lang.String,java.lang.String> attributes, int leftExtent, int rightExtent)
The start and end nonterminal methods allow the tree selector to track what choices have already been made.
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)
The start and end nonterminal methods allow the tree selector to track what choices have already been made.
symbol
- The symbol.attributes
- Its attributes.leftExtent
- The starting position in the input.rightExtent
- The ending position in the input.Family select(java.util.List<Family> choices, java.util.List<Family> otherChoices)
The list of choices will always contain at least one choice. The list of otherChoices will include any choices previously made. The method must return a choice.
choices
- The available, unused choices.otherChoices
- The available, but previously selected choices.void reset()