| java.lang.Object xtc.tree.Visitor xtc.parser.ElementVoider
ElementVoider | public class ElementVoider extends Visitor (Code) | | 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
Resolver resolved into a single module, that text-only
productions have been
TextTester marked as such, and that
all expressions have been
Simplifier simplified .
author: Robert Grimm version: $Revision: 1.15 $ |
Field Summary | |
final 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. | final protected Runtime | runtime The runtime. | protected boolean | suppressVoided The flag for suppressing the insertion of voided elements. |
hasValue | protected boolean hasValue(Code) | | The flag for potentially having a value.
|
isLastElement | protected boolean isLastElement(Code) | | The flag for the last element.
|
isTopLevel | protected boolean isTopLevel(Code) | | The flag for the top-level element.
|
suppressVoided | protected boolean suppressVoided(Code) | | The flag for suppressing the insertion of voided elements.
|
ElementVoider | public ElementVoider(Runtime runtime, Analyzer analyzer)(Code) | | Create a new element voider.
Parameters: runtime - The runtime. Parameters: analyzer - The analyzer. |
visit | public void visit(Module m)(Code) | | Visit the specified self-contained module.
|
visit | public Element visit(Element e)(Code) | | Visit the specified element. This method provides the default
implementation for terminals, parse tree nodes, null literals,
node markers, and value elements.
|
wrap | protected Element wrap(Element el)(Code) | | Wrap the specified element in a voiding operator.
Parameters: el - The element to wrap. The wrapped element. |
|
|