|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.nrl.parser.ast.Variable
public class Variable
A default implementation of the variable reference interface.
| Constructor Summary | |
|---|---|
Variable(String name,
IExpression boundExpression)
|
|
Variable(String name,
IModelElement boundElement)
|
|
| Method Summary | |
|---|---|
IModelElement |
getBoundElement()
Return the model element bound to this variable. |
IExpression |
getBoundExpression()
Return the complex expression bound to this variable. |
INRLAstNode |
getDeclarationNode()
Helper node for error reporting - where the variable was declared |
String |
getName()
Return the variable name. |
NRLDataType |
getNRLDataType()
Return a type constant from the NRLDataType class, indicating the
data type of the variable. |
Object |
getUserData(String key)
Return a named user data object associated with this variable. |
boolean |
isBoundToElement()
Return true if the variable is bound to a model element, false if it is bound to a complex expression |
void |
setDeclarationNode(INRLAstNode declarationNode)
Helper node for error reporting - where the variable was declared |
void |
setNRLDataType(NRLDataType type)
Assign an NRL type to this variable. |
void |
setUserData(String key,
Object data)
Associate user data with this variable node, under a given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Variable(String name,
IExpression boundExpression)
public Variable(String name,
IModelElement boundElement)
| Method Detail |
|---|
public IModelElement getBoundElement()
IVariableIVariable.isBoundToElement() returns false for this variable, then this
method will return null.
getBoundElement in interface IVariablepublic IExpression getBoundExpression()
IVariableIVariable.isBoundToElement() returns true for this variable, then this
will return null, else it returns the expression.
getBoundExpression in interface IVariablepublic INRLAstNode getDeclarationNode()
public String getName()
IVariable
getName in interface IVariablepublic NRLDataType getNRLDataType()
IVariableNRLDataType class, indicating the
data type of the variable.
This can only be called once a type inference algorithm has been applied to the variable or the entire AST.
getNRLDataType in interface IVariablepublic Object getUserData(String key)
IVariable
getUserData in interface IVariablekey - the key identifying the data
public boolean isBoundToElement()
IVariable
isBoundToElement in interface IVariablepublic void setDeclarationNode(INRLAstNode declarationNode)
declarationNode - the nodepublic void setNRLDataType(NRLDataType type)
IVariable
setNRLDataType in interface IVariabletype - the type
public void setUserData(String key,
Object data)
IVariable
setUserData in interface IVariablekey - the keydata - the data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||