polyglot.ext.jl.ast
Class AmbExpr_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.Term_c
          extended by polyglot.ext.jl.ast.Expr_c
              extended by polyglot.ext.jl.ast.AmbExpr_c
All Implemented Interfaces:
java.lang.Cloneable, AmbExpr, Ambiguous, Expr, JL, Node, NodeOps, Prefix, Receiver, Term, Typed, Copy

public class AmbExpr_c
extends Expr_c
implements AmbExpr

An AmbExpr is an ambiguous AST node composed of a single identifier that must resolve to an expression.


Field Summary
protected  java.lang.String name
           
 
Fields inherited from class polyglot.ext.jl.ast.Expr_c
type
 
Fields inherited from class polyglot.ext.jl.ast.Term_c
exceptions, reachable
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Constructor Summary
AmbExpr_c(Position pos, java.lang.String name)
           
 
Method Summary
 java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
          Visit this term in evaluation order.
 Node disambiguate(AmbiguityRemover ar)
          Disambiguate the expression.
 void dump(CodeWriter w)
          Dump the AST node for debugging purposes.
 Term entry()
          Return the first (sub)term performed when evaluating this term.
 Node exceptionCheck(ExceptionChecker ec)
          Check exceptions thrown by the expression.
 java.lang.String name()
          Get the name of the expression.
 AmbExpr name(java.lang.String name)
          Set the name of the expression.
 Precedence precedence()
          Get the precedence of the field.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Write the expression to an output file.
 java.lang.String toString()
           
 void translate(CodeWriter w, Translator tr)
          Translate the AST using the given CodeWriter.
 Node typeCheck(TypeChecker tc)
          Type check the expression.
 
Methods inherited from class polyglot.ext.jl.ast.Expr_c
booleanValue, buildTypes, byteValue, charValue, constantValue, doubleValue, floatValue, intValue, isConstant, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type
 
Methods inherited from class polyglot.ext.jl.ast.Term_c
exceptions, exceptions, listEntry, reachable, reachable
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguateEnter, disambiguateOverride, enterScope, enterScope, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, print, printBlock, printSubStmt, throwTypes, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, 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.Expr
constantValue, isConstant, printSubExpr, printSubExpr, type
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, 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, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.ast.Typed
type
 
Methods inherited from interface polyglot.ast.Term
exceptions, exceptions, reachable, reachable
 

Field Detail

name

protected java.lang.String name
Constructor Detail

AmbExpr_c

public AmbExpr_c(Position pos,
                 java.lang.String name)
Method Detail

precedence

public Precedence precedence()
Get the precedence of the field.

Specified by:
precedence in interface Expr
Overrides:
precedence in class Expr_c

name

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

Specified by:
name in interface AmbExpr

name

public AmbExpr name(java.lang.String name)
Set the name of the expression.

Specified by:
name in interface AmbExpr

disambiguate

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

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 expression.

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 expression.

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

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Write the expression 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

entry

public Term entry()
Return the first (sub)term performed when evaluating this term.

Specified by:
entry in interface Term
Specified by:
entry in class Term_c

acceptCFG

public java.util.List acceptCFG(CFGBuilder v,
                                java.util.List succs)
Visit this term in evaluation order.

Specified by:
acceptCFG in interface Term
Specified by:
acceptCFG in class Term_c

dump

public void dump(CodeWriter w)
Description copied from interface: Node
Dump the AST node for debugging purposes.

Specified by:
dump in interface Node
Overrides:
dump in class Expr_c