polyglot.ext.jl.ast
Class AmbExpr_c
java.lang.Object
polyglot.ext.jl.ast.Node_c
polyglot.ext.jl.ast.Term_c
polyglot.ext.jl.ast.Expr_c
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 |
| 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.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, translate, 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.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, translate, typeCheckEnter, visitChildren |
| Methods inherited from interface polyglot.util.Copy |
copy |
| Methods inherited from interface polyglot.ast.Typed |
type |
name
protected java.lang.String name
AmbExpr_c
public AmbExpr_c(Position pos,
java.lang.String name)
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.
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