org.norecess.citkit.tir.lvalues
Class FieldTIR

java.lang.Object
  extended by org.norecess.citkit.tir.lvalues.FieldTIR
All Implemented Interfaces:
HobbesTIR, IFieldTIR

public class FieldTIR
extends java.lang.Object
implements IFieldTIR

The AST for a field. This is used in the RecordType class to represent the fields of the record.

Author:
Jeremy D. Frens

Constructor Summary
FieldTIR(IPosition position, java.lang.String name, java.lang.String type)
          Constructs a new field.
FieldTIR(java.lang.String name, java.lang.String type)
          Basic constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getDeclaredType()
          Returns the type of the field as declared in the code.
 java.lang.String getName()
          Returns the name of the field.
 IPosition getPosition()
          Retrieves the position of the code that generated the AST.
 ISymbol getSymbol()
          Returns the name of the field as a symbol.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldTIR

public FieldTIR(IPosition position,
                java.lang.String name,
                java.lang.String type)
Constructs a new field.

Parameters:
position - the position of the field in the source code.
name - the name of the field.
type - the data type of the field.

FieldTIR

public FieldTIR(java.lang.String name,
                java.lang.String type)
Basic constructor.

Parameters:
name - the name of the field.
type - the type of the field.
Method Detail

getName

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

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

getSymbol

public ISymbol getSymbol()
Returns the name of the field as a symbol.

Specified by:
getSymbol in interface IFieldTIR
Returns:
the name of the field as a symbol.

getDeclaredType

public java.lang.String getDeclaredType()
Returns the type of the field as declared in the code.

Specified by:
getDeclaredType in interface IFieldTIR
Returns:
the type of the field.

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.