Package EDU.purdue.cs.bloat.tree
Class ArithExpr
- java.lang.Object
-
- EDU.purdue.cs.bloat.tree.Node
-
- EDU.purdue.cs.bloat.tree.Expr
-
- EDU.purdue.cs.bloat.tree.ArithExpr
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ArithExpr extends Expr
ArithExpr represents a binary arithmetic expression. It consists of two operands and an operator.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()booleanequalsExpr(Expr other)Compare this arithmetic expression to another Expression.intexprHashCode()Returns the hash code for this expresion.Exprleft()intoperation()Exprright()voidvisit(TreeVisitor visitor)voidvisitForceChildren(TreeVisitor visitor)Visit the children of this node.-
Methods inherited from class EDU.purdue.cs.bloat.tree.Expr
cleanupOnly, comparator, copyInto, def, isDef, setDef, setType, stmt, type
-
Methods inherited from class EDU.purdue.cs.bloat.tree.Node
block, cleanup, copyInto, hasParent, key, parent, replaceWith, replaceWith, setKey, setParent, setValueNumber, toString, valueNumber, visitChildren, visitOnly
-
-
-
-
Field Detail
-
ADD
public static final char ADD
- See Also:
- Constant Field Values
-
SUB
public static final char SUB
- See Also:
- Constant Field Values
-
DIV
public static final char DIV
- See Also:
- Constant Field Values
-
MUL
public static final char MUL
- See Also:
- Constant Field Values
-
REM
public static final char REM
- See Also:
- Constant Field Values
-
AND
public static final char AND
- See Also:
- Constant Field Values
-
IOR
public static final char IOR
- See Also:
- Constant Field Values
-
XOR
public static final char XOR
- See Also:
- Constant Field Values
-
CMP
public static final char CMP
- See Also:
- Constant Field Values
-
CMPL
public static final char CMPL
- See Also:
- Constant Field Values
-
CMPG
public static final char CMPG
- See Also:
- Constant Field Values
-
-
Method Detail
-
operation
public int operation()
-
left
public Expr left()
-
right
public Expr right()
-
visitForceChildren
public void visitForceChildren(TreeVisitor visitor)
Description copied from class:NodeVisit the children of this node. Not all Nodes will have children to visit.- Specified by:
visitForceChildrenin classNode
-
visit
public void visit(TreeVisitor visitor)
-
exprHashCode
public int exprHashCode()
Description copied from class:ExprReturns the hash code for this expresion.- Specified by:
exprHashCodein classExpr
-
equalsExpr
public boolean equalsExpr(Expr other)
Compare this arithmetic expression to another Expression.- Specified by:
equalsExprin classExpr- Parameters:
other- Expr to which to compare this.- Returns:
- True, if both expressions have the same contents.
-
-