|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.ElementVoider
public class ElementVoider
Visitor to void ordered choices, repetitions, and options. This
visitor voids ordered choices, repetitions, and options, if all
expressions appearing in such an expression are either void
nonterminals or explicitly voided. It requires that a grammar has
been resolved into a single module, that text-only
productions have been marked as such, and that
all expressions have been simplified.
| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected boolean |
hasValue
The flag for potentially having a value. |
protected boolean |
isLastElement
The flag for the last element. |
protected boolean |
isTopLevel
The flag for the top-level element. |
protected Runtime |
runtime
The runtime. |
protected boolean |
suppressVoided
The flag for suppressing the insertion of voided elements. |
| Constructor Summary | |
|---|---|
ElementVoider(Runtime runtime,
Analyzer analyzer)
Create a new element voider. |
|
| Method Summary | |
|---|---|
Action |
visit(Action a)
Visit the specified action. |
Binding |
visit(Binding b)
Visit the specified binding. |
Element |
visit(Element e)
Visit the specified element. |
void |
visit(FullProduction p)
Visit the specified full production. |
void |
visit(Module m)
Visit the specified self-contained module. |
NonTerminal |
visit(NonTerminal nt)
Visit the specified nonterminal. |
Element |
visit(OrderedChoice c)
Visit the specified ordered choice. |
ParserAction |
visit(ParserAction pa)
Visit the specified parser action. |
Element |
visit(Predicate p)
Visit the specified predicate. |
Element |
visit(Quantification q)
Visit the specified quantification. |
Element |
visit(Sequence s)
Visit the specified sequence. |
StringMatch |
visit(StringMatch m)
Visit the specified string match. |
VoidedElement |
visit(VoidedElement v)
Visit the specified voided element. |
protected Element |
wrap(Element el)
Wrap the specified element in a voiding operator. |
| Methods inherited from class xtc.tree.Visitor |
|---|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Runtime runtime
protected final Analyzer analyzer
protected boolean isTopLevel
protected boolean isLastElement
protected boolean suppressVoided
protected boolean hasValue
| Constructor Detail |
|---|
public ElementVoider(Runtime runtime,
Analyzer analyzer)
runtime - The runtime.analyzer - The analyzer.| Method Detail |
|---|
protected Element wrap(Element el)
el - The element to wrap.
public void visit(Module m)
public void visit(FullProduction p)
public Element visit(OrderedChoice c)
public Element visit(Quantification q)
public Element visit(Sequence s)
public Element visit(Predicate p)
public VoidedElement visit(VoidedElement v)
public Binding visit(Binding b)
public StringMatch visit(StringMatch m)
public ParserAction visit(ParserAction pa)
public Action visit(Action a)
public NonTerminal visit(NonTerminal nt)
public Element visit(Element e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||