public abstract class GrammarVisitor extends Visitor
grammars
and self-contained modules, while maintaining a set
of useful flags.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
GrammarVisitor(Runtime runtime,
Analyzer analyzer)
Create a new grammar visitor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visitprotected 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.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(SemanticPredicate p)
public Element visit(VoidedElement v)
public Element visit(StringMatch m)
public Element visit(CharSwitch s)
public Element visit(ParserAction pa)
Copyright © 2014. All Rights Reserved.