Mercurial > projects > ddmd
annotate dmd/Global.d @ 168:ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
author | korDen |
---|---|
date | Thu, 30 Sep 2010 12:57:13 +0400 |
parents | 50a6d232176c |
children | e7769d53e750 |
rev | line source |
---|---|
0 | 1 module dmd.Global; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.Array; |
5 import dmd.Param; | |
166
d8565fbd755c
Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents:
138
diff
changeset
|
6 import dmd.ClassDeclaration; |
167
50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents:
166
diff
changeset
|
7 import dmd.DsymbolTable; |
168
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
8 import dmd.StringTable; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
9 import dmd.OutBuffer; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
10 import dmd.Token; |
0 | 11 |
12 class Global | |
13 { | |
14 string mars_ext = "d"; | |
15 string sym_ext = "d"; | |
16 | |
17 version (TARGET_WINDOS) { | |
18 string obj_ext = "obj"; | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
19 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS |
0 | 20 string obj_ext = "o"; |
21 } else version (TARGET_NET) { | |
22 } else { | |
23 static assert (false); | |
24 } | |
25 | |
26 version (TARGET_WINDOS) { | |
27 string lib_ext = "lib"; | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
28 } else version (POSIX) { // TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS |
0 | 29 string lib_ext = "a"; |
30 } else version (TARGET_NET) { | |
31 } else { | |
32 static assert (false); | |
33 } | |
79 | 34 string doc_ext = "html"; // for Ddoc generated files |
35 string ddoc_ext = "ddoc"; // for Ddoc macro include files | |
36 string json_ext = "json"; | |
0 | 37 string hdr_ext = "di"; // for D 'header' import files |
38 string copyright= "Copyright (c) 1999-2009 by Digital Mars"; | |
75
cfa3747ebe4c
Changed dmd to ddmd in the "usage" message and added "ported to D by community" to desription to distinguish from pure dmd build
korDen
parents:
73
diff
changeset
|
39 string written = "written by Walter Bright, ported to D by community"; |
0 | 40 ///version (TARGET_NET) { |
41 /// "\nMSIL back-end (alpha release) by Cristian L. Vlasceanu and associates."; | |
42 ///} | |
43 | |
44 string[] path; // Array of char*'s which form the import lookup path | |
45 string[] filePath; // Array of char*'s which form the file import lookup path | |
46 int structalign = 8; | |
138 | 47 string version_ = "v2.039"; |
0 | 48 |
49 Param params; | |
50 uint errors; // number of errors reported so far | |
51 uint gag; // !=0 means gag reporting of errors | |
52 | |
166
d8565fbd755c
Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents:
138
diff
changeset
|
53 ClassDeclaration object; |
d8565fbd755c
Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents:
138
diff
changeset
|
54 ClassDeclaration classinfo; |
d8565fbd755c
Moved object and classinfo from ClassDeclaration to Global (as part of getting rid of the global state)
korDen
parents:
138
diff
changeset
|
55 |
167
50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents:
166
diff
changeset
|
56 // Used in FuncDeclaration.genCfunc() |
50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents:
166
diff
changeset
|
57 DsymbolTable st; |
50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents:
166
diff
changeset
|
58 |
168
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
59 // Used in Lexer.uniqueId() |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
60 int num; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
61 |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
62 // Used in Identifier.generateId() |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
63 size_t i; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
64 |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
65 // Used in Lexer |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
66 StringTable stringtable; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
67 OutBuffer stringbuffer; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
68 Token* freelist; |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
69 |
0 | 70 this() |
71 { | |
72 params.versionids = new Array(); | |
167
50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
korDen
parents:
166
diff
changeset
|
73 st = new DsymbolTable(); |
168
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
74 stringtable = new StringTable(); |
ceed63f310fb
stringtable, stringbuffer and freelist moved to Global
korDen
parents:
167
diff
changeset
|
75 stringbuffer = new OutBuffer(); |
0 | 76 } |
77 } | |
78 | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
79 Global global; |