polyglot.ext.jl.ast
Class AmbPrefix_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.AmbPrefix_c
All Implemented Interfaces:
java.lang.Cloneable, Ambiguous, AmbPrefix, JL, Node, NodeOps, Prefix, Copy
Direct Known Subclasses:
AmbReceiver_c

public class AmbPrefix_c
extends Node_c
implements AmbPrefix

An AmbPrefix is an ambiguous AST node composed of dot-separated list of identifiers that must resolve to a prefix.


Field Summary
protected  java.lang.String name
           
protected  Prefix prefix
           
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Constructor Summary
AmbPrefix_c(Position pos, Prefix prefix, java.lang.String name)
           
 
Method Summary
 Node disambiguate(AmbiguityRemover ar)
          Disambiguate the prefix.
 Node exceptionCheck(ExceptionChecker ec)
          Check exceptions thrown by the prefix.
 java.lang.String name()
          Get the name of the prefix.
 AmbPrefix name(java.lang.String name)
          Set the name of the prefix.
 Prefix prefix()
          Get the prefix of the prefix.
 AmbPrefix prefix(Prefix prefix)
          Set the prefix of the prefix.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Write the prefix to an output file.
protected  AmbPrefix_c reconstruct(Prefix prefix)
          Reconstruct the prefix.
 java.lang.String toString()
           
 void translate(CodeWriter w, Translator tr)
          Translate the AST using the given CodeWriter.
 Node typeCheck(TypeChecker tc)
          Type check the prefix.
 Node visitChildren(NodeVisitor v)
          Visit the children of the prefix.
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypes, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguateEnter, disambiguateOverride, dump, enterScope, enterScope, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, print, printBlock, printSubStmt, throwTypes, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguateEnter, enterScope, enterScope, exceptionCheckEnter, throwTypes, typeCheckEnter
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguateEnter, enterScope, enterScope, exceptionCheckEnter, throwTypes, typeCheckEnter
 

Field Detail

prefix

protected Prefix prefix

name

protected java.lang.String name
Constructor Detail

AmbPrefix_c

public AmbPrefix_c(Position pos,
                   Prefix prefix,
                   java.lang.String name)
Method Detail

name

public java.lang.String name()
Get the name of the prefix.

Specified by:
name in interface AmbPrefix

name

public AmbPrefix name(java.lang.String name)
Set the name of the prefix.


prefix

public Prefix prefix()
Get the prefix of the prefix.

Specified by:
prefix in interface AmbPrefix

prefix

public AmbPrefix prefix(Prefix prefix)
Set the prefix of the prefix.


reconstruct

protected AmbPrefix_c reconstruct(Prefix prefix)
Reconstruct the prefix.


visitChildren

public Node visitChildren(NodeVisitor v)
Visit the children of the prefix.

Specified by:
visitChildren in interface NodeOps
Overrides:
visitChildren in class Node_c
Parameters:
v - The visitor that will traverse/rewrite the AST.
Returns:
A new AST if a change was made, or this.

disambiguate

public Node disambiguate(AmbiguityRemover ar)
                  throws SemanticException
Disambiguate the prefix.

Specified by:
disambiguate in interface NodeOps
Overrides:
disambiguate in class Node_c
Parameters:
ar - The visitor which disambiguates.
Throws:
SemanticException

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Type check the prefix.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Parameters:
tc - The type checking visitor.
Throws:
SemanticException

exceptionCheck

public Node exceptionCheck(ExceptionChecker ec)
                    throws SemanticException
Check exceptions thrown by the prefix.

Specified by:
exceptionCheck in interface NodeOps
Overrides:
exceptionCheck in class Node_c
Parameters:
ec - The visitor.
Throws:
SemanticException

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Write the prefix to an output file.

Specified by:
prettyPrint in interface NodeOps
Overrides:
prettyPrint in class Node_c
Parameters:
w - The code writer to which to write.
tr - The pretty printer. This is not a visitor.

translate

public void translate(CodeWriter w,
                      Translator tr)
Description copied from class: Node_c
Translate the AST using the given CodeWriter.

Specified by:
translate in interface NodeOps
Overrides:
translate in class Node_c
Parameters:
w - The code writer to which to write.
tr - The translation pass. This is not a visitor.

toString

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