--- parser3/src/main/execute.C 2003/02/20 16:09:01 1.295.2.16 +++ parser3/src/main/execute.C 2003/02/24 16:28:09 1.295.2.18 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_EXECUTE_C="$Date: 2003/02/20 16:09:01 $"; +static const char* IDENT_EXECUTE_C="$Date: 2003/02/24 16:28:09 $"; #include "pa_opcode.h" #include "pa_array.h" @@ -23,7 +23,7 @@ static const char* IDENT_EXECUTE_C="$Dat #include "pa_vimage.h" #include "pa_wwrapper.h" -#define DEBUG_EXECUTE +// #define DEBUG_EXECUTE #ifdef DEBUG_EXECUTE char *opcode_name[]={ @@ -111,6 +111,15 @@ void Request::execute(ArrayOperation& op StringPtr last_get_element_name(0); Array_iterator i(ops); + ValuePtr value; + ValuePtr a; ValuePtr b; + //ArrayOperationPtr b_code; + + StringPtr name; + Value* ncontext; + + ArrayOperationPtr local_ops; + while(i.has_next()) { if(interrupted()) throw Exception("parser.interrupted", @@ -122,15 +131,6 @@ void Request::execute(ArrayOperation& op debug_printf(sapi_info, "%d:%s", stack.top_index()+1, opcode_name[op.code]); #endif - ValuePtr value; - ValuePtr a; ValuePtr b; - //ArrayOperationPtr b_code; - - StringPtr name; - Value* ncontext; - - ArrayOperationPtr local_ops; - switch(op.code) { // param in next instruction case OP_VALUE: @@ -820,7 +820,7 @@ void Request::execute(ArrayOperation& op */ ValuePtr Request::get_element(StringPtr& remember_name, bool can_call_operator) { StringPtr name=stack.pop().string(); remember_name=name; - Value* ncontext=stack.pop().value.get(); + ValuePtr ncontext=stack.pop().value; ValuePtr value(0); if(can_call_operator) { if(MethodPtr method=main_class->get_method(name)) // looking operator of that name FIRST @@ -844,7 +844,7 @@ ValuePtr Request::get_element(StringPtr& if(value && wcontext->get_constructing()) if(JunctionPtr junction=value->get_junction()) { - if(junction->self->get_class()!=ncontext) + if(junction->self->get_class()!=ncontext.get()) throw Exception("parser.runtime", name, "constructor must be declared in class %s", ncontext->get_class()->name_cstr());