public abstract class Assign_c extends Expr_c implements Assign
Assign represents a Java assignment expression.Assign.OperatorTerm.Instance| Modifier and Type | Field and Description |
|---|---|
protected Expr |
left |
protected Assign.Operator |
op |
protected Expr |
right |
exceptions, reachableADD_ASSIGN, ASSIGN, BIT_AND_ASSIGN, BIT_OR_ASSIGN, BIT_XOR_ASSIGN, DIV_ASSIGN, MOD_ASSIGN, MUL_ASSIGN, SHL_ASSIGN, SHR_ASSIGN, SUB_ASSIGN, USHR_ASSIGN| Constructor and Description |
|---|
Assign_c(Position pos,
Expr left,
Assign.Operator op,
Expr right)
Deprecated.
|
Assign_c(Position pos,
Expr left,
Assign.Operator op,
Expr right,
Ext ext) |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.List<T> |
acceptCFG(CFGBuilder<?> v,
java.util.List<T> succs)
Visit this term in evaluation order, calling v.edge() for each successor
in succs, if data flows on that edge.
|
protected abstract void |
acceptCFGAssign(CFGBuilder<?> v)
Construct a CFG for this assignment when the assignment operator
is ASSIGN (i.e., the normal, simple assignment =).
|
protected abstract void |
acceptCFGOpAssign(CFGBuilder<?> v)
Construct a CFG for this assignment when the assignment operator
is of the form op= for some operation op.
|
Type |
childExpectedType(Expr child,
AscriptionVisitor av)
Get the expected type of a child expression of
this. |
Node |
copy(NodeFactory nf)
Produce a copy of this node using the given NodeFactory.
|
void |
dump(CodeWriter w)
Dump the AST node for debugging purposes.
|
abstract Term |
firstChild()
Return the first direct subterm performed when evaluating this term.
|
Expr |
left()
Left child (target) of the assignment.
|
Assign |
left(Expr left)
Set the left child (target) of the assignment.
|
protected <N extends Assign_c> |
left(N n,
Expr left) |
Assign.Operator |
operator()
The assignment's operator.
|
Assign |
operator(Assign.Operator op)
Set the assignment's operator.
|
protected <N extends Assign_c> |
operator(N n,
Assign.Operator op) |
Precedence |
precedence()
Get the precedence of the expression.
|
void |
prettyPrint(CodeWriter w,
PrettyPrinter tr)
Pretty-print the AST using the given
CodeWriter. |
protected <N extends Assign_c> |
reconstruct(N n,
Expr left,
Expr right)
Reconstruct the expression.
|
Expr |
right()
Right child (source) of the assignment.
|
Assign |
right(Expr right)
Set the right child (source) of the assignment.
|
protected <N extends Assign_c> |
right(N n,
Expr right) |
boolean |
throwsArithmeticException()
Get the throwsArithmeticException of the expression.
|
java.util.List<Type> |
throwTypes(TypeSystem ts)
List of Types of exceptions that might get thrown.
|
java.lang.String |
toString() |
Node |
typeCheck(TypeChecker tc)
Type check the AST.
|
Node |
visitChildren(NodeVisitor v)
Visit the children of the node.
|
booleanValue, buildTypes, byteValue, charValue, constantValue, constantValue, constantValueSet, constantValueSet, doubleValue, extRewrite, floatValue, intValue, isConstant, isConstant, isTypeChecked, lastLang, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type, typeexceptionCheck, exceptions, exceptions, exceptions, listChild, reachable, reachable, reachableaddDecls, buildTypesEnter, checkConstants, copy, copy, copyIfNeeded, del, del, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, error, error, error, exceptionCheckEnter, ext, ext, ext, ext, extRewriteEnter, isDisambiguated, lang, position, position, position, prettyPrint, prettyPrint, prettyPrint, prettyPrint, print, printBlock, printSubStmt, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitEdge, visitListclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconstantValue, constantValueSet, isConstant, printSubExpr, printSubExpr, typedel, del, error, error, ext, ext, ext, ext, isDisambiguated, isTypeChecked, position, position, visit, visitEdgeaddDecls, buildTypes, buildTypesEnter, checkConstants, copy, disambiguate, disambiguateEnter, disambiguateOverride, dump, dump, dump, dump, enterChildScope, enterScope, exceptionCheck, exceptionCheckEnter, extRewrite, extRewriteEnter, lang, prettyPrint, prettyPrint, prettyPrint, prettyPrint, translate, typeCheckEnter, typeCheckOverride, visitChild, visitListexceptions, exceptions, reachable, reachableprotected Expr left
protected Assign.Operator op
protected Expr right
@Deprecated public Assign_c(Position pos, Expr left, Assign.Operator op, Expr right)
public Assign_c(Position pos, Expr left, Assign.Operator op, Expr right, Ext ext)
public Precedence precedence()
Exprprecedence in interface Exprprecedence in class Expr_cpublic Expr left()
Assignpublic Assign left(Expr left)
Assignpublic Assign.Operator operator()
Assignpublic Assign operator(Assign.Operator op)
Assignprotected <N extends Assign_c> N operator(N n, Assign.Operator op)
public Expr right()
Assignpublic Assign right(Expr right)
Assignprotected <N extends Assign_c> N reconstruct(N n, Expr left, Expr right)
public Node visitChildren(NodeVisitor v)
NodeOpsvisitChildren in interface NodeOpsvisitChildren in class Node_cv - The visitor that will traverse/rewrite the AST.this.public Node typeCheck(TypeChecker tc) throws SemanticException
NodeOpsleave() 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 NodeOpstypeCheck in class Node_ctc - The type checking visitor.SemanticExceptionpublic Type childExpectedType(Expr child, AscriptionVisitor av)
NodeOpsthis.
The expected type is determined by the context in that the child occurs
(e.g., for x = e, the expected type of e is
the declared type of x.
The expected type should impose the least constraints on the child's
type that are allowed by the parent node.childExpectedType in interface NodeOpschildExpectedType in class Node_cchild - A child expression of this node.av - An ascription visitor.child.public boolean throwsArithmeticException()
AssignthrowsArithmeticException in interface Assignpublic void prettyPrint(CodeWriter w, PrettyPrinter tr)
Node_cCodeWriter.prettyPrint in interface NodeOpsprettyPrint in class Node_cw - The code writer to which to write.tr - The pretty printer. This is not a visitor.public void dump(CodeWriter w)
Nodepublic abstract Term firstChild()
TermOpsfirstChild in interface TermOpsfirstChild in class Term_cpublic <T> java.util.List<T> acceptCFG(CFGBuilder<?> v, java.util.List<T> succs)
TermOpsprotected abstract void acceptCFGAssign(CFGBuilder<?> v)
protected abstract void acceptCFGOpAssign(CFGBuilder<?> v)
public java.util.List<Type> throwTypes(TypeSystem ts)
NodeOpsthrowTypes in interface NodeOpsthrowTypes in class Node_c