polyglot.visit
Class AmbiguityRemover

java.lang.Object
  extended by polyglot.visit.NodeVisitor
      extended by polyglot.visit.HaltingVisitor
          extended by polyglot.visit.ErrorHandlingVisitor
              extended by polyglot.visit.ContextVisitor
                  extended by polyglot.visit.AmbiguityRemover
All Implemented Interfaces:
java.lang.Cloneable, Copy

public class AmbiguityRemover
extends ContextVisitor

A visitor which traverses the AST and remove ambiguities found in fields, method signatures and the code itself.


Nested Class Summary
static class AmbiguityRemover.Kind
           
 
Field Summary
static AmbiguityRemover.Kind ALL
           
static AmbiguityRemover.Kind FIELDS
           
protected  AmbiguityRemover.Kind kind
           
static AmbiguityRemover.Kind SIGNATURES
           
static AmbiguityRemover.Kind SUPER
           
 
Fields inherited from class polyglot.visit.ContextVisitor
context, outer
 
Fields inherited from class polyglot.visit.ErrorHandlingVisitor
error, job, nf, ts
 
Constructor Summary
AmbiguityRemover(Job job, TypeSystem ts, NodeFactory nf, AmbiguityRemover.Kind kind)
           
 
Method Summary
 void addSuperDependencies(ClassType ct)
          Add dependencies for the job to the super classes and interface classes of ct.
protected  NodeVisitor enterCall(Node n)
           
 AmbiguityRemover.Kind kind()
           
protected  Node leaveCall(Node old, Node n, NodeVisitor v)
          Contains all of the functionality that can be done in the leave method, but allows SemanticExceptions to be thrown.
 java.lang.String toString()
           
 
Methods inherited from class polyglot.visit.ContextVisitor
addDecls, begin, context, context, enter, enterScope, leave, superEnter
 
Methods inherited from class polyglot.visit.ErrorHandlingVisitor
catchErrors, enterCall, enterError, errorQueue, job, leaveCall, nodeFactory, typeSystem
 
Methods inherited from class polyglot.visit.HaltingVisitor
bypass, bypass, bypassChildren, copy, override, visitChildren
 
Methods inherited from class polyglot.visit.NodeVisitor
enter, finish, finish, leave, override, visitEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUPER

public static final AmbiguityRemover.Kind SUPER

SIGNATURES

public static final AmbiguityRemover.Kind SIGNATURES

FIELDS

public static final AmbiguityRemover.Kind FIELDS

ALL

public static final AmbiguityRemover.Kind ALL

kind

protected AmbiguityRemover.Kind kind
Constructor Detail

AmbiguityRemover

public AmbiguityRemover(Job job,
                        TypeSystem ts,
                        NodeFactory nf,
                        AmbiguityRemover.Kind kind)
Method Detail

kind

public AmbiguityRemover.Kind kind()

enterCall

protected NodeVisitor enterCall(Node n)
                         throws SemanticException
Overrides:
enterCall in class ErrorHandlingVisitor
Throws:
SemanticException

leaveCall

protected Node leaveCall(Node old,
                         Node n,
                         NodeVisitor v)
                  throws SemanticException
Description copied from class: ErrorHandlingVisitor
Contains all of the functionality that can be done in the leave method, but allows SemanticExceptions to be thrown. This method is in addition to the leave method, and allows the compiler writer to write code that can throw errors and let the polyglot infrastructure handle the exceptions.

Overrides:
leaveCall in class ErrorHandlingVisitor
Parameters:
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.
Returns:
The final result of the traversal of the tree rooted at n.
Throws:
SemanticException
See Also:
NodeVisitor.leave(Node, Node, NodeVisitor)

addSuperDependencies

public void addSuperDependencies(ClassType ct)
Add dependencies for the job to the super classes and interface classes of ct.


toString

public java.lang.String toString()
Overrides:
toString in class NodeVisitor