Annotation of parser3/src/main/core.C, revision 1.60
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.60 ! paf 6: $Id: core.C,v 1.59 2001/03/11 12:10:43 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.60 ! paf 13: #include "_table.h"
1.50 paf 14: #include "pa_request.h"
15:
1.58 paf 16: #define GLOBAL_STRING(name, value) name=new(pool) String(pool); name->APPEND_CONST(value)
17: #define LOCAL_STRING(name, value) String name(pool); name.APPEND_CONST(value)
18:
1.50 paf 19: String *unnamed_name;
20: String *empty_string;
1.52 paf 21:
1.51 paf 22: String *auto_method_name;
23: String *main_method_name;
1.23 paf 24:
1.56 paf 25: String *main_class_name;
1.52 paf 26: String *root_class_name;
27: String *env_class_name;
1.60 ! paf 28: String *table_class_name;
1.52 paf 29:
1.60 ! paf 30: Hash *untaint_lang_name2enum;
1.58 paf 31:
32:
1.23 paf 33: void core() {
1.25 paf 34: Pool pool;
1.52 paf 35:
36: // names
1.58 paf 37: GLOBAL_STRING(unnamed_name, "unnamed");
1.50 paf 38: empty_string=new(pool) String(pool);
1.52 paf 39:
1.58 paf 40: GLOBAL_STRING(auto_method_name, AUTO_METHOD_NAME);
41: GLOBAL_STRING(main_method_name, MAIN_METHOD_NAME);
1.52 paf 42:
1.58 paf 43: GLOBAL_STRING(main_class_name, MAIN_CLASS_NAME);
44: GLOBAL_STRING(root_class_name, ROOT_CLASS_NAME);
45: GLOBAL_STRING(env_class_name, ENV_CLASS_NAME);
1.60 ! paf 46: GLOBAL_STRING(table_class_name, TABLE_CLASS_NAME);
1.58 paf 47:
48: // hashes
1.60 ! paf 49: untaint_lang_name2enum=new(pool) Hash(pool);
1.58 paf 50: LOCAL_STRING(as_is, "as-is");
1.60 ! paf 51: untaint_lang_name2enum->put(as_is,
1.58 paf 52: static_cast<int>(String::Untaint_lang::AS_IS));
53: LOCAL_STRING(sql, "sql");
1.60 ! paf 54: untaint_lang_name2enum->put(sql,
1.58 paf 55: static_cast<int>(String::Untaint_lang::SQL));
56: LOCAL_STRING(js, "js");
1.60 ! paf 57: untaint_lang_name2enum->put(js,
1.58 paf 58: static_cast<int>(String::Untaint_lang::JS));
59: LOCAL_STRING(html, "html");
1.60 ! paf 60: untaint_lang_name2enum->put(html,
1.58 paf 61: static_cast<int>(String::Untaint_lang::HTML));
62: LOCAL_STRING(html_typo, "html-typo");
1.60 ! paf 63: untaint_lang_name2enum->put(html_typo,
1.58 paf 64: static_cast<int>(String::Untaint_lang::HTML_TYPO));
1.50 paf 65:
1.60 ! paf 66: // read-only classes
! 67: initialize_string_class(pool, *(string_class=new(pool) VClass(pool))); string_class->freeze();
! 68: initialize_double_class(pool, *(double_class=new(pool) VClass(pool))); double_class->freeze();
! 69: initialize_int_class(pool, *(int_class=new(pool) VClass(pool))); int_class->freeze();
! 70: initialize_table_class(pool, *(table_class=new(pool) VClass(pool))); table_class->freeze();
1.52 paf 71:
72: // request
1.24 paf 73: Request request(pool);
74: request.core();
1.23 paf 75: }
76:
E-mail: