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