org.norecess.citkit.tir
Interface LValueTIR

All Superinterfaces:
HobbesTIR
All Known Subinterfaces:
IFieldValueTIR, ISimpleLValueTIR, ISubscriptLValueTIR
All Known Implementing Classes:
FieldLValueTIR, SimpleLValueTIR, SubscriptLValueTIR

public interface LValueTIR
extends HobbesTIR

The abstract AST for all kinds of l-values. Hobbes, the language, has three kinds of l-values: simple variables, array references, and field references (from a record). Those wanting only simple variables must still go through SimpleLValueTIR and this interface indirectly to implement them well.

There is a separate visitor LValueTIRVisitor for this interface and its hierarchy. An implementation of ExpressionTIRVisitor will often have to be paired with an implementation of LValueTIRVisitor.

Author:
Jeremy D. Frens

Method Summary
<T> T
accept(LValueTIRVisitor<T> visitor)
          Implements the visitor pattern with LValueTIRVisitor.
 IPosition getPosition()
          Returns the location of the l-value in the code.
 HobbesType getType()
          Returns the type of the l-value.
 void setType(HobbesType type)
          Sets the type of the l-value.
 

Method Detail

accept

<T> T accept(LValueTIRVisitor<T> visitor)
Implements the visitor pattern with LValueTIRVisitor.

Type Parameters:
T - the return type from the visit with the visitor.
Parameters:
visitor - the visitor itself.
Returns:
the result of visiting with the visitor.

getType

HobbesType getType()
Returns the type of the l-value. Useful only in type-checked languages.

Returns:
the type of the l-value.

setType

void setType(HobbesType type)
Sets the type of the l-value. Needed only in type-checked languages.

Parameters:
type - the type of the l-value.

getPosition

IPosition getPosition()
Returns the location of the l-value in the code.

Specified by:
getPosition in interface HobbesTIR