|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.TreeExtractor
public class TreeExtractor
Visitor to pear down a grammar to the structure of its abstract
syntax tree. This visitor assumes that the entire grammar is
contained in a single module. It also assumes that directly
left-recursive generic productions have not been
transformed by DirectLeftRecurser. Note that, after this
visitor has processed the grammar, the grammar violates the code
generator's requirements. Also note that this visitor internally
uses Simplifier and DeadProductionEliminator.
| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected AST |
ast
The common type operations. |
protected boolean |
isGeneric
The flag for whether the current production is generic. |
protected boolean |
isList
The flag for whether the current production is list-valued. |
protected boolean |
isTextOnly
The flag for whether the current production is text-only. |
protected boolean |
isToken
The flag for whether the current production is token-level. |
protected boolean |
keepLexical
The flag for removing all elements from lexical productions. |
protected Runtime |
runtime
The runtime. |
protected boolean |
setsValue
The flag for whether the current production defines the semantic value in an explicit action. |
| Constructor Summary | |
|---|---|
TreeExtractor(Runtime runtime,
Analyzer analyzer,
AST ast,
boolean keepLexical)
Create a new tree extractor. |
|
| Method Summary | |
|---|---|
void |
visit(CharCase c)
Visit the specified character case. |
void |
visit(CharSwitch s)
Visit the specified character switch. |
void |
visit(Element e)
Visit the specified element. |
void |
visit(FullProduction p)
Visit the specified full production. |
void |
visit(Module m)
Visit the specified module. |
void |
visit(OrderedChoice c)
Visit the specified ordered choice. |
void |
visit(Sequence s)
Visit the specified sequence. |
void |
visit(UnaryOperator op)
Visit the specified unary operator. |
| 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 final AST ast
protected final boolean keepLexical
protected boolean isGeneric
protected boolean isList
protected boolean isTextOnly
protected boolean isToken
protected boolean setsValue
| Constructor Detail |
|---|
public TreeExtractor(Runtime runtime,
Analyzer analyzer,
AST ast,
boolean keepLexical)
runtime - The runtime.analyzer - The analyzer utility.ast - The type operations.keepLexical - The flag for keeping elements of text-only
or token-level productions.| Method Detail |
|---|
public void visit(Module m)
public void visit(FullProduction p)
public void visit(OrderedChoice c)
public void visit(Sequence s)
public void visit(CharCase c)
public void visit(CharSwitch s)
public void visit(UnaryOperator op)
public void visit(Element e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||