com.voytechs.jnetstream.npl
Class MutableReferenceNode
java.lang.Object
com.voytechs.jnetstream.npl.Node
com.voytechs.jnetstream.npl.ReferenceNode
com.voytechs.jnetstream.npl.MutableReferenceNode
- All Implemented Interfaces:
- IntNode, LongNode, MutableIntNode, MutableLongNode, MutableStringNode, StringNode, Visitable
- Direct Known Subclasses:
- ConstReferenceNode
public class MutableReferenceNode
- extends ReferenceNode
- implements MutableIntNode, MutableLongNode, MutableStringNode
Allows modification to value of the node at run time.
| Fields inherited from class com.voytechs.jnetstream.npl.Node |
parent |
| Methods inherited from class com.voytechs.jnetstream.npl.ReferenceNode |
canOptimize, getInt, getLong, getName, getPrimitive, getString, isConstant, optimize, setName, setReference, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MutableReferenceNode
public MutableReferenceNode(java.lang.String name)
- Parameters:
-
- Throws:
MutableReferenceNode
public MutableReferenceNode(java.lang.String name,
Token token)
- Parameters:
-
- Throws:
visit
public boolean visit(Visitor visitor,
java.lang.Object user1,
java.lang.Object user2)
throws NodeException
- Specified by:
visit in interface Visitable
- Throws:
NodeException
setIntValue
public void setIntValue(int value)
- Specified by:
setIntValue in interface MutableIntNode
setLongValue
public void setLongValue(long value)
- Specified by:
setLongValue in interface MutableLongNode
setStringValue
public void setStringValue(java.lang.String value)
- Specified by:
setStringValue in interface MutableStringNode
setSymTable
public void setSymTable(SymTable sym)
getSymTable
public SymTable getSymTable()
getContext
protected Context getContext()
- Extracts the current context.
- Specified by:
getContext in class ReferenceNode
getToken
public Token getToken()
- Returns the token for this reference node.
- Overrides:
getToken in class Node
main
public static void main(java.lang.String[] args)
- Test function for MutableReferenceNode
- Parameters:
args - command line arguments