public class BinaryExpression extends Expression
| Constructor and Description |
|---|
BinaryExpression(Expression lhs,
BinaryOperator op,
Expression rhs)
Creates a binary expression.
|
| Modifier and Type | Method and Description |
|---|---|
BinaryExpression |
clone()
Returns a clone of the binary expression
|
static void |
defaultPrint(BinaryExpression e,
java.io.PrintWriter o)
Prints a binary expression to a stream.
|
boolean |
equals(java.lang.Object o)
Compares the binary expression with the specified object.
|
Expression |
getLHS()
Returns the lefthand expression.
|
BinaryOperator |
getOperator()
Returns the operator of the expression.
|
Expression |
getRHS()
Returns the righthand expression.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setLHS(Expression expr)
Sets the lefthand expression.
|
void |
setOperator(BinaryOperator op)
Sets the operator for the expression.
|
void |
setRHS(Expression expr)
Sets the righthand expression.
|
java.lang.String |
toString()
Returns a string representation of the binary expression.
|
compareTo, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic BinaryExpression(Expression lhs, BinaryOperator op, Expression rhs)
lhs - The lefthand expression.op - A binary operator.rhs - The righthand expression.NotAnOrphanException - if lhs or rhs has a parent
object.public BinaryExpression clone()
clone in class Expressionpublic static void defaultPrint(BinaryExpression e, java.io.PrintWriter o)
e - The expression to print.o - The writer on which to print the expression.public java.lang.String toString()
defaultPrint(cetus.hir.BinaryExpression, java.io.PrintWriter).toString in class Expressionpublic Expression getLHS()
public BinaryOperator getOperator()
public Expression getRHS()
public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setLHS(Expression expr)
expr - The new lefthand expression. It must not be
the child of another expression or null.java.lang.IllegalArgumentException - if expr is null.NotAnOrphanException - if expr has a parent object.public void setOperator(BinaryOperator op)
op - The operator.public void setRHS(Expression expr)
expr - The new righthand expression. It must not be the child of
another expression.java.lang.IllegalArgumentException - if expr is null.NotAnOrphanException - if expr has a parent object.public boolean equals(java.lang.Object o)
equals in class Expressiono - the object to be compared with.