org.norecess.citkit.tir.expressions
Class AssignmentETIR

java.lang.Object
  extended by org.norecess.citkit.tir.expressions.AssignmentETIR
All Implemented Interfaces:
IAssignmentETIR, ExpressionTIR, HobbesTIR

public class AssignmentETIR
extends java.lang.Object
implements IAssignmentETIR

The TIR for an assignment expression.

Author:
Jeremy D. Frens

Constructor Summary
AssignmentETIR(IPosition position, LValueTIR lvalue, ExpressionTIR expression)
          Creates an assignment expression.
AssignmentETIR(LValueTIR lvalue, ExpressionTIR expression)
          Basic constructor.
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 ExpressionTIR getExpression()
          Returns the expression of the assignment expression.
 LValueTIR getLValue()
          Returns the variable of the assignment expression.
 IPosition getPosition()
          Retrieves the position of the code that generated the TIR.
 HobbesType getType()
          Retrieves the type of the expression.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssignmentETIR

public AssignmentETIR(IPosition position,
                      LValueTIR lvalue,
                      ExpressionTIR expression)
Creates an assignment expression.

Parameters:
position - the position of the expression in the souce code.
lvalue - the variable assigned to.
expression - the expression to evaluate.

AssignmentETIR

public AssignmentETIR(LValueTIR lvalue,
                      ExpressionTIR expression)
Basic constructor.

Parameters:
lvalue - the variable on the left.
expression - the expression on the right.
Method Detail

getType

public HobbesType getType()
Description copied from interface: ExpressionTIR
Retrieves the type of the expression.

Specified by:
getType in interface ExpressionTIR
Returns:
the type of the code.

getExpression

public ExpressionTIR getExpression()
Returns the expression of the assignment expression.

Specified by:
getExpression in interface IAssignmentETIR
Returns:
the expression of the assignment expression.

getLValue

public LValueTIR getLValue()
Returns the variable of the assignment expression.

Specified by:
getLValue in interface IAssignmentETIR
Returns:
the variable of the assignment expression.

accept

public <T> T accept(ExpressionTIRVisitor<T> visitor)
Description copied from interface: ExpressionTIR
Implements the visitor pattern with ExpressionTIRVisitor.

Specified by:
accept in interface ExpressionTIR
Parameters:
visitor - the visitor object.
Returns:
the result of visiting the AST with the visitor.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPosition

public IPosition getPosition()
Retrieves the position of the code that generated the TIR.

Specified by:
getPosition in interface HobbesTIR
Returns:
the position of the code in the source code.