org.norecess.citkit.tir.expressions
Class FieldAssignmentTIR

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

public class FieldAssignmentTIR
extends java.lang.Object
implements IFieldAssignmentTIR

The TIR for initializating a field in a record.. This is needed in the RecordETIR class.

Author:
Jeremy D. Frens

Constructor Summary
FieldAssignmentTIR(IPosition position, java.lang.String name, ExpressionTIR init)
          Constructs a field initialization for a RecordETIR.
FieldAssignmentTIR(java.lang.String name, ExpressionTIR init)
          Basic constructor.
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 ExpressionTIR getInit()
          Returns the initialization expression for the field.
 java.lang.String getName()
          Returns the name of the field.
 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

FieldAssignmentTIR

public FieldAssignmentTIR(IPosition position,
                          java.lang.String name,
                          ExpressionTIR init)
Constructs a field initialization for a RecordETIR.

Parameters:
position - the position of the field initialization in the source code.
name - the name of the field.
init - the initializing expression.

FieldAssignmentTIR

public FieldAssignmentTIR(java.lang.String name,
                          ExpressionTIR init)
Basic constructor.

Parameters:
name - the name of the field.
init - the initialization expression of the field.
Method Detail

getInit

public ExpressionTIR getInit()
Returns the initialization expression for the field.

Specified by:
getInit in interface IFieldAssignmentTIR
Returns:
the initialization expression for the field.

getName

public java.lang.String getName()
Returns the name of the field.

Specified by:
getName in interface IFieldAssignmentTIR
Returns:
the name of the field.

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.

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.