polyglot.visit
Class FlattenVisitor

java.lang.Object
  extended bypolyglot.visit.NodeVisitor
      extended bypolyglot.visit.FlattenVisitor

public class FlattenVisitor
extends NodeVisitor

The FlattenVisitor flattens the AST,


Field Summary
protected static int count
           
protected  NodeFactory nf
           
protected  Node noFlatten
           
protected  java.util.LinkedList stack
           
protected  TypeSystem ts
           
 
Constructor Summary
FlattenVisitor(TypeSystem ts, NodeFactory nf)
           
 
Method Summary
 NodeVisitor enter(Node n)
          When entering a BlockStatement, place a new StatementList onto the stack
 Node leave(Node old, Node n, NodeVisitor v)
          Flatten complex expressions within the AST
protected static java.lang.String newID()
           
 Node override(Node n)
           
 
Methods inherited from class polyglot.visit.NodeVisitor
begin, enter, finish, finish, leave, override, toString, visitEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ts

protected TypeSystem ts

nf

protected NodeFactory nf

stack

protected java.util.LinkedList stack

count

protected static int count

noFlatten

protected Node noFlatten
Constructor Detail

FlattenVisitor

public FlattenVisitor(TypeSystem ts,
                      NodeFactory nf)
Method Detail

override

public Node override(Node n)
Overrides:
override in class NodeVisitor

newID

protected static java.lang.String newID()

enter

public NodeVisitor enter(Node n)
When entering a BlockStatement, place a new StatementList onto the stack

Overrides:
enter in class NodeVisitor

leave

public Node leave(Node old,
                  Node n,
                  NodeVisitor v)
Flatten complex expressions within the AST

Overrides:
leave in class NodeVisitor