--- parser3/src/include/Attic/pa_vmframe.h 2001/03/09 04:47:27 1.20 +++ parser3/src/include/Attic/pa_vmframe.h 2001/03/10 16:34:37 1.23 @@ -1,5 +1,9 @@ /* - $Id: pa_vmframe.h,v 1.20 2001/03/09 04:47:27 paf Exp $ + Parser + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan + + $Id: pa_vmframe.h,v 1.23 2001/03/10 16:34:37 paf Exp $ */ #ifndef PA_VMFRAME_H @@ -42,11 +46,12 @@ public: // usage junction(ajunction), store_param_index(0), - my(0), fself(0) { + my(0), fnumbered_params(0), + fself(0) { Method &method=*junction.method; - if(method.numbered_params_count) // are this method params numbered? + if(method.max_numbered_params_count) // are this method params numbered? fnumbered_params=NEW Array(pool()); // create storage else // named params my=NEW Hash(pool()); // create storage @@ -57,8 +62,8 @@ public: // usage for(int i=0; isize(); i++) { Value *value=NEW VUnknown(pool()); String& name=*static_cast(method.locals_names->get(i)); - value->set_name(name); my->put(name, value); + value->set_name(name); } } } @@ -68,18 +73,18 @@ public: // usage void store_param(Value *value) { Method& method=*junction.method; int max_params= - method.numbered_params_count?method.numbered_params_count: + method.max_numbered_params_count?method.max_numbered_params_count: method.params_names?method.params_names->size(): 0; if(store_param_index==max_params) THROW(0,0, &junction.self.name(), - "%s method '%s' accepts maximum %d parameter(s)", + "(%s) method '%s' accepts maximum %d parameter(s)", junction.self.type(), method.name.cstr(), max_params); - if(method.numbered_params_count) { // are this method params numbered? + if(method.max_numbered_params_count) { // are this method params numbered? *fnumbered_params+=value; } else { // named param String& name=*static_cast( @@ -90,24 +95,17 @@ public: // usage } void fill_unspecified_params() { Method &method=*junction.method; - if(method.numbered_params_count) { // are this method params numbered? - for(; store_param_indexsize(); store_param_index++) { Value *value=NEW VUnknown(pool()); - //value->set_name(/*"Param#" . store_param_index*/); - *fnumbered_params+=value; + String& name=*static_cast( + method.params_names->get(store_param_index)); + my->put(name, value); + value->set_name(name); } - } else { // named params - if(method.params_names) // there are any parameters might need filling? - for(; store_param_indexsize(); store_param_index++) { - Value *value=NEW VUnknown(pool()); - String& name=*static_cast(method.params_names->get(store_param_index)); - value->set_name(name); - my->put(name, value); - } - } } - Array& numbered_params() { return *fnumbered_params; } + Array *numbered_params() { return fnumbered_params; } public: