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

1.1       paf         1: /*
1.22    ! paf         2:   $Id: pa_request.h,v 1.21 2001/03/09 04:47:27 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.17      paf        17: #define RUN_NAME "RUN"
                     18: #define ROOT_NAME "ROOT"
1.7       paf        19: 
                     20: #ifndef NO_STRING_ORIGIN
1.17      paf        21: #      define COMPILE_PARAMS char *source, String *name, char *file
                     22: #      define COMPILE(source, name, file) real_compile(source, name, file)
1.7       paf        23: #else
1.17      paf        24: #      define COMPILE_PARAMS char *source, String *name
                     25: #      define COMPILE(source, name, file) real_compile(source, name)
1.7       paf        26: #endif
1.4       paf        27: 
                     28: class Local_request_exception;
1.1       paf        29: 
1.7       paf        30: class Request : public Pooled {
1.1       paf        31: public:
                     32:        
1.17      paf        33:        Request(Pool& apool);
1.3       paf        34:        ~Request() {}
1.1       paf        35: 
1.7       paf        36:        // global classes
1.6       paf        37:        Hash& classes() { return fclasses; }
1.12      paf        38:        Array& classes_array() { return fclasses_array; }
1.6       paf        39: 
                     40:        // core request processing
                     41:        void core();
1.17      paf        42: 
1.22    ! paf        43:        void use(char *file, String *alias); // core.C
        !            44:        Value& autocalc(Value& value, bool make_string=true); // execute.C
        !            45: 
        !            46:        void write(String& astring) {
        !            47:                wcontext->write(astring, lang); // append string, assigning untaint language
        !            48:        }
        !            49: 
1.17      paf        50: public:
1.22    ! paf        51:        
        !            52:        // default base
        !            53:        VClass root_class;
1.17      paf        54: 
1.22    ! paf        55:        // contexts
        !            56:        Value *self, *root, *rcontext;
        !            57:        WContext *wcontext;
1.6       paf        58: 
1.7       paf        59: private: // core data
1.6       paf        60: 
                     61:        // classes
                     62:        Hash fclasses;
1.12      paf        63:        Array fclasses_array;
1.6       paf        64: 
1.7       paf        65:        // execution stack
                     66:        Stack stack;
                     67: 
                     68: private: // core.C
                     69: 
1.12      paf        70:        char *execute_MAIN();
1.7       paf        71: 
                     72: private: // compile.C
                     73: 
1.12      paf        74:        VClass& real_compile(COMPILE_PARAMS);
1.7       paf        75: 
                     76: private: // execute.C
                     77: 
1.11      paf        78:        void execute(const Array& ops);
1.9       paf        79: 
                     80:        Value *get_element();
1.22    ! paf        81: 
        !            82: private: // lang&raw 
        !            83:        
        !            84:        String::Untaint_lang lang;
        !            85: 
        !            86: private: // lang&raw manipulation
        !            87: 
        !            88: 
1.4       paf        89: 
                     90: };
                     91: 
1.7       paf        92: // core func
                     93: void core();
1.1       paf        94: 
                     95: #endif

E-mail: