org.norecess.citkit.tir.expressions
Class RecordETIR

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

public class RecordETIR
extends java.lang.Object
implements IRecordETIR

The TIR for an expression that creates (i.e., allocates) a new record object.

Author:
Jeremy D. Frens

Constructor Summary
RecordETIR(IPosition position, java.lang.String type, java.util.List<FieldAssignmentTIR> fieldExps)
          Constructs a record expression.
RecordETIR(java.lang.String type, java.util.List<FieldAssignmentTIR> fieldExps)
           
 
Method Summary
<T> T
accept(ExpressionTIRVisitor<T> visitor)
          Implements the visitor pattern with ExpressionTIRVisitor.
 boolean equals(java.lang.Object o)
           
 java.util.List<FieldAssignmentTIR> getFieldExpressions()
          Returns the list of field expressions.
 IPosition getPosition()
          Retrieves the position of the code that generated the AST.
 HobbesType getType()
          Retrieves the type of the expression.
 java.lang.String getTypeName()
          Returns the type of the record.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecordETIR

public RecordETIR(IPosition position,
                  java.lang.String type,
                  java.util.List<FieldAssignmentTIR> fieldExps)
Constructs a record expression.

Parameters:
position - the position of the record expression in the source code.
type - the name of the record type.
fieldExps - a list of field-initialization expressions (see FieldAssignmentTIR).

RecordETIR

public RecordETIR(java.lang.String type,
                  java.util.List<FieldAssignmentTIR> fieldExps)
Method Detail

getFieldExpressions

public java.util.List<FieldAssignmentTIR> getFieldExpressions()
Returns the list of field expressions.

Specified by:
getFieldExpressions in interface IRecordETIR
Returns:
the list of field expressions.

getTypeName

public java.lang.String getTypeName()
Returns the type of the record.

Specified by:
getTypeName in interface IRecordETIR
Returns:
the type of the record.

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 AST.

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