|
|||||||||
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 |
---|
equals, 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()
IVariable
IVariable.isBoundToElement()
returns false for this variable, then this
method will return null
.
getBoundElement
in interface IVariable
public IExpression getBoundExpression()
IVariable
IVariable.isBoundToElement()
returns true for this variable, then this
will return null, else it returns the expression.
getBoundExpression
in interface IVariable
public INRLAstNode getDeclarationNode()
public String getName()
IVariable
getName
in interface IVariable
public NRLDataType getNRLDataType()
IVariable
NRLDataType
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 IVariable
public Object getUserData(String key)
IVariable
getUserData
in interface IVariable
key
- the key identifying the data
public boolean isBoundToElement()
IVariable
isBoundToElement
in interface IVariable
public void setDeclarationNode(INRLAstNode declarationNode)
declarationNode
- the nodepublic void setNRLDataType(NRLDataType type)
IVariable
setNRLDataType
in interface IVariable
type
- the typepublic void setUserData(String key, Object data)
IVariable
setUserData
in interface IVariable
key
- the keydata
- the data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |