public class DumpAst extends NodeVisitor
Modifier and Type | Field and Description |
---|---|
protected java.io.PrintWriter |
fw |
protected CodeWriter |
w |
Constructor and Description |
---|
DumpAst(CodeWriter w)
Deprecated.
|
DumpAst(Lang lang,
CodeWriter w) |
DumpAst(Lang lang,
java.lang.String name,
int width)
Deprecated.
Use the other constructor.
|
DumpAst(java.lang.String name,
int width)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected java.io.PrintWriter fw
protected CodeWriter w
@Deprecated public DumpAst(java.lang.String name, int width) throws java.io.IOException
java.io.IOException
@Deprecated public DumpAst(Lang lang, java.lang.String name, int width) throws java.io.IOException
java.io.IOException
@Deprecated public DumpAst(CodeWriter w)
public DumpAst(Lang lang, CodeWriter w)
public NodeVisitor enter(Node n)
dump
for
that node. Then we begin a new CodeWriter
block and traverse
the children.enter
in class NodeVisitor
n
- The root of the subtree to be traversed.NodeVisitor
which should be used to visit the
children of n
.public Node leave(Node old, Node n, NodeVisitor v)
CodeWriter
block that was begun in
enter
.leave
in class NodeVisitor
old
- The original state of root of the current subtree.n
- The current state of the root of the current subtree.v
- The NodeVisitor
object used to visit the children.n
.public void finish()
NodeVisitor
finish
in class NodeVisitor