|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.norecess.citkit.tir.declarations.VariableDTIR
public class VariableDTIR
The TIR for a variable declaration. The name of the variable being declared
is specified as a String
. The expression used to initialize the
variable is an ExpressionTIR
. You must provide both of these; if your
language does not require an initialization expression, then provide a
default initialization expression. Optionally, you can specify a data type
for the variable as a NameTTIR
.
Constructor Summary | |
---|---|
VariableDTIR(IPosition position,
ISymbol symbol,
INameTTIR type,
ExpressionTIR initialization)
Constructs a variable declaration. |
|
VariableDTIR(ISymbol symbol,
ExpressionTIR initialization)
Constructs a variable declaration without a known type. |
|
VariableDTIR(ISymbol symbol,
INameTTIR type,
ExpressionTIR initialization)
Basic constructor. |
Method Summary | ||
---|---|---|
|
accept(DeclarationTIRVisitor<T> visitor)
Implements the visitor pattern with DeclarationTIRVisitor . |
|
boolean |
equals(java.lang.Object obj)
|
|
ExpressionTIR |
getInititialization()
Returns the initialization expression. |
|
IPosition |
getPosition()
Retrieves the position of the code that generated the TIR. |
|
ISymbol |
getSymbol()
Returns the symbol for the variable. |
|
INameTTIR |
getType()
Returns the type of the variable. |
|
int |
hashCode()
|
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VariableDTIR(IPosition position, ISymbol symbol, INameTTIR type, ExpressionTIR initialization)
position
- the position of the variable declaration in the source code.symbol
- the name of the variable.type
- the type of the variable (could be null
)initialization
- the initialization of the variable.public VariableDTIR(ISymbol symbol, INameTTIR type, ExpressionTIR initialization)
symbol
- name of the variable.type
- type of the variable (could be null
)initialization
- the initialization expression.public VariableDTIR(ISymbol symbol, ExpressionTIR initialization)
symbol
- the name of the variable.initialization
- the initialization of the variable.Method Detail |
---|
public IPosition getPosition()
DeclarationTIR
getPosition
in interface DeclarationTIR
getPosition
in interface HobbesTIR
public ExpressionTIR getInititialization()
getInititialization
in interface IVariableDTIR
public ISymbol getSymbol()
IVariableDTIR
getSymbol
in interface IVariableDTIR
public INameTTIR getType()
getType
in interface IVariableDTIR
public <T> T accept(DeclarationTIRVisitor<T> visitor)
DeclarationTIR
DeclarationTIRVisitor
.
accept
in interface DeclarationTIR
visitor
- the visitor object.
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |