| java.lang.Object xtc.tree.Visitor xtc.parser.GrammarVisitor
All known Subclasses: xtc.parser.PrefixFolder, xtc.parser.Tokenizer, xtc.parser.Renamer, xtc.parser.RootFinder, xtc.parser.ProductionVoider, xtc.parser.Inliner, xtc.parser.TerminalOptimizer, xtc.parser.ChoiceExpander, xtc.parser.DuplicateProductionFolder, xtc.parser.Simplifier, xtc.parser.TransientMarker, xtc.parser.DeadProductionEliminator, xtc.parser.GenericVoider, xtc.parser.ReferenceCounter,
GrammarVisitor | abstract public class GrammarVisitor extends Visitor (Code) | | The parent class of all grammar module visitors. This class
provides a skeleton visitor for processing
Grammar grammars and self-contained
Module modules , while maintaining a set
of useful flags.
author: Robert Grimm version: $Revision: 1.24 $ |
Field Summary | |
final 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
CodeGenerator codegeneration . | final 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. |
isBound | protected boolean isBound(Code) | | Flag for whether the current element is bound.
|
isLastElement | protected boolean isLastElement(Code) | | Flag for whether the current element is the last element of a
sequence.
|
isPredicate | protected boolean isPredicate(Code) | | Flag for whether the current element is in a predicate.
|
isRepeatedOnce | protected boolean isRepeatedOnce(Code) | | Flag for whether the current element is repeated at least once.
|
isTopLevel | protected boolean isTopLevel(Code) | | Flag for whether the current element is the top-level element of
a production.
|
isVoided | protected boolean isVoided(Code) | | Flag for whether the current element is voided.
|
needsSequence | protected boolean needsSequence(Code) | | Flag for whether the parent element requires that the directly
embedded elements are sequences for
CodeGenerator codegeneration . It is used by the
Simplifier to avoid
stripping sequences that need to be restored later on again.
|
transformInPlace | protected boolean transformInPlace(Code) | | Flag for whether to transform ordered choices, repetition, and
options in place, instead of creating a new production. This
flag is used by the
Transformer.Lifter lifter visitor.
|
GrammarVisitor | public GrammarVisitor(Runtime runtime, Analyzer analyzer)(Code) | | Create a new grammar visitor.
Parameters: runtime - The runtime. Parameters: analyzer - The analyzer utility. |
visit | public Element visit(Element e)(Code) | | Visit the specified element. This method provides the default
implementation for nonterminals, terminals (besides character
switches), node markers, actions, parse tree nodes, null
literals, and value elements.
|
|
|