Annotation of parser3/src/main/core.C, revision 1.59
1.18 paf 1: /*
1.53 paf 2: Parser
3: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.57 paf 4: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.53 paf 5:
1.59 ! paf 6: $Id: core.C,v 1.58 2001/03/11 12:04:44 paf Exp $
1.18 paf 7: */
8:
1.50 paf 9: #include "core.h"
1.55 paf 10: #include "_string.h"
11: #include "_double.h"
12: #include "_int.h"
1.50 paf 13: #include "pa_request.h"
14:
1.58 paf 15: #define GLOBAL_STRING(name, value) name=new(pool) String(pool); name->APPEND_CONST(value)
16: #define LOCAL_STRING(name, value) String name(pool); name.APPEND_CONST(value)
17:
1.50 paf 18: String *unnamed_name;
19: String *empty_string;
1.52 paf 20:
1.51 paf 21: String *auto_method_name;
22: String *main_method_name;
1.23 paf 23:
1.56 paf 24: String *main_class_name;
1.52 paf 25: String *root_class_name;
26: String *env_class_name;
27:
1.59 ! paf 28: Hash *untaint_lang_name_to_enum;
1.58 paf 29:
30:
1.23 paf 31: void core() {
1.25 paf 32: Pool pool;
1.52 paf 33:
34: // names
1.58 paf 35: GLOBAL_STRING(unnamed_name, "unnamed");
1.50 paf 36: empty_string=new(pool) String(pool);
1.52 paf 37:
1.58 paf 38: GLOBAL_STRING(auto_method_name, AUTO_METHOD_NAME);
39: GLOBAL_STRING(main_method_name, MAIN_METHOD_NAME);
1.52 paf 40:
1.58 paf 41: GLOBAL_STRING(main_class_name, MAIN_CLASS_NAME);
42: GLOBAL_STRING(root_class_name, ROOT_CLASS_NAME);
43: GLOBAL_STRING(env_class_name, ENV_CLASS_NAME);
44:
45: // hashes
1.59 ! paf 46: untaint_lang_name_to_enum=new(pool) Hash(pool);
1.58 paf 47: LOCAL_STRING(as_is, "as-is");
1.59 ! paf 48: untaint_lang_name_to_enum->put(as_is,
1.58 paf 49: static_cast<int>(String::Untaint_lang::AS_IS));
50: LOCAL_STRING(sql, "sql");
1.59 ! paf 51: untaint_lang_name_to_enum->put(sql,
1.58 paf 52: static_cast<int>(String::Untaint_lang::SQL));
53: LOCAL_STRING(js, "js");
1.59 ! paf 54: untaint_lang_name_to_enum->put(js,
1.58 paf 55: static_cast<int>(String::Untaint_lang::JS));
56: LOCAL_STRING(html, "html");
1.59 ! paf 57: untaint_lang_name_to_enum->put(html,
1.58 paf 58: static_cast<int>(String::Untaint_lang::HTML));
59: LOCAL_STRING(html_typo, "html-typo");
1.59 ! paf 60: untaint_lang_name_to_enum->put(html_typo,
1.58 paf 61: static_cast<int>(String::Untaint_lang::HTML_TYPO));
1.50 paf 62:
1.52 paf 63: // classes
1.48 paf 64: initialize_string_class(pool, *(string_class=new(pool) VClass(pool)));
65: initialize_double_class(pool, *(double_class=new(pool) VClass(pool)));
66: initialize_int_class(pool, *(int_class=new(pool) VClass(pool)));
1.52 paf 67:
68: // request
1.24 paf 69: Request request(pool);
70: request.core();
1.23 paf 71: }
72:
E-mail: