Annotation of parser3/src/main/core.C, revision 1.58
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.58 ! paf 6: $Id: core.C,v 1.57 2001/03/11 08:16:34 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.58 ! paf 28: Hash *untaint_lang_name_to_value;
! 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
! 46: untaint_lang_name_to_value=new(pool) Hash(pool);
! 47: LOCAL_STRING(as_is, "as-is");
! 48: untaint_lang_name_to_value->put(as_is,
! 49: static_cast<int>(String::Untaint_lang::AS_IS));
! 50: LOCAL_STRING(sql, "sql");
! 51: untaint_lang_name_to_value->put(sql,
! 52: static_cast<int>(String::Untaint_lang::SQL));
! 53: LOCAL_STRING(js, "js");
! 54: untaint_lang_name_to_value->put(js,
! 55: static_cast<int>(String::Untaint_lang::JS));
! 56: LOCAL_STRING(html, "html");
! 57: untaint_lang_name_to_value->put(html,
! 58: static_cast<int>(String::Untaint_lang::HTML));
! 59: LOCAL_STRING(html_typo, "html-typo");
! 60: untaint_lang_name_to_value->put(html_typo,
! 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: