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