--- parser3/src/classes/op.C 2001/07/07 16:38:01 1.34 +++ parser3/src/classes/op.C 2001/08/06 16:18:26 1.37 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: op.C,v 1.34 2001/07/07 16:38:01 parser Exp $"; +static const char *RCSId="$Id: op.C,v 1.37 2001/08/06 16:18:26 parser Exp $"; #include "classes.h" #include "pa_config_includes.h" @@ -25,13 +25,6 @@ static const char *RCSId="$Id: op.C,v 1. #define MAIN_SQL_NAME "SQL" #define MAIN_SQL_DRIVERS_NAME "drivers" -#define SWITCH_DATA_NAME "SWITCH-DATA" -#define DEFAULT_VALUE "DEFAULT" - -// local variable - -static Methoded *OP; - // class class MOP : public Methoded { @@ -40,6 +33,7 @@ public: public: // Methoded bool used_directly() { return true; } void configure_user(Request& r); + private: String main_sql_name; String main_sql_drivers_name; @@ -175,7 +169,7 @@ static void _while(Request& r, const Str static void _use(Request& r, const String& method_name, MethodParams *params) { Value& vfile=params->as_no_junction(0, "file name must not be code"); - r.use_file(r.absolute(vfile.as_string())); + r.use_file(vfile.as_string()); } static void _for(Request& r, const String& method_name, MethodParams *params) { @@ -234,7 +228,7 @@ static void _connect(Request& r, const S Value& body_code=params->as_junction(1, "body must be code"); Table *protocol2driver_and_client= - static_cast(r.classes_conf.get(OP->name())); + static_cast
(r.classes_conf.get(r.OP.name())); // connect SQL_Connection& connection=SQL_driver_manager->get_connection( @@ -276,9 +270,6 @@ static void _connect(Request& r, const S rethrow_me.comment()); } -static String *switch_data_name; -static String *default_value; - struct Switch_data { Value *searching; Value *found; @@ -306,7 +297,7 @@ static void _case(Request& r, const Stri for(int i=0; iget(i)); - if(value.as_string() == *default_value) { + if(value.as_string() == *case_default_value) { data._default=code; break; } @@ -332,9 +323,6 @@ MOP::MOP(Pool& apool) : Methoded(apool), { set_name(*NEW String(pool(), OP_CLASS_NAME)); - switch_data_name=NEW String(pool(), SWITCH_DATA_NAME); - default_value=NEW String(pool(), DEFAULT_VALUE); - // ^if(condition){code-when-true} // ^if(condition){code-when-true}{code-when-false} add_native_method("if", Method::CT_ANY, _if, 2, 3); @@ -380,7 +368,7 @@ MOP::MOP(Pool& apool) : Methoded(apool), // constructor & configurator Methoded *MOP_create(Pool& pool) { - return OP=new(pool) MOP(pool); + return new(pool) MOP(pool); }