|
|
| version 1.65, 2001/03/08 09:31:48 | version 1.67, 2001/03/08 10:13:26 |
|---|---|
| Line 23 | Line 23 |
| char *opcode_name[]={ | char *opcode_name[]={ |
| // literals | // literals |
| "VALUE", "CODE__STORE_PARAM", "CLASS", | "VALUE", "CODE__STORE_PARAM", |
| // actions | // actions |
| "WITH_SELF", "WITH_ROOT", "WITH_READ", "WITH_WRITE", | "WITH_SELF", "WITH_ROOT", "WITH_READ", "WITH_WRITE", |
| "GET_CLASS", | |
| "CONSTRUCT", | "CONSTRUCT", |
| "WRITE", | "WRITE", |
| "GET_ELEMENT", "GET_ELEMENT__WRITE", | "GET_ELEMENT", "GET_ELEMENT__WRITE", |
| Line 69 void dump(int level, const Array& ops) { | Line 70 void dump(int level, const Array& ops) { |
| Value *value=static_cast<Value *>(ops.quick_get(++i)); | Value *value=static_cast<Value *>(ops.quick_get(++i)); |
| fprintf(stderr, " \"%s\" %s", value->get_string()->cstr(), value->type()); | fprintf(stderr, " \"%s\" %s", value->get_string()->cstr(), value->type()); |
| } | } |
| if(op.code==OP_CLASS) { | |
| VClass *vclass=static_cast<VClass *>(ops.quick_get(++i)); | |
| fprintf(stderr, " \"%s\"", vclass->name().cstr()); | |
| } | |
| fprintf(stderr, "\n"); | fprintf(stderr, "\n"); |
| if(op.code==OP_CODE__STORE_PARAM) { | if(op.code==OP_CODE__STORE_PARAM) { |
| Line 125 void Request::execute(const Array& ops) | Line 122 void Request::execute(const Array& ops) |
| frame->store_param(value); | frame->store_param(value); |
| break; | break; |
| } | } |
| case OP_CLASS: | case OP_GET_CLASS: |
| { | { |
| VClass *vclass=static_cast<VClass *>(ops.quick_get(++i)); | String& name=POP_NAME(); |
| fprintf(stderr, " \"%s\"", vclass->name().cstr()); | VClass *vclass=static_cast<VClass *>(classes().get(name)); |
| PUSH(vclass); | if(!vclass) |
| THROW(0,0, | |
| &name, | |
| ": undefined class"); | |
| PUSH(vclass); | |
| break; | break; |
| } | } |
| Line 522 void Request::execute(const Array& ops) | Line 524 void Request::execute(const Array& ops) |
| } | } |
| default: | default: |
| fprintf(stderr, "\tTODO"); | THROW(0,0, |
| break; | 0, |
| "unhandled '%s' opcode", opcode_name[op.code]); | |
| } | } |
| fprintf(stderr, "\n"); | fprintf(stderr, "\n"); |
| } | } |