Mercurial > projects > ddmd
comparison dmd/Global.d @ 173:d237b38b5858
Small changes
author | korDen |
---|---|
date | Sun, 10 Oct 2010 01:55:35 +0400 |
parents | 96c0fff6897d |
children | af724d3510d7 |
comparison
equal
deleted
inserted
replaced
172:5a9a88e919f9 | 173:d237b38b5858 |
---|---|
20 | 20 |
21 class Global | 21 class Global |
22 { | 22 { |
23 string mars_ext = "d"; | 23 string mars_ext = "d"; |
24 string sym_ext = "d"; | 24 string sym_ext = "d"; |
25 | 25 |
26 version (TARGET_WINDOS) { | 26 version (TARGET_WINDOS) { |
27 string obj_ext = "obj"; | 27 string obj_ext = "obj"; |
28 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS | 28 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS |
29 string obj_ext = "o"; | 29 string obj_ext = "o"; |
30 } else version (TARGET_NET) { | 30 } else version (TARGET_NET) { |
47 string copyright= "Copyright (c) 1999-2009 by Digital Mars"; | 47 string copyright= "Copyright (c) 1999-2009 by Digital Mars"; |
48 string written = "written by Walter Bright, ported to D by community"; | 48 string written = "written by Walter Bright, ported to D by community"; |
49 ///version (TARGET_NET) { | 49 ///version (TARGET_NET) { |
50 /// "\nMSIL back-end (alpha release) by Cristian L. Vlasceanu and associates."; | 50 /// "\nMSIL back-end (alpha release) by Cristian L. Vlasceanu and associates."; |
51 ///} | 51 ///} |
52 | 52 |
53 string[] path; // Array of char*'s which form the import lookup path | 53 string[] path; // Array of char*'s which form the import lookup path |
54 string[] filePath; // Array of char*'s which form the file import lookup path | 54 string[] filePath; // Array of char*'s which form the file import lookup path |
55 int structalign = 8; | 55 int structalign = 8; |
56 string version_ = "v2.039"; | 56 string version_ = "v2.039"; |
57 | 57 |
58 Param params; | 58 Param params; |
59 uint errors; // number of errors reported so far | 59 uint errors; // number of errors reported so far |
60 uint gag; // !=0 means gag reporting of errors | 60 uint gag; // !=0 means gag reporting of errors |
61 | 61 |
62 ClassDeclaration object; | 62 ClassDeclaration object; |
63 ClassDeclaration classinfo; | 63 ClassDeclaration classinfo; |
64 | 64 |
65 // Used in FuncDeclaration.genCfunc() | 65 // Used in FuncDeclaration.genCfunc() |
66 DsymbolTable st; | 66 DsymbolTable st; |
67 | 67 |
68 // Used in Lexer.uniqueId() | 68 // Used in Lexer.uniqueId() |
69 int num; | 69 int num; |
70 | 70 |
71 // Used in Identifier.generateId() | 71 // Used in Identifier.generateId() |
72 size_t i; | 72 size_t i; |
73 | 73 |
74 // Used in Lexer | 74 // Used in Lexer |
75 StringTable stringtable; | 75 StringTable stringtable; |
76 OutBuffer stringbuffer; | 76 OutBuffer stringbuffer; |
77 Token* freelist; | 77 Token* freelist; |
78 | 78 |
79 char date[11+1]; | 79 char date[11+1]; |
80 char time[8+1]; | 80 char time[8+1]; |
81 char timestamp[24+1]; | 81 char timestamp[24+1]; |
82 | 82 |
83 // Used in Module | 83 // Used in Module |
84 Module rootModule; | 84 Module rootModule; |
85 DsymbolTable modules; // symbol table of all modules | 85 DsymbolTable modules; // symbol table of all modules |
86 Array amodules; // array of all modules | 86 Array amodules; // array of all modules |
87 Array deferred; // deferred Dsymbol's needing semantic() run on them | 87 Array deferred; // deferred Dsymbol's needing semantic() run on them |
88 uint dprogress; // progress resolving the deferred list | 88 uint dprogress; // progress resolving the deferred list |
89 int nested; | 89 int nested; |
90 Classsym* scc; | 90 Classsym* scc; |
91 ClassDeclaration moduleinfo; | 91 ClassDeclaration moduleinfo; |
92 | 92 |
93 // Used in PowExp | 93 // Used in PowExp |
94 bool importMathChecked = false; | 94 bool importMathChecked = false; |
95 | 95 |
96 // Used in Scope | 96 // Used in Scope |
97 Scope scope_freelist; | 97 Scope scope_freelist; |
98 | 98 |
99 // Used in TemplateMixin | 99 // Used in TemplateMixin |
100 int nest; | 100 int nest; |
101 | 101 |
102 this() | 102 this() |
103 { | 103 { |
104 params.versionids = new Array(); | 104 params.versionids = new Array(); |
105 params.imppath = new Array(); | |
106 | |
105 st = new DsymbolTable(); | 107 st = new DsymbolTable(); |
106 stringtable = new StringTable(); | 108 stringtable = new StringTable(); |
107 stringbuffer = new OutBuffer(); | 109 stringbuffer = new OutBuffer(); |
108 | 110 |
109 modules = new DsymbolTable(); | 111 modules = new DsymbolTable(); |
110 amodules = new Array(); | 112 amodules = new Array(); |
111 deferred = new Array(); | 113 deferred = new Array(); |
112 | 114 |
113 init_time(); | 115 init_time(); |
114 } | 116 } |
115 | 117 |
116 void initClasssym() | 118 void initClasssym() |
117 { | 119 { |
118 scc = fake_classsym(Id.ClassInfo); | 120 scc = fake_classsym(Id.ClassInfo); |
119 } | 121 } |
120 | 122 |
121 void init_time() | 123 void init_time() |
122 { | 124 { |
123 time_t tm; | 125 time_t tm; |
124 char* p; | 126 char* p; |
125 | 127 |
130 sprintf(time.ptr, "%.8s", p + 11); | 132 sprintf(time.ptr, "%.8s", p + 11); |
131 sprintf(timestamp.ptr, "%.24s", p); | 133 sprintf(timestamp.ptr, "%.24s", p); |
132 } | 134 } |
133 } | 135 } |
134 | 136 |
135 Global global; | 137 __gshared Global global; |