|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.ast.Node_c
polyglot.ast.Term_c
polyglot.ast.Expr_c
polyglot.ast.AmbExpr_c
public class AmbExpr_c
An AmbExpr
is an ambiguous AST node composed of a single
identifier that must resolve to an expression.
Field Summary | |
---|---|
protected Id |
name
|
Fields inherited from class polyglot.ast.Expr_c |
---|
type |
Fields inherited from class polyglot.ast.Term_c |
---|
exceptions, reachable |
Fields inherited from class polyglot.ast.Node_c |
---|
del, error, ext, position |
Fields inherited from interface polyglot.ast.Term |
---|
ENTRY, EXIT |
Constructor Summary | |
---|---|
AmbExpr_c(Position pos,
Id name)
|
Method Summary | |
---|---|
java.util.List |
acceptCFG(CFGBuilder v,
java.util.List succs)
Visit this term in evaluation order. |
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory. |
Node |
disambiguate(AmbiguityRemover ar)
Disambiguate the expression. |
Node |
exceptionCheck(ExceptionChecker ec)
Check exceptions thrown by the expression. |
Term |
firstChild()
Return the first (sub)term performed when evaluating this term. |
Id |
id()
Get the name of the expression. |
AmbExpr |
id(Id id)
Set the name of 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. |
protected AmbExpr_c |
reconstruct(Id name)
Reconstruct the expression. |
java.lang.String |
toString()
|
Node |
typeCheck(TypeChecker tc)
Type check the AST. |
Node |
visitChildren(NodeVisitor v)
Visit the children of the constructor. |
Methods inherited from class polyglot.ast.Expr_c |
---|
booleanValue, buildTypes, byteValue, charValue, constantValue, constantValueSet, doubleValue, dump, floatValue, intValue, isConstant, isTypeChecked, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type |
Methods inherited from class polyglot.ast.Term_c |
---|
exceptions, exceptions, listChild, reachable, reachable |
Methods inherited from class polyglot.ast.Node_c |
---|
addDecls, buildTypesEnter, checkConstants, childExpectedType, copy, copy, del, del, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, error, error, exceptionCheckEnter, ext, ext, ext, ext, init, isDisambiguated, node, position, position, prettyPrint, prettyPrint, print, printBlock, printSubStmt, throwTypes, translate, 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.Expr |
---|
constantValue, constantValueSet, isConstant, printSubExpr, printSubExpr, type |
Methods inherited from interface polyglot.ast.Node |
---|
childExpectedType, del, del, dump, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitChild, visitEdge, visitList |
Methods inherited from interface polyglot.ast.JL |
---|
init, node |
Methods inherited from interface polyglot.ast.NodeOps |
---|
addDecls, buildTypes, buildTypesEnter, checkConstants, copy, disambiguateEnter, disambiguateOverride, dump, dump, enterChildScope, enterScope, exceptionCheckEnter, prettyPrint, prettyPrint, throwTypes, translate, typeCheckEnter, typeCheckOverride |
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 |
---|
protected Id name
Constructor Detail |
---|
public AmbExpr_c(Position pos, Id name)
Method Detail |
---|
public Precedence precedence()
precedence
in interface Expr
precedence
in class Expr_c
public Id id()
id
in interface AmbExpr
public AmbExpr id(Id id)
id
in interface AmbExpr
public java.lang.String name()
name
in interface AmbExpr
public AmbExpr name(java.lang.String name)
name
in interface AmbExpr
protected AmbExpr_c reconstruct(Id name)
public Node visitChildren(NodeVisitor v)
visitChildren
in interface NodeOps
visitChildren
in class Node_c
v
- The visitor that will traverse/rewrite the AST.
this
.public Node disambiguate(AmbiguityRemover ar) throws SemanticException
disambiguate
in interface NodeOps
disambiguate
in class Node_c
ar
- The visitor which disambiguates.
SemanticException
public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOps
leave()
method of the
visitor. The method should perform work that should be done
after visiting the children of the node. The method may return
this
or a new copy of the node which will be
installed as a child of the node's parent.
typeCheck
in interface NodeOps
typeCheck
in class Node_c
tc
- The type checking visitor.
SemanticException
public Node exceptionCheck(ExceptionChecker ec) throws SemanticException
exceptionCheck
in interface NodeOps
exceptionCheck
in class Term_c
ec
- The visitor.
SemanticException
public void prettyPrint(CodeWriter w, PrettyPrinter tr)
prettyPrint
in interface NodeOps
prettyPrint
in class Node_c
w
- The code writer to which to write.tr
- The pretty printer. This is not a visitor.public java.lang.String toString()
toString
in class Node_c
public Term firstChild()
firstChild
in interface Term
public java.util.List acceptCFG(CFGBuilder v, java.util.List succs)
acceptCFG
in interface Term
acceptCFG
in class Term_c
public Node copy(NodeFactory nf)
NodeOps
copy
in interface NodeOps
copy
in class Node_c
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |