Annotation of parser3/src/include/pa_request.h, revision 1.29

1.1       paf         1: /*
1.29    ! paf         2:   $Id: pa_request.h,v 1.28 2001/03/10 15:17:44 paf Exp $
1.1       paf         3: */
                      4: 
                      5: #ifndef PA_REQUEST_H
                      6: #define PA_REQUEST_H
                      7: 
                      8: #include "pa_pool.h"
1.4       paf         9: #include "pa_exception.h"
1.5       paf        10: #include "pa_hash.h"
1.7       paf        11: #include "pa_wcontext.h"
1.6       paf        12: #include "pa_value.h"
1.7       paf        13: #include "pa_stack.h"
1.12      paf        14: #include "pa_vclass.h"
1.7       paf        15: 
                     16: #define MAIN_METHOD_NAME "main"
1.27      paf        17: #define AUTO_METHOD_NAME "auto"
1.29    ! paf        18: #define RUN_METHOD_NAME "RUN"
        !            19: #define AUTO_CLASS_NAME "AUTO"
1.23      paf        20: 
1.29    ! paf        21: #define ROOT_CLASS_NAME "ROOT"
        !            22: #define ENV_CLASS_NAME "ENV"
1.7       paf        23: 
                     24: #ifndef NO_STRING_ORIGIN
1.17      paf        25: #      define COMPILE_PARAMS char *source, String *name, char *file
                     26: #      define COMPILE(source, name, file) real_compile(source, name, file)
1.7       paf        27: #else
1.17      paf        28: #      define COMPILE_PARAMS char *source, String *name
                     29: #      define COMPILE(source, name, file) real_compile(source, name)
1.7       paf        30: #endif
1.4       paf        31: 
                     32: class Local_request_exception;
1.1       paf        33: 
1.7       paf        34: class Request : public Pooled {
1.1       paf        35: public:
                     36:        
1.17      paf        37:        Request(Pool& apool);
1.3       paf        38:        ~Request() {}
1.1       paf        39: 
1.7       paf        40:        // global classes
1.6       paf        41:        Hash& classes() { return fclasses; }
1.12      paf        42:        Array& classes_array() { return fclasses_array; }
1.6       paf        43: 
                     44:        // core request processing
                     45:        void core();
1.17      paf        46: 
1.29    ! paf        47:        VClass *use(char *file, String *name, bool fail_on_read_problem=true); // core.C
1.26      paf        48:        Value& autocalc(Value& value, const String *name=0, bool make_string=true); // execute.C
1.28      paf        49: 
                     50:        void write(const String& astring) {
                     51:                wcontext->write(astring, String::Untaint_lang::NO);  // write(const) = clean
                     52:        }
1.22      paf        53: 
1.25      paf        54:        void write(Value& avalue) {
                     55:                // appending possible string, assigning untaint language
                     56:                wcontext->write(avalue, lang); 
1.22      paf        57:        }
                     58: 
1.17      paf        59: public:
1.22      paf        60:        
                     61:        // default base
                     62:        VClass root_class;
1.23      paf        63:        // $ENV:fields here
                     64:        VClass env_class;
1.17      paf        65: 
1.22      paf        66:        // contexts
                     67:        Value *self, *root, *rcontext;
                     68:        WContext *wcontext;
1.6       paf        69: 
1.7       paf        70: private: // core data
1.6       paf        71: 
                     72:        // classes
                     73:        Hash fclasses;
1.12      paf        74:        Array fclasses_array;
1.6       paf        75: 
1.7       paf        76:        // execution stack
                     77:        Stack stack;
                     78: 
                     79: private: // core.C
                     80: 
1.12      paf        81:        char *execute_MAIN();
1.7       paf        82: 
                     83: private: // compile.C
                     84: 
1.12      paf        85:        VClass& real_compile(COMPILE_PARAMS);
1.7       paf        86: 
                     87: private: // execute.C
                     88: 
1.29    ! paf        89:        char *execute_static_method(VClass& vclass, String& method_name, bool return_cstr);
1.11      paf        90:        void execute(const Array& ops);
1.9       paf        91: 
                     92:        Value *get_element();
1.22      paf        93: 
                     94: private: // lang&raw 
                     95:        
                     96:        String::Untaint_lang lang;
                     97: 
                     98: private: // lang&raw manipulation
                     99: 
1.24      paf       100:        // TODO
1.4       paf       101: };
1.1       paf       102: 
                    103: #endif

E-mail: