Class Expr
java.lang.Object
EDU.purdue.cs.bloat.tree.Node
EDU.purdue.cs.bloat.tree.Expr
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ArithExpr, ArrayLengthExpr, CallExpr, CastExpr, CatchExpr, CheckExpr, CondExpr, ConstantExpr, DefExpr, NegExpr, NewArrayExpr, NewExpr, NewMultiArrayExpr, ReturnAddressExpr, ShiftExpr, StoreExpr
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCleans up this expression only, not its children.abstract Objectclone()Returns an Object that can be used to compare other Expr to this.protected ExprCopies the contents of another expression in this one.def()Returns the expression in which this Expr is defined.abstract booleanequalsExpr(Expr other) Compares this expression to another.abstract intReturns the hash code for this expresion.booleanisDef()Returns whether or not this expression is a defining occurrence.voidSets the expression that defines this expression.booleanSets the type of this expression.stmt()Returns the statement to which this expression belongs.type()Returns the Type of this expression.Methods inherited from class Node
block, cleanup, copyInto, hasParent, key, parent, replaceWith, replaceWith, setKey, setParent, setValueNumber, toString, valueNumber, visit, visitChildren, visitForceChildren, visitOnly
-
Field Details
-
type
-
-
Constructor Details
-
Expr
Constructor. Initializes an expression with a given type.- Parameters:
type- The initial Type (descriptor) of this expression.
-
-
Method Details
-
setType
Sets the type of this expression. Returns whether or not the type changed as a result of calling this method. -
isDef
public boolean isDef()Returns whether or not this expression is a defining occurrence. By default, false is returned. -
stmt
Returns the statement to which this expression belongs. It essentially searches up the expression tree for this expression's first ancestor which is a Stmt. -
type
Returns the Type of this expression. -
cleanupOnly
public void cleanupOnly()Cleans up this expression only, not its children.- Specified by:
cleanupOnlyin classNode
-
setDef
Sets the expression that defines this expression.- Parameters:
def- Defining expression.
-
def
Returns the expression in which this Expr is defined. -
exprHashCode
public abstract int exprHashCode()Returns the hash code for this expresion. -
equalsExpr
Compares this expression to another.- Parameters:
other- Expr to which to compare this.
-
clone
-
copyInto
-
comparator
Returns an Object that can be used to compare other Expr to this.
-