|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjmathlib.core.interpreter.ContextList
public class ContextList
Stores a list of contexts. A context is a set of variables pluss some code. When a function is called a new context is added to the list. When the function is removed, the context is destroyed.
| Constructor Summary | |
|---|---|
ContextList()
Create an empty context to act as the global context This constructor must only be called ONCE, because it also creates the GLOBAL context |
|
| Method Summary | |
|---|---|
Context |
createContext(VariableList _variables)
Used to create a new context and put it on the stack when executing a function |
Variable |
createVariable(java.lang.String name)
create a variable in the local or global workspace |
VariableList |
getGlobalVariables()
|
Context |
getLocalContext()
|
VariableList |
getLocalVariables()
|
Variable |
getVariable(java.lang.String name)
this method returns a variable from the workspace. |
boolean |
isGlobalContext()
|
Context |
popContext()
return to the calling context of the function |
void |
pushContext(Context context)
|
void |
setVariable(java.lang.String name,
OperandToken value)
Set a variable in the local or global workspace. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContextList()
| Method Detail |
|---|
public void pushContext(Context context)
context - public Context createContext(VariableList _variables)
_variables - = the variable list of the function, null if it's a script filepublic Context popContext()
public VariableList getLocalVariables()
public VariableList getGlobalVariables()
public Variable getVariable(java.lang.String name)
name -
public Variable createVariable(java.lang.String name)
-
public void setVariable(java.lang.String name,
OperandToken value)
- - public boolean isGlobalContext()
public Context getLocalContext()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||