|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.norecess.citkit.tir.expressions.VariableETIR
public class VariableETIR
The TIR for a variable (i.e., l-value) expression. There are three possible l-value expressions:
SimpleLValueTIR
for simple variable references.SubscriptLValueTIR
for an array index applied to another l-value
expression.FieldLValueTIR
for a field reference (as in a record or struct)
applied to another l-value expression.ExpressionTIR
with this
class.
An interpreter or compiler using ExpressionTIRVisitor
to process an
ExpressionTIR
will also need to implement LValueTIRVisitor
to
properly process l-value expressions.
Constructor Summary | |
---|---|
VariableETIR(IPosition position,
LValueTIR lvalue)
Constructs a variable expression. |
|
VariableETIR(IPosition position,
LValueTIR lvalue,
HobbesType type)
Constructs a variable expression. |
|
VariableETIR(LValueTIR lvalue)
Basic constructor. |
|
VariableETIR(LValueTIR lvalue,
HobbesType type)
Basic constructor. |
Method Summary | ||
---|---|---|
|
accept(ExpressionTIRVisitor<T> visitor)
Implements the visitor pattern. |
|
boolean |
equals(java.lang.Object o)
|
|
LValueTIR |
getLValue()
Returns the l-value of this variable expression. |
|
IPosition |
getPosition()
Retrieves the position of the text that generated the TIR. |
|
HobbesType |
getType()
Retrieves the type of the expression. |
|
int |
hashCode()
|
|
void |
setType(HobbesType type)
|
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VariableETIR(IPosition position, LValueTIR lvalue)
position
- the position of the variable expression in the source code.lvalue
- the l-value expression.public VariableETIR(IPosition position, LValueTIR lvalue, HobbesType type)
position
- the position of the variable expression in the source code.lvalue
- the l-value expression.type
- the type of the expression.public VariableETIR(LValueTIR lvalue)
lvalue
- the l-value expression.public VariableETIR(LValueTIR lvalue, HobbesType type)
lvalue
- the l-value expression.type
- the type of the expression.Method Detail |
---|
public LValueTIR getLValue()
getLValue
in interface IVariableETIR
public HobbesType getType()
ExpressionTIR
getType
in interface ExpressionTIR
public void setType(HobbesType type)
public <T> T accept(ExpressionTIRVisitor<T> visitor)
ExpressionTIRVisitor.visitVariableETIR(IVariableETIR)
.
accept
in interface ExpressionTIR
visitor
- the visitor object.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public IPosition getPosition()
getPosition
in interface HobbesTIR
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |