polyglot.visit
Class DumpAst
java.lang.Object
polyglot.visit.NodeVisitor
polyglot.visit.DumpAst
- public class DumpAst
- extends NodeVisitor
Visitor which dumps the AST to a file.
Method Summary |
NodeVisitor |
enter(Node n)
Visit each node before traversal of children. |
void |
finish()
The finish method is called after the entire tree has been visited. |
Node |
leave(Node old,
Node n,
NodeVisitor v)
This method is called only after normal traversal of the children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fw
protected java.io.Writer fw
w
protected CodeWriter w
DumpAst
public DumpAst(java.lang.String name,
int width)
throws java.io.IOException
DumpAst
public DumpAst(CodeWriter w)
enter
public NodeVisitor enter(Node n)
- Visit each node before traversal of children. Call
dump
for
that node. Then we begin a new CodeWriter
block and traverse
the children.
- Overrides:
enter
in class NodeVisitor
leave
public Node leave(Node old,
Node n,
NodeVisitor v)
- This method is called only after normal traversal of the children. Thus
we must end the
CodeWriter
block that was begun in
enter
.
- Overrides:
leave
in class NodeVisitor
finish
public void finish()
- Description copied from class:
NodeVisitor
- The finish method is called after the entire tree has been visited.
This method allows the visitor to perform any last minute cleanup,
including flushing buffers and I/O connections.
- Overrides:
finish
in class NodeVisitor