Files
Mozilla/mozilla/js2/jsc/src/java/parser/Value.java
jeff.dyer%compilercompany.com c66ef4b453 Updating JSC with framework for semantics in cpp.
git-svn-id: svn://10.0.0.236/trunk@90437 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-26 22:31:11 +00:00

93 lines
2.5 KiB
Java

package com.compilercompany.es3c.v1;
import java.util.Hashtable;
import java.util.Vector;
/**
* The value class from which all other values derive.
*/
abstract public class Value implements Scope {
private static final boolean debug = false;
public Value type;
public Value getValue(Context context) throws Exception { return this; }
public Value getType(Context context) throws Exception { return type; }
/*
Hashtable defaultNames = new Hashtable();
Hashtable namespaces = new Hashtable();
Hashtable attributes = new Hashtable();
*/
public boolean has(Value namespace, String name) throws Exception {
throw new Exception("Constructor object expected in new expression");
/*
Hashtable names;
if( namespace == null ) {
names = defaultNames;
} else {
names = (Hashtable) namespaces.get(namespace);
}
return names.containsKey(name);
*/
}
public Slot get(Value namespace, String name) throws Exception {
throw new Exception("Constructor object expected in new expression");
/*
if(debug) {
Debugger.trace("ObjectValue.get() with namespaces="+namespaces+", namespace="+namespace+", name="+name);
}
Hashtable names;
if( namespace == null ) {
names = defaultNames;
} else {
names = (Hashtable) namespaces.get(namespace);
}
return (Slot) names.get(name);
*/
}
public Slot add(Value namespace, String name) throws Exception {
throw new Exception("Constructor object expected in new expression");
/*
if( debug ) {
Debugger.trace("ObjectType.add() with this = " + this + " namespace = " + namespace + " name = " + name);
}
Hashtable names;
if( namespace == null ) {
names = defaultNames;
} else {
names = (Hashtable) namespaces.get(namespace);
if( names==null ) {
names = new Hashtable();
namespaces.put(namespace,names);
}
}
Slot slot = new Slot();
names.put(name,slot);
return slot;
*/
}
int size() {
return 0;
}
public Value construct(Context context, Value args) throws Exception {
throw new Exception("Constructor object expected in new expression");
}
public Value call(Context context, Value args) throws Exception {
throw new Exception("Callable object expected in call expression");
}
}
/*
* The end.
*/