Diff for /parser3/src/main/execute.C between versions 1.138 and 1.146

version 1.138, 2001/04/05 19:35:16 version 1.146, 2001/04/12 13:15:22
Line 15 Line 15
 #include "pa_vstring.h"  #include "pa_vstring.h"
 #include "pa_vhash.h"  #include "pa_vhash.h"
 #include "pa_vunknown.h"  #include "pa_vunknown.h"
 #include "pa_vcframe.h"  #include "pa_vcode_frame.h"
 #include "pa_vmframe.h"  #include "pa_vmethod_frame.h"
 #include "pa_vobject.h"  #include "pa_vobject.h"
 #include "pa_vdouble.h"  #include "pa_vdouble.h"
 #include "pa_vbool.h"  #include "pa_vbool.h"
 #include "pa_vtable.h"  #include "pa_vtable.h"
 #include "pa_vfile.h"  #include "pa_vfile.h"
   #include "pa_vimage.h"
   
 #include <stdio.h>  #include <stdio.h>
   
Line 148  void Request::execute(const Array& ops) Line 149  void Request::execute(const Array& ops)
                                 // the object expression result                                  // the object expression result
                                 // does not need to be written into calling frame                                  // does not need to be written into calling frame
                                 // it must go into any expressions using that parameter                                  // it must go into any expressions using that parameter
                                 // hence, zeroing junction.wcontext being created                                  // hence, we zero junction.wcontext here, and later
                                 // later, in .process we would test that field                                   // in .process we would test that field 
                                 // in decision "which wwrapper to use"                                  // in decision "which wwrapper to use"
                                 Junction& j=*NEW Junction(pool(),                                   Junction& j=*NEW Junction(pool(), 
                                         *self, 0, 0,                                          *self, 0, 0,
Line 177  void Request::execute(const Array& ops) Line 178  void Request::execute(const Array& ops)
                                 if(!value)                                   if(!value) 
                                         THROW(0,0,                                          THROW(0,0,
                                                 &name,                                                  &name,
                                                 ": undefined class");                                                   "class is undefined"); 
   
                                 PUSH(value);                                  PUSH(value);
                                 break;                                  break;
Line 228  void Request::execute(const Array& ops) Line 229  void Request::execute(const Array& ops)
                         {                          {
                                 Value *value=POP();                                  Value *value=POP();
                                 write_assign_lang(*value);                                  write_assign_lang(*value);
   
                                   // forget the fact they've entered some ^object.method[].
                                   // see OP_GET_ELEMENT
                                   wcontext->clear_somebody_entered_some_object();
                                 break;                                  break;
                         }                          }
                 case OP_WRITE_EXPR_RESULT:                  case OP_WRITE_EXPR_RESULT:
Line 283  void Request::execute(const Array& ops) Line 288  void Request::execute(const Array& ops)
                         {                          {
                                 Value *ncontext=POP();                                  Value *ncontext=POP();
                                 PUSH(rcontext);                                  PUSH(rcontext);
                                 rcontext=ncontext;  
                                 PUSH(wcontext);                                  PUSH(wcontext);
                                   rcontext=ncontext;
                                 wcontext=NEW WWrapper(pool(), ncontext, false /*not constructing*/);                                  wcontext=NEW WWrapper(pool(), ncontext, false /*not constructing*/);
                                 break;                                  break;
                         }                          }
Line 379  void Request::execute(const Array& ops) Line 384  void Request::execute(const Array& ops)
                                                         self=NEW VTable(pool());                                                          self=NEW VTable(pool());
                                                 else if(called_class==file_class)                                                  else if(called_class==file_class)
                                                         self=NEW VFile(pool());                                                          self=NEW VFile(pool());
                                                   else if(called_class==image_class)
                                                           self=NEW VImage(pool());
                                                 else // stateful object                                                  else // stateful object
                                                         self=NEW VObject(pool(), *called_class);                                                          self=NEW VObject(pool(), *called_class);
                                                 frame->write(*self,                                                   frame->write(*self, 
Line 655  void Request::execute(const Array& ops) Line 662  void Request::execute(const Array& ops)
                 default:                  default:
                         THROW(0,0,                          THROW(0,0,
                                 0,                                  0,
                                 "unhandled '%s' opcode", opcode_name[op.code]);                                   "invalid opcode %d", op.code); 
                 }                  }
         }          }
 }  }
Line 664  Value *Request::get_element() { Line 671  Value *Request::get_element() {
         const String& name=POP_NAME();          const String& name=POP_NAME();
         Value *ncontext=POP();          Value *ncontext=POP();
         Value *value=ncontext->get_element(name);          Value *value=ncontext->get_element(name);
           if(!value)
                   if(Method* method=OP.get_method(name)) { // 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);
                           value=NEW VJunction(junction);
                   }
         if(value)          if(value)
                 value=&process(*value, &name); // process possible code-junction                  value=&process(*value, &name); // process possible code-junction
         else {          else {

Removed from v.1.138  
changed lines
  Added in v.1.146


E-mail: