--- parser3/src/classes/Attic/root.C 2001/03/12 09:31:26 1.19 +++ parser3/src/classes/Attic/root.C 2001/03/12 09:40:59 1.21 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: root.C,v 1.19 2001/03/12 09:31:26 paf Exp $ + $Id: root.C,v 1.21 2001/03/12 09:40:59 paf Exp $ */ #include @@ -49,11 +49,11 @@ static void _untaint(Request& r, const S static void _process(Request& r, const String& name, Array *params) { - Value *vsource=static_cast(params->get(0)); // evaluate source to process - const String& source=r.process(*vsource).as_string(); + const String& source=r.process(*static_cast(params->get(0))).as_string(); - // process source code, append processed methods to 'self' class + // calculate pseudo file name of processed chars + // would be something like "/some/file(4) process" char place[MAX_STRING]; #ifndef NO_STRING_ORIGIN const Origin& origin=source.origin(); @@ -64,20 +64,18 @@ static void _process(Request& r, const S strncpy(place, MAX_STRING, name.cstr()); #endif - VClass &self_class=*r.self->get_class(); - // temporarily zeroing @main so to maybe-replace it in processed code + VClass& self_class=*r.self->get_class(); + // temporary zero @main so to maybe-replace it in processed code Temp_method temp_method(self_class, *main_method_name, 0); + // process source code, append processed methods to 'self' class // maybe-define new @main r.use_buf(source.cstr(), place, &self_class); // maybe-execute @main[] - if(Value *value=r.self->get_element(*main_method_name)) { // found some 'main' element - if(Junction *junction=value->get_junction()) // it even has junction! - if(const Method *method=junction->method) { // and junction is method-junction! call it - // execute! - r.execute(*method->parser_code); - } + if(const Method *method=self_class.get_method(*main_method_name)) { + // execute! + r.execute(*method->parser_code); } }