|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.TreeTyper
public class TreeTyper
Visitor to determine a grammar's tree structure. This visitor assumes that the entire grammar is contained in a single module and has been annotated with appropriate value elements.
| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected AST |
ast
The common type operations. |
protected boolean |
flatten
The flag for flattening lists. |
protected Runtime |
runtime
The runtime. |
protected Sequence |
sequence
The current sequence. |
protected boolean |
strict
The flag for strict unification. |
| Constructor Summary | |
|---|---|
TreeTyper(Runtime runtime,
Analyzer analyzer,
AST ast)
Create a new tree typer. |
|
| Method Summary | |
|---|---|
protected void |
process(String name,
boolean isAction,
List<Binding> children)
Determine the type of the specified generic node constructor. |
void |
visit(Element e)
Visit the specified element. |
void |
visit(GenericActionValue v)
Visit the specified generic action value. |
void |
visit(GenericNodeValue v)
Visit the specified generic node value. |
void |
visit(Module m)
Visit the specified module. |
void |
visit(OrderedChoice c)
Visit the specified ordered choice. |
void |
visit(Production p)
Visit the specified production. |
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 boolean strict
protected boolean flatten
protected Sequence sequence
| Constructor Detail |
|---|
public TreeTyper(Runtime runtime,
Analyzer analyzer,
AST ast)
runtime - The runtime.ast - The type operations.analyzer - The analyzer utility.| Method Detail |
|---|
public void visit(Module m)
public void visit(Production p)
public void visit(OrderedChoice c)
public void visit(Sequence s)
public void visit(UnaryOperator op)
public void visit(Element e)
public void visit(GenericNodeValue v)
public void visit(GenericActionValue v)
protected void process(String name,
boolean isAction,
List<Binding> children)
name - The constructor's name.isAction - The flag for whether the constructor appears in an action.children - The list of bindings for the children.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||