--- parser3/src/main/execute.C 2001/08/02 06:54:12 1.188 +++ parser3/src/main/execute.C 2001/09/26 10:32:26 1.192 @@ -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.192 2001/09/26 10:32:26 parser Exp $ */ -static const char *RCSId="$Id: execute.C,v 1.188 2001/08/02 06:54:12 parser Exp $"; #include "pa_opcode.h" #include "pa_array.h" @@ -68,24 +68,13 @@ void debug_printf(Pool& pool, const char } void debug_dump(Pool& pool, int level, const Array& ops) { -/* { - int size=ops.quick_size(); - //debug_printf(pool, "size=%d\n", size); - for(int i=0; i(ops.quick_get(++i)); + Value *value=static_cast(i.next()); debug_printf(pool, "%*s%s" " \"%s\" %s", @@ -99,7 +88,7 @@ void debug_dump(Pool& pool, int level, c case OP_CURLY_CODE__STORE_PARAM: case OP_EXPR_CODE__STORE_PARAM: case OP_CURLY_CODE__CONSTRUCT: - const Array *local_ops=reinterpret_cast(ops.quick_get(++i)); + const Array *local_ops=reinterpret_cast(i.next()); debug_dump(pool, level+1, *local_ops); } } @@ -117,11 +106,10 @@ void Request::execute(const Array& ops) debug_printf(pool(), "execution-------------------------\n"); #endif - int size=ops.quick_size(); - //debug_printf(pool(), "size=%d\n", size); - for(int i=0; i(ops.quick_get(++i)); + Value *value=static_cast(i.next()); #ifdef DEBUG_EXECUTE debug_printf(pool(), " \"%s\" %s", value->get_string()->cstr(), value->type()); #endif @@ -142,7 +130,7 @@ void Request::execute(const Array& ops) { VMethodFrame *frame=static_cast(stack.top_value()); // code - const Array *local_ops=reinterpret_cast(ops.quick_get(++i)); + const Array *local_ops=reinterpret_cast(i.next()); #ifdef DEBUG_EXECUTE debug_printf(pool(), " (%d)\n", local_ops->size()); debug_dump(pool(), 1, *local_ops); @@ -226,7 +214,7 @@ void Request::execute(const Array& ops) } case OP_CURLY_CODE__CONSTRUCT: { - const Array *local_ops=reinterpret_cast(ops.quick_get(++i)); + const Array *local_ops=reinterpret_cast(i.next()); #ifdef DEBUG_EXECUTE debug_printf(pool(), " (%d)\n", local_ops->size()); debug_dump(pool(), 1, *local_ops); @@ -263,7 +251,7 @@ void Request::execute(const Array& ops) } case OP_STRING__WRITE: { - VString *vstring=static_cast(ops.quick_get(++i)); + VString *vstring=static_cast(i.next()); #ifdef DEBUG_EXECUTE debug_printf(pool(), " \"%s\"", vstring->string().cstr()); #endif @@ -714,6 +702,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); @@ -736,7 +725,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)