Moved from stack to inline execution.

git-svn-id: svn://10.0.0.236/trunk@33132 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
1999-05-28 19:00:48 +00:00
parent 734272ce20
commit 7448fc1fe9
23 changed files with 279 additions and 396 deletions

View File

@@ -7,31 +7,32 @@ class BinaryNode extends ExpressionNode {
op = aOp;
}
void evalLHS(Environment theEnv)
JSReference evalLHS(Environment theEnv)
{
if (op == ".") {
left.eval(theEnv);
JSValue lV = theEnv.theStack.pop();
JSValue lV = left.eval(theEnv);
JSString id;
if (right instanceof JSIdentifier)
theEnv.theStack.push((JSValue)right);
id = (JSString)right;
else
right.eval(theEnv);
theEnv.theStack.push(lV);
id = right.eval(theEnv).toJSString(theEnv);
return new JSReference(lV, id);
}
else
throw new RuntimeException("bad lValue operator " + op);
}
void eval(Environment theEnv)
JSValue eval(Environment theEnv)
{
left.eval(theEnv);
JSValue lV = theEnv.theStack.pop();
right.eval(theEnv);
JSValue lV = left.eval(theEnv);
JSValue rV = right.eval(theEnv);
if (op == ".")
lV.getProp(theEnv);
else
return lV.getProp(theEnv, rV.toJSString(theEnv));
else {
System.out.println("missing binary op " + op);
return null;
}
}