--- parser3/src/include/pa_request.h 2003/11/20 16:34:25 1.172 +++ parser3/src/include/pa_request.h 2005/08/09 08:14:50 1.179 @@ -1,14 +1,14 @@ /** @file Parser: request class decl. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_REQUEST_H #define PA_REQUEST_H -static const char * const IDENT_REQUEST_H="$Date: 2003/11/20 16:34:25 $"; +static const char * const IDENT_REQUEST_H="$Date: 2005/08/09 08:14:50 $"; #include "pa_pool.h" #include "pa_hash.h" @@ -147,7 +147,7 @@ public: bool finterrupted; public: - size_t register_file(String::Body file_spec); + uint register_file(String::Body file_spec); struct Exception_details { const Trace trace; @@ -160,6 +160,7 @@ public: VHash& avhash): trace(atrace), problem_source(aproblem_source), vhash(avhash) {} }; Exception_details get_details(const Exception& e); + const char* get_exception_cstr(const Exception& e, Exception_details& details); /// @see Stack::wipe_unused void wipe_unused_execution_stack() { @@ -217,7 +218,8 @@ public: void use_buf(VStateless_class& aclass, const char* source, const String* main_alias, - uint file_no); // pa_request.C + uint file_no, + int line_no_offset=0); // pa_request.C /// processes any code-junction there may be inside of @a value StringOrValue process(Value& input_value, bool intercept_string=true); // execute.C @@ -334,6 +336,25 @@ public: // status read methods } */ + /// for @main[] + const String* execute_virtual_method(Value& aself, const String& method_name); + + /// for @postprocess[body] + StringOrValue execute_method(VMethodFrame& amethodFrame, const Method& method); + //{ for @conf[filespec] and @auto[filespec] and parser://method/call + const String* execute_method(Value& aself, + const Method& method, VString* optional_param, + bool do_return_string); + struct Execute_nonvirtual_method_result { + const String* string; + Method* method; + Execute_nonvirtual_method_result(): string(0), method(0) {} + }; + Execute_nonvirtual_method_result execute_nonvirtual_method(VStateless_class& aclass, + const String& method_name, VString* optional_param, + bool do_return_string); + //} + #ifdef XML public: // charset helpers @@ -355,32 +376,18 @@ private: void configure_admin(VStateless_class& conf_class); + void configure(); + private: // compile.C VStateless_class& compile(VStateless_class* aclass, const char* source, const String* main_alias, - uint file_no); + uint file_no, + int line_no_offset); private: // execute.C - /// for @postprocess[body] - StringOrValue execute_method(VMethodFrame& amethodFrame, const Method& method); - //{ for @conf[filespec] and @auto[filespec] - const String* execute_method(Value& aself, - const Method& method, VString* optional_param, - bool do_return_string); - struct Execute_nonvirtual_method_result { - const String* string; - Method* method; - Execute_nonvirtual_method_result(): string(0), method(0) {} - }; - Execute_nonvirtual_method_result execute_nonvirtual_method(VStateless_class& aclass, - const String& method_name, VString* optional_param, - bool do_return_string); - //} - /// for @main[] - const String* execute_virtual_method(Value& aself, const String& method_name); - + void put_element(Value& ncontext, const String& name, Value& value); Value& get_element(Value& ncontext, const String& name, bool can_call_operator); private: // defaults