1999-05-08 02:18:39 +04:00
|
|
|
|
|
|
|
import java.util.Hashtable;
|
|
|
|
|
|
|
|
class Environment {
|
|
|
|
|
1999-06-15 04:57:05 +04:00
|
|
|
JSScope scope = new JSScope("globals");
|
|
|
|
JSScope globalScope = scope;
|
|
|
|
|
1999-06-12 03:05:16 +04:00
|
|
|
|
1999-06-15 04:57:05 +04:00
|
|
|
void enterNewScope(JSScope newScope)
|
1999-06-12 03:05:16 +04:00
|
|
|
{
|
1999-06-15 04:57:05 +04:00
|
|
|
newScope.parent = scope;
|
|
|
|
scope = newScope;
|
|
|
|
}
|
|
|
|
|
|
|
|
void leaveScope()
|
|
|
|
{
|
|
|
|
scope = scope.parent;
|
1999-06-12 03:05:16 +04:00
|
|
|
}
|
1999-05-28 23:00:48 +04:00
|
|
|
|
1999-05-08 02:18:39 +04:00
|
|
|
String print()
|
|
|
|
{
|
|
|
|
StringBuffer result = new StringBuffer("Globals contents :\n");
|
1999-05-26 01:49:40 +04:00
|
|
|
result.append(scope.toString());
|
1999-05-08 02:18:39 +04:00
|
|
|
return result.toString();
|
|
|
|
}
|
|
|
|
|
1999-06-11 04:21:26 +04:00
|
|
|
JSValue resultValue;
|
1999-05-08 02:18:39 +04:00
|
|
|
|
|
|
|
}
|