|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.GrammarVisitor
xtc.parser.Transformer.Lifter
public class Transformer.Lifter
Visitor to lift nested choices, repetitions, and options. This visitor also ensures that repeated, optional, and predicated elements are sequences.
| Field Summary |
|---|
| Fields inherited from class xtc.parser.GrammarVisitor |
|---|
analyzer, isBound, isLastElement, isPredicate, isRepeatedOnce, isTopLevel, isVoided, needsSequence, runtime, transformInPlace |
| Constructor Summary | |
|---|---|
Transformer.Lifter()
Create a new lifter. |
|
| Method Summary | |
|---|---|
protected Binding |
bind(Element e)
Bind the specified element. |
protected void |
lift(Type type,
NonTerminal nt,
OrderedChoice c)
Create a new production with the specified type, nonterminal, and ordered choice. |
protected Sequence |
process(Element e,
boolean bound)
Process the specified repeated, optional, or predicated element. |
Element |
visit(Option o)
Visit the specified option. |
Element |
visit(OrderedChoice c)
Visit the specified ordered choice. |
Element |
visit(Predicate p)
Visit the specified predicate. |
Element |
visit(Repetition r)
Visit the specified repetition. |
| Methods inherited from class xtc.parser.GrammarVisitor |
|---|
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
| 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 |
| Constructor Detail |
|---|
public Transformer.Lifter()
| Method Detail |
|---|
protected Binding bind(Element e)
e - The element.
protected Sequence process(Element e,
boolean bound)
e - The element.bound - The flag for whether the element's value is bound.
protected void lift(Type type,
NonTerminal nt,
OrderedChoice c)
current production's attributes and
text-only and token-level marks, recursively processes the
productions, and adds it to the grammar.
type - The type.nt - The nonterminal.c - The ordered choice.public Element visit(OrderedChoice c)
visit in class GrammarVisitorpublic Element visit(Repetition r)
visit in class GrammarVisitorpublic Element visit(Option o)
visit in class GrammarVisitorpublic Element visit(Predicate p)
visit in class GrammarVisitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||