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