public class ChoiceExpander extends GrammarVisitor
value
elements have been added to the grammar (notably, for generic
productions), and that the grammar's productions have been reference counted. Also note that this visitor
may result in new opportunities for the elimination of dead productions.
This visitor assumes that the entire grammar is contained in a
single module.| Modifier and Type | Class and Description |
|---|---|
static class |
ChoiceExpander.Mode
The processing mode.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
hasState
The flag for whether the grammar has the state attribute.
|
protected ChoiceExpander.Mode |
mode
The current processing mode.
|
analyzer, isBound, isLastElement, isPredicate, isRepeatedOnce, isTopLevel, isVoided, needsSequence, runtime, transformInPlace| Constructor and Description |
|---|
ChoiceExpander(Runtime runtime,
Analyzer analyzer)
Create a new choice expander.
|
| Modifier and Type | Method and Description |
|---|---|
protected NonTerminal |
candidate(Sequence alternative,
boolean top)
Determine whether the specified alternative is a candidate for
replacement.
|
protected void |
inlined(Production p)
Record that the specified production has been inlined and, if
necessary, print a message to the console.
|
java.lang.Object |
visit(Module m)
Visit the specified grammar.
|
Element |
visit(OrderedChoice c)
Visit the specified ordered choice.
|
Element |
visit(Sequence s)
Visit the specified sequence.
|
Element |
visit(ValueElement v)
Visit the specified value element.
|
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitdispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visitprotected boolean hasState
protected ChoiceExpander.Mode mode
protected NonTerminal candidate(Sequence alternative, boolean top)
null.alternative - The alternative.top - The flag for whether the alternative appears in a
top-level choice.protected void inlined(Production p)
p - The production.public java.lang.Object visit(Module m)
visit in class GrammarVisitorpublic Element visit(OrderedChoice c)
visit in class GrammarVisitorpublic Element visit(Sequence s)
visit in class GrammarVisitorpublic Element visit(ValueElement v)
Copyright © 2014. All Rights Reserved.