--- parser3/src/main/execute.C 2004/04/06 11:58:15 1.305.6.1 +++ parser3/src/main/execute.C 2004/07/30 10:01:14 1.306 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_EXECUTE_C="$Date: 2004/04/06 11:58:15 $"; +static const char * const IDENT_EXECUTE_C="$Date: 2004/07/30 10:01:14 $"; #include "pa_opcode.h" #include "pa_array.h" @@ -35,13 +35,12 @@ char *opcode_name[]={ "WITH_ROOT", "WITH_SELF", "WITH_READ", "WITH_WRITE", "GET_CLASS", "CONSTRUCT_VALUE", "CONSTRUCT_EXPR", "CURLY_CODE__CONSTRUCT", - "WRITE_VALUE", "WRITE_VALUE__EXPLICIT_RESULT", "WRITE_EXPR_RESULT", - "STRING__WRITE", + "WRITE_VALUE", "WRITE_EXPR_RESULT", "STRING__WRITE", "GET_ELEMENT_OR_OPERATOR", "GET_ELEMENT", "GET_ELEMENT__WRITE", "OBJECT_POOL", "STRING_POOL", "STORE_PARAM", "PREPARE_TO_CONSTRUCT_OBJECT", "PREPARE_TO_EXPRESSION", - "CALL", "CALL__WRITE", "CALL__WRITE__EXPLICIT_RESULT", + "CALL", "CALL__WRITE", // expression ops: unary "NEG", "INV", "NOT", "DEF", "IN", "FEXISTS", "DEXISTS", @@ -92,7 +91,8 @@ void debug_dump(SAPI_Info& sapi_info, in case OP_NESTED_CODE: case OP_OBJECT_POOL: case OP_STRING_POOL: - case OP_CALL: case OP_CALL__WRITE: case OP_CALL__WRITE__EXPLICIT_RESULT: + case OP_CALL: + case OP_CALL__WRITE: if(ArrayOperation* local_ops=i.next().ops) debug_dump(sapi_info, level+1, *local_ops); } @@ -235,13 +235,6 @@ void Request::execute(ArrayOperation& op write_assign_lang(value); break; } - case OP_WRITE_VALUE__EXPLICIT_RESULT: - { - //todo change me - Value& value=stack.pop().value(); - write_assign_lang(value); - break; - } case OP_WRITE_EXPR_RESULT: { Value& value=stack.pop().value(); @@ -383,7 +376,6 @@ void Request::execute(ArrayOperation& op case OP_CALL: case OP_CALL__WRITE: - case OP_CALL__WRITE__EXPLICIT_RESULT: { //is_debug_junction=true; ArrayOperation* local_ops=i.next().ops; @@ -494,24 +486,10 @@ void Request::execute(ArrayOperation& op rcontext=saved_rcontext; method_frame=saved_method_frame; - switch(opcode) { - case OP_CALL__WRITE: - write_assign_lang(result); - break; - case OP_CALL: - stack.push(result.as_value()); - break; - default: //case OP_CALL__WRITE__EXPLICIT_RESULT: - if(const String* string=result.get_string()) { - if(!string->is_empty()) - throw Exception("parser.runtime", - 0, - "returned some nonempty string, while it should not (explicit result)"); - } else // result.object - throw Exception("parser.runtime", - 0, - "returned some object, while it should not (explicit result)"); - break; + if(opcode==OP_CALL__WRITE) { + write_assign_lang(result); + } else { // OP_CALL + stack.push(result.as_value()); } #ifdef DEBUG_EXECUTE @@ -834,7 +812,7 @@ void Request::execute(ArrayOperation& op "invalid opcode %d", opcode); } } - } catch(...) { + } catch(const Exception&) { // record it to stack trace if(debug_name) exception_trace.push(Trace(debug_name, debug_origin));