|
|
| version 1.35, 2001/02/24 11:30:10 | version 1.37, 2001/02/24 14:20:51 |
|---|---|
| Line 101 void Request::execute(const Array& ops) | Line 101 void Request::execute(const Array& ops) |
| } | } |
| // OP_WITH | // OP_WITH |
| case OP_WITH_WRITE: | case OP_WITH_SELF: |
| { | { |
| PUSH(wcontext); | PUSH(self); |
| break; | break; |
| } | } |
| case OP_WITH_READ: | case OP_WITH_ROOT: |
| { | { |
| PUSH(rcontext); | PUSH(root); |
| break; | break; |
| } | } |
| case OP_WITH_ROOT: | case OP_WITH_READ: |
| { | { |
| PUSH(root); | PUSH(rcontext); |
| break; | break; |
| } | } |
| case OP_WITH_SELF: | case OP_WITH_WRITE: |
| { | { |
| PUSH(self); | PUSH(wcontext); |
| break; | 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: | case OP_WRITE: |
| { | { |
| Value *value=POP(); | Value *value=POP(); |
| Line 144 void Request::execute(const Array& ops) | Line 154 void Request::execute(const Array& ops) |
| break; | 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: | case OP_CREATE_EWPOOL: |
| { | { |
| Line 162 void Request::execute(const Array& ops) | Line 163 void Request::execute(const Array& ops) |
| } | } |
| case OP_REDUCE_EWPOOL: | case OP_REDUCE_EWPOOL: |
| { | { |
| Value *value=wcontext->value_or_string(); | Value *value=wcontext->result(); |
| wcontext=static_cast<WContext *>(POP()); | wcontext=static_cast<WContext *>(POP()); |
| PUSH(value); | PUSH(value); |
| break; | break; |
| Line 187 void Request::execute(const Array& ops) | Line 188 void Request::execute(const Array& ops) |
| break; | break; |
| } | } |
| // CALL | |
| case OP_GET_METHOD_FRAME: | case OP_GET_METHOD_FRAME: |
| { | { |
| Value *value=POP(); | Value *value=POP(); |
| Line 223 void Request::execute(const Array& ops) | Line 225 void Request::execute(const Array& ops) |
| frame->set_self(self); | frame->set_self(self); |
| root=rcontext=wcontext=frame; | root=rcontext=wcontext=frame; |
| execute(frame->junction.method->code); | execute(frame->junction.method->code); |
| Value *value=wcontext->value(); | Value *value=wcontext->result(); |
| wcontext=static_cast<WContext *>(POP()); rcontext=POP(); root=POP(); self=POP(); | wcontext=static_cast<WContext *>(POP()); rcontext=POP(); root=POP(); self=POP(); |
| wcontext->write(value); | wcontext->write(value); |
| printf("<-returned"); | printf("<-returned"); |
| Line 246 Value *Request::get_element() { | Line 248 Value *Request::get_element() { |
| if(value) { | if(value) { |
| Junction *junction=value->get_junction(); | 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 | // autocalc it |
| printf("ja->\n"); | printf("ja->\n"); |
| PUSH(self); PUSH(root); PUSH(rcontext); PUSH(wcontext); | PUSH(self); PUSH(root); PUSH(rcontext); PUSH(wcontext); |
| Line 258 Value *Request::get_element() { | Line 260 Value *Request::get_element() { |
| rcontext=junction->rcontext; | rcontext=junction->rcontext; |
| execute(*junction->code); | execute(*junction->code); |
| // CodeFrame soul: | // CodeFrame soul: |
| // string writes intercepted | // string writes were intercepted |
| // and they are the result of getting code junction | // returning them as the result of getting code-junction |
| value=NEW VString(frame.get_string()); | value=NEW VString(frame.get_string()); |
| wcontext=static_cast<WContext *>(POP()); rcontext=POP(); root=POP(); self=POP(); | wcontext=static_cast<WContext *>(POP()); rcontext=POP(); root=POP(); self=POP(); |
| printf("<-ja returned"); | printf("<-ja returned"); |