|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.GrammarVisitor
public abstract class GrammarVisitor
The parent class of all grammar module visitors. This class
provides a skeleton visitor for processing grammars
and self-contained modules, while maintaining a set
of useful flags.
| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected boolean |
isBound
Flag for whether the current element is bound. |
protected boolean |
isLastElement
Flag for whether the current element is the last element of a sequence. |
protected boolean |
isPredicate
Flag for whether the current element is in a predicate. |
protected boolean |
isRepeatedOnce
Flag for whether the current element is repeated at least once. |
protected boolean |
isTopLevel
Flag for whether the current element is the top-level element of a production. |
protected boolean |
isVoided
Flag for whether the current element is voided. |
protected boolean |
needsSequence
Flag for whether the parent element requires that the directly embedded elements are sequences for code
generation. |
protected Runtime |
runtime
The runtime. |
protected boolean |
transformInPlace
Flag for whether to transform ordered choices, repetition, and options in place, instead of creating a new production. |
| Constructor Summary | |
|---|---|
GrammarVisitor(Runtime runtime,
Analyzer analyzer)
Create a new grammar visitor. |
|
| Method Summary | |
|---|---|
Element |
visit(Binding b)
Visit the specified binding. |
CharCase |
visit(CharCase c)
Visit the specified character case. |
Element |
visit(CharSwitch s)
Visit the specified character switch. |
Element |
visit(Element e)
Visit the specified element. |
java.lang.Object |
visit(Grammar g)
Visit the specified grammar. |
java.lang.Object |
visit(Module m)
Visit the specified self-contained module. |
Element |
visit(Option o)
Visit the specified option. |
Element |
visit(OrderedChoice c)
Visit the specified ordered choice. |
Element |
visit(ParserAction pa)
Visit the specified parser action. |
Element |
visit(Predicate p)
Visit the specified predicate. |
Production |
visit(Production p)
Visit the specified production. |
Element |
visit(Repetition r)
Visit the specified repetition. |
Element |
visit(SemanticPredicate p)
Visit the specified semantic predicate. |
Element |
visit(Sequence s)
Visit the specified sequence. |
Element |
visit(StringMatch m)
Visit the specified string match. |
Element |
visit(VoidedElement v)
Visit the specified voided element. |
| 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 isVoided
protected boolean isBound
protected boolean isLastElement
protected boolean isPredicate
protected boolean isRepeatedOnce
protected boolean needsSequence
code
generation. It is used by the Simplifier to avoid
stripping sequences that need to be restored later on again.
protected boolean transformInPlace
lifter visitor.
| Constructor Detail |
|---|
public GrammarVisitor(Runtime runtime,
Analyzer analyzer)
runtime - The runtime.analyzer - The analyzer utility.| Method Detail |
|---|
public java.lang.Object visit(Grammar g)
public java.lang.Object visit(Module m)
public Production visit(Production p)
public Element visit(OrderedChoice c)
public Element visit(Repetition r)
public Element visit(Option o)
public Element visit(Sequence s)
public Element visit(Predicate p)
public Element visit(SemanticPredicate p)
public Element visit(VoidedElement v)
public Element visit(Binding b)
public Element visit(StringMatch m)
public CharCase visit(CharCase c)
public Element visit(CharSwitch s)
public Element visit(ParserAction pa)
public Element visit(Element e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||