cetus.hir
Class AssignmentExpression

java.lang.Object
  extended by cetus.hir.Expression
      extended by cetus.hir.BinaryExpression
          extended by cetus.hir.AssignmentExpression
All Implemented Interfaces:
Printable, Traversable, java.lang.Cloneable, java.lang.Comparable<Expression>

public class AssignmentExpression
extends BinaryExpression


Field Summary
 
Fields inherited from class cetus.hir.BinaryExpression
op
 
Fields inherited from class cetus.hir.Expression
children, needs_parens, object_print_method, parent
 
Constructor Summary
AssignmentExpression(Expression lhs, AssignmentOperator op, Expression rhs)
          Creates an assignment expression.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a deep copy of this expression.
static void defaultPrint(AssignmentExpression expr, java.io.OutputStream stream)
          Prints an assignment expression to a stream.
 AssignmentOperator getOperator()
          Returns the operator of the 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 setOperator(AssignmentOperator op)
          Sets the operator for the expression.
 java.lang.String toString()
          Every expression class should override toString method.
 
Methods inherited from class cetus.hir.BinaryExpression
defaultPrint, getLHS, getRHS, setLHS, setOperator, setRHS
 
Methods inherited from class cetus.hir.Expression
compareTo, equals, equals2, findExpression, getChildren, getParent, getStatement, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verify
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssignmentExpression

public AssignmentExpression(Expression lhs,
                            AssignmentOperator op,
                            Expression rhs)
Creates an assignment expression.

Parameters:
lhs - The lefthand expression.
op - An assignment operator.
rhs - The righthand expression.
Method Detail

clone

public java.lang.Object clone()
Description copied from class: Expression
Creates and returns a deep copy of this expression.

Overrides:
clone in class BinaryExpression
Returns:
a deep copy of this expression.

defaultPrint

public static void defaultPrint(AssignmentExpression expr,
                                java.io.OutputStream stream)
Prints an assignment expression to a stream.

Parameters:
expr - The expression to print.
stream - The stream on which to print the expression.

toString

public java.lang.String toString()
Description copied from class: Expression
Every expression class should override toString method.

Overrides:
toString in class BinaryExpression

getOperator

public AssignmentOperator getOperator()
Returns the operator of the expression.

Overrides:
getOperator in class BinaryExpression
Returns:
the operator.

setClassPrintMethod

public static void setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently created objects will use the supplied method.

Parameters:
m - The new print method.

setOperator

public void setOperator(AssignmentOperator op)
Sets the operator for the expression.

Parameters:
op - The operator.