com.voytechs.jnetstream.npl
Class Context
java.lang.Object
com.voytechs.jnetstream.npl.Context
public class Context
- extends java.lang.Object
|
Field Summary |
protected java.lang.Object |
userData
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
userData
protected java.lang.Object userData
Context
public Context(Context parent,
java.util.Map perm,
SymTable sym)
- Initializes the Context object.
Every context object gets its name from the SymTable object.
Also this context object registers itself with the sym object using
SymTable's setContext() call. perm table is a table of persistent properties
the exist.
- Parameters:
parent - The parent Context object to which we belong to.perm - The permanent table of properties in form of Primitives.sym - The SymTable for this Statement node.
setUserData
public void setUserData(java.lang.Object userData)
getUserData
public java.lang.Object getUserData()
getRoot
public Context getRoot()
getParent
public Context getParent()
getName
public java.lang.String getName()
setPrimitive
public void setPrimitive(java.lang.String name,
Primitive primitive)
setPrimitiveArray
public void setPrimitiveArray(java.lang.String name,
Primitive[] primitive)
removePrimitive
public Primitive removePrimitive(java.lang.String name)
getSymTable
public SymTable getSymTable()
getPrimitive
public Primitive getPrimitive(java.lang.String name)
- Locates the named primitive in the context and returns it.
- Parameters:
name - Name of the Primitive element to return.
- Returns:
- Primitive found or null.
getPrimitiveArray
public Primitive[] getPrimitiveArray(java.lang.String name)
- Locates the named primitive in the context and returns it.
- Parameters:
name - Name of the Primitive element to return.
- Returns:
- Primitive found or null.
main
public static void main(java.lang.String[] args)
- Test function for Context
- Parameters:
args - command line arguments