--- parser3/src/main/execute.C 2001/02/24 11:30:10 1.35 +++ parser3/src/main/execute.C 2001/02/24 14:20:51 1.37 @@ -1,5 +1,5 @@ /* - $Id: execute.C,v 1.35 2001/02/24 11:30:10 paf Exp $ + $Id: execute.C,v 1.37 2001/02/24 14:20:51 paf Exp $ */ #include "pa_array.h" @@ -101,28 +101,38 @@ void Request::execute(const Array& ops) } // OP_WITH - case OP_WITH_WRITE: + case OP_WITH_SELF: { - PUSH(wcontext); + PUSH(self); break; } - case OP_WITH_READ: + case OP_WITH_ROOT: { - PUSH(rcontext); + PUSH(root); break; } - case OP_WITH_ROOT: + case OP_WITH_READ: { - PUSH(root); + PUSH(rcontext); break; } - case OP_WITH_SELF: + case OP_WITH_WRITE: { - PUSH(self); + PUSH(wcontext); break; } // ... + case OP_CONSTRUCT: + { + Value *value=POP(); + String& name=POP_NAME(); + Value *ncontext=POP(); + value->set_name(name); + ncontext->put_element(name, value); + break; + } + // TODO: OP_EXPRESSION_EVAL, OP_MODIFY_EVAL, case OP_WRITE: { Value *value=POP(); @@ -144,15 +154,6 @@ void Request::execute(const Array& ops) break; } - case OP_CONSTRUCT: - { - Value *value=POP(); - String& name=POP_NAME(); - Value *ncontext=POP(); - value->set_name(name); - ncontext->put_element(name, value); - break; - } case OP_CREATE_EWPOOL: { @@ -162,7 +163,7 @@ void Request::execute(const Array& ops) } case OP_REDUCE_EWPOOL: { - Value *value=wcontext->value_or_string(); + Value *value=wcontext->result(); wcontext=static_cast(POP()); PUSH(value); break; @@ -187,6 +188,7 @@ void Request::execute(const Array& ops) break; } + // CALL case OP_GET_METHOD_FRAME: { Value *value=POP(); @@ -223,7 +225,7 @@ void Request::execute(const Array& ops) frame->set_self(self); root=rcontext=wcontext=frame; execute(frame->junction.method->code); - Value *value=wcontext->value(); + Value *value=wcontext->result(); wcontext=static_cast(POP()); rcontext=POP(); root=POP(); self=POP(); wcontext->write(value); printf("<-returned"); @@ -246,7 +248,7 @@ Value *Request::get_element() { if(value) { Junction *junction=value->get_junction(); - if(junction && junction->code) { // is it a code junction? + if(junction && junction->code) { // is it a code-junction? // autocalc it printf("ja->\n"); PUSH(self); PUSH(root); PUSH(rcontext); PUSH(wcontext); @@ -258,8 +260,8 @@ Value *Request::get_element() { rcontext=junction->rcontext; execute(*junction->code); // CodeFrame soul: - // string writes intercepted - // and they are the result of getting code junction + // string writes were intercepted + // returning them as the result of getting code-junction value=NEW VString(frame.get_string()); wcontext=static_cast(POP()); rcontext=POP(); root=POP(); self=POP(); printf("<-ja returned");