--- parser3/src/main/execute.C 2001/08/02 09:58:34 1.190 +++ parser3/src/main/execute.C 2001/10/19 12:43:30 1.196 @@ -2,10 +2,10 @@ Parser: executor part of request class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: execute.C,v 1.196 2001/10/19 12:43:30 parser Exp $ */ -static const char *RCSId="$Id: execute.C,v 1.190 2001/08/02 09:58:34 parser Exp $"; #include "pa_opcode.h" #include "pa_array.h" @@ -21,6 +21,7 @@ static const char *RCSId="$Id: execute.C #include "pa_vtable.h" #include "pa_vfile.h" #include "pa_vimage.h" +#include "pa_wwrapper.h" //#define DEBUG_EXECUTE @@ -163,7 +164,7 @@ void Request::execute(const Array& ops) const String& name=POP_NAME(); Value *value=static_cast(classes().get(name)); if(!value) - THROW(0,0, + throw Exception(0,0, &name, "class is undefined"); @@ -326,7 +327,7 @@ void Request::execute(const Array& ops) // not a code-junction Junction *junction=value->get_junction(); if(!junction) - THROW(0, 0, + throw Exception(0, 0, &value->name(), "(%s) not a method or junction, can not call it", value->type()); @@ -377,7 +378,7 @@ void Request::execute(const Array& ops) String::UL_CLEAN // not used, always an object, not string ); } else - THROW(0, 0, + throw Exception(0, 0, &frame->name(), "method is static and can not be used as constructor"); } else { @@ -409,7 +410,7 @@ void Request::execute(const Array& ops) method.call_type==Method::CT_ANY || method.call_type==call_type) // allowed call type? if(method.native_code) { // native code? - method.check_actual_numbered_params(pool(), + method.check_actual_numbered_params( frame->junction.self, frame->name(), frame->numbered_params()); method.native_code( @@ -418,7 +419,7 @@ void Request::execute(const Array& ops) } else { // parser code if(++anti_endless_execute_recoursion==ANTI_ENDLESS_EXECUTE_RECOURSION) { anti_endless_execute_recoursion=0; // give @exception a chance - THROW(0, 0, + throw Exception(0, 0, &frame->name(), "endless recursion detected"); } @@ -427,7 +428,7 @@ void Request::execute(const Array& ops) anti_endless_execute_recoursion--; } else - THROW(0, 0, + throw Exception(0, 0, &frame->name(), "is not allowed to be called %s", call_type==Method::CT_STATIC?"statically":"dynamically"); @@ -537,7 +538,7 @@ void Request::execute(const Array& ops) if(!problem_source->origin().file) problem_source=&b->name(); #endif - THROW(0, 0, + throw Exception(0, 0, problem_source, "Division by zero"); } @@ -559,7 +560,7 @@ void Request::execute(const Array& ops) if(!problem_source->origin().file) problem_source=&b->name(); #endif - THROW(0, 0, + throw Exception(0, 0, problem_source, "Modulus by zero"); } @@ -702,6 +703,7 @@ void Request::execute(const Array& ops) } case OP_IS: { + //_asm int 3; Value *b=POP(); Value *a=POP(); Value *value=NEW VBool(pool(), b->as_string() == a->type()); PUSH(value); @@ -709,7 +711,7 @@ void Request::execute(const Array& ops) } default: - THROW(0,0, + throw Exception(0,0, 0, "invalid opcode %d", op.code); } @@ -724,7 +726,7 @@ Value *Request::get_element() { if(Method* method=OP.get_method(name)) { // maybe operator? // as if that method were in self and we have normal dynamic method here Junction& junction=*NEW Junction(pool(), - *self, self->get_class(), method, 0,0,0,0); + *root/*self*/, self->get_class(), method, 0,0,0,0); value=NEW VJunction(junction); } if(value)