0
|
1 module dmd.TOK;
|
|
2
|
|
3 version (DMDV2) {
|
|
4 enum TOK
|
|
5 {
|
|
6 TOKreserved,
|
|
7
|
|
8 // Other
|
|
9 TOKlparen, TOKrparen,
|
|
10 TOKlbracket, TOKrbracket,
|
|
11 TOKlcurly, TOKrcurly,
|
|
12 TOKcolon, TOKneg,
|
|
13 TOKsemicolon, TOKdotdotdot,
|
|
14 TOKeof, TOKcast,
|
|
15 TOKnull, TOKassert,
|
|
16 TOKtrue, TOKfalse,
|
|
17 TOKarray, TOKcall,
|
|
18 TOKaddress,
|
|
19 TOKtype, TOKthrow,
|
|
20 TOKnew, TOKdelete,
|
|
21 TOKstar, TOKsymoff,
|
|
22 TOKvar, TOKdotvar,
|
|
23 TOKdotti, TOKdotexp,
|
|
24 TOKdottype, TOKslice,
|
|
25 TOKarraylength, TOKversion,
|
|
26 TOKmodule, TOKdollar,
|
|
27 TOKtemplate, TOKdottd,
|
|
28 TOKdeclaration, TOKtypeof,
|
|
29 TOKpragma, TOKdsymbol,
|
|
30 TOKtypeid, TOKuadd,
|
|
31 TOKremove,
|
|
32 TOKnewanonclass, TOKcomment,
|
|
33 TOKarrayliteral, TOKassocarrayliteral,
|
|
34 TOKstructliteral,
|
|
35
|
|
36 // Operators
|
|
37 TOKlt, TOKgt,
|
|
38 TOKle, TOKge,
|
|
39 TOKequal, TOKnotequal,
|
|
40 TOKidentity, TOKnotidentity,
|
|
41 TOKindex, TOKis,
|
|
42 TOKtobool,
|
|
43
|
|
44 // 60
|
|
45 // NCEG floating point compares
|
|
46 // !<>= <> <>= !> !>= !< !<= !<>
|
|
47 TOKunord,TOKlg,TOKleg,TOKule,TOKul,TOKuge,TOKug,TOKue,
|
|
48
|
|
49 TOKshl, TOKshr,
|
|
50 TOKshlass, TOKshrass,
|
|
51 TOKushr, TOKushrass,
|
|
52 TOKcat, TOKcatass, // ~ ~=
|
|
53 TOKadd, TOKmin, TOKaddass, TOKminass,
|
|
54 TOKmul, TOKdiv, TOKmod,
|
|
55 TOKmulass, TOKdivass, TOKmodass,
|
|
56 TOKand, TOKor, TOKxor,
|
|
57 TOKandass, TOKorass, TOKxorass,
|
|
58 TOKassign, TOKnot, TOKtilde,
|
|
59 TOKplusplus, TOKminusminus, TOKconstruct, TOKblit,
|
|
60 TOKdot, TOKarrow, TOKcomma,
|
|
61 TOKquestion, TOKandand, TOKoror,
|
|
62
|
|
63 // 104
|
|
64 // Numeric literals
|
|
65 TOKint32v, TOKuns32v,
|
|
66 TOKint64v, TOKuns64v,
|
|
67 TOKfloat32v, TOKfloat64v, TOKfloat80v,
|
|
68 TOKimaginary32v, TOKimaginary64v, TOKimaginary80v,
|
|
69
|
|
70 // Char constants
|
|
71 TOKcharv, TOKwcharv, TOKdcharv,
|
|
72
|
|
73 // Leaf operators
|
|
74 TOKidentifier, TOKstring,
|
|
75 TOKthis, TOKsuper,
|
|
76 TOKhalt, TOKtuple,
|
|
77
|
|
78 // Basic types
|
|
79 TOKvoid,
|
|
80 TOKint8, TOKuns8,
|
|
81 TOKint16, TOKuns16,
|
|
82 TOKint32, TOKuns32,
|
|
83 TOKint64, TOKuns64,
|
|
84 TOKfloat32, TOKfloat64, TOKfloat80,
|
|
85 TOKimaginary32, TOKimaginary64, TOKimaginary80,
|
|
86 TOKcomplex32, TOKcomplex64, TOKcomplex80,
|
|
87 TOKchar, TOKwchar, TOKdchar, TOKbit, TOKbool,
|
|
88 TOKcent, TOKucent,
|
|
89
|
|
90 // Aggregates
|
|
91 TOKstruct, TOKclass, TOKinterface, TOKunion, TOKenum, TOKimport,
|
|
92 TOKtypedef, TOKalias, TOKoverride, TOKdelegate, TOKfunction,
|
|
93 TOKmixin,
|
|
94
|
|
95 TOKalign, TOKextern, TOKprivate, TOKprotected, TOKpublic, TOKexport,
|
|
96 TOKstatic, /*TOKvirtual,*/ TOKfinal, TOKconst, TOKabstract, TOKvolatile,
|
|
97 TOKdebug, TOKdeprecated, TOKin, TOKout, TOKinout, TOKlazy,
|
|
98 TOKauto, TOKpackage, TOKmanifest, TOKimmutable,
|
|
99
|
|
100 // Statements
|
|
101 TOKif, TOKelse, TOKwhile, TOKfor, TOKdo, TOKswitch,
|
|
102 TOKcase, TOKdefault, TOKbreak, TOKcontinue, TOKwith,
|
|
103 TOKsynchronized, TOKreturn, TOKgoto, TOKtry, TOKcatch, TOKfinally,
|
|
104 TOKasm, TOKforeach, TOKforeach_reverse,
|
|
105 TOKscope,
|
|
106 TOKon_scope_exit, TOKon_scope_failure, TOKon_scope_success,
|
|
107
|
|
108 // Contracts
|
|
109 TOKbody, TOKinvariant,
|
|
110
|
|
111 // Testing
|
|
112 TOKunittest,
|
|
113
|
|
114 // Added after 1.0
|
|
115 TOKref,
|
|
116 TOKmacro,
|
|
117
|
|
118 TOKtraits,
|
|
119 TOKoverloadset,
|
|
120 TOKpure,
|
|
121 TOKnothrow,
|
|
122 TOKtls,
|
|
123 TOKgshared,
|
|
124 TOKline,
|
|
125 TOKfile,
|
|
126 TOKshared,
|
|
127 TOKat,
|
|
128
|
|
129 TOKMAX
|
|
130 }
|
|
131 } else {
|
|
132 enum TOK
|
|
133 {
|
|
134 TOKreserved,
|
|
135
|
|
136 // Other
|
|
137 TOKlparen, TOKrparen,
|
|
138 TOKlbracket, TOKrbracket,
|
|
139 TOKlcurly, TOKrcurly,
|
|
140 TOKcolon, TOKneg,
|
|
141 TOKsemicolon, TOKdotdotdot,
|
|
142 TOKeof, TOKcast,
|
|
143 TOKnull, TOKassert,
|
|
144 TOKtrue, TOKfalse,
|
|
145 TOKarray, TOKcall,
|
|
146 TOKaddress,
|
|
147 TOKtype, TOKthrow,
|
|
148 TOKnew, TOKdelete,
|
|
149 TOKstar, TOKsymoff,
|
|
150 TOKvar, TOKdotvar,
|
|
151 TOKdotti, TOKdotexp,
|
|
152 TOKdottype, TOKslice,
|
|
153 TOKarraylength, TOKversion,
|
|
154 TOKmodule, TOKdollar,
|
|
155 TOKtemplate, TOKdottd,
|
|
156 TOKdeclaration, TOKtypeof,
|
|
157 TOKpragma, TOKdsymbol,
|
|
158 TOKtypeid, TOKuadd,
|
|
159 TOKremove,
|
|
160 TOKnewanonclass, TOKcomment,
|
|
161 TOKarrayliteral, TOKassocarrayliteral,
|
|
162 TOKstructliteral,
|
|
163
|
|
164 // Operators
|
|
165 TOKlt, TOKgt,
|
|
166 TOKle, TOKge,
|
|
167 TOKequal, TOKnotequal,
|
|
168 TOKidentity, TOKnotidentity,
|
|
169 TOKindex, TOKis,
|
|
170 TOKtobool,
|
|
171
|
|
172 // 60
|
|
173 // NCEG floating point compares
|
|
174 // !<>= <> <>= !> !>= !< !<= !<>
|
|
175 TOKunord,TOKlg,TOKleg,TOKule,TOKul,TOKuge,TOKug,TOKue,
|
|
176
|
|
177 TOKshl, TOKshr,
|
|
178 TOKshlass, TOKshrass,
|
|
179 TOKushr, TOKushrass,
|
|
180 TOKcat, TOKcatass, // ~ ~=
|
|
181 TOKadd, TOKmin, TOKaddass, TOKminass,
|
|
182 TOKmul, TOKdiv, TOKmod,
|
|
183 TOKmulass, TOKdivass, TOKmodass,
|
|
184 TOKand, TOKor, TOKxor,
|
|
185 TOKandass, TOKorass, TOKxorass,
|
|
186 TOKassign, TOKnot, TOKtilde,
|
|
187 TOKplusplus, TOKminusminus, TOKconstruct, TOKblit,
|
|
188 TOKdot, TOKarrow, TOKcomma,
|
|
189 TOKquestion, TOKandand, TOKoror,
|
|
190
|
|
191 // 104
|
|
192 // Numeric literals
|
|
193 TOKint32v, TOKuns32v,
|
|
194 TOKint64v, TOKuns64v,
|
|
195 TOKfloat32v, TOKfloat64v, TOKfloat80v,
|
|
196 TOKimaginary32v, TOKimaginary64v, TOKimaginary80v,
|
|
197
|
|
198 // Char constants
|
|
199 TOKcharv, TOKwcharv, TOKdcharv,
|
|
200
|
|
201 // Leaf operators
|
|
202 TOKidentifier, TOKstring,
|
|
203 TOKthis, TOKsuper,
|
|
204 TOKhalt, TOKtuple,
|
|
205
|
|
206 // Basic types
|
|
207 TOKvoid,
|
|
208 TOKint8, TOKuns8,
|
|
209 TOKint16, TOKuns16,
|
|
210 TOKint32, TOKuns32,
|
|
211 TOKint64, TOKuns64,
|
|
212 TOKfloat32, TOKfloat64, TOKfloat80,
|
|
213 TOKimaginary32, TOKimaginary64, TOKimaginary80,
|
|
214 TOKcomplex32, TOKcomplex64, TOKcomplex80,
|
|
215 TOKchar, TOKwchar, TOKdchar, TOKbit, TOKbool,
|
|
216 TOKcent, TOKucent,
|
|
217
|
|
218 // Aggregates
|
|
219 TOKstruct, TOKclass, TOKinterface, TOKunion, TOKenum, TOKimport,
|
|
220 TOKtypedef, TOKalias, TOKoverride, TOKdelegate, TOKfunction,
|
|
221 TOKmixin,
|
|
222
|
|
223 TOKalign, TOKextern, TOKprivate, TOKprotected, TOKpublic, TOKexport,
|
|
224 TOKstatic, /*TOKvirtual,*/ TOKfinal, TOKconst, TOKabstract, TOKvolatile,
|
|
225 TOKdebug, TOKdeprecated, TOKin, TOKout, TOKinout, TOKlazy,
|
|
226 TOKauto, TOKpackage, TOKmanifest, TOKimmutable,
|
|
227
|
|
228 // Statements
|
|
229 TOKif, TOKelse, TOKwhile, TOKfor, TOKdo, TOKswitch,
|
|
230 TOKcase, TOKdefault, TOKbreak, TOKcontinue, TOKwith,
|
|
231 TOKsynchronized, TOKreturn, TOKgoto, TOKtry, TOKcatch, TOKfinally,
|
|
232 TOKasm, TOKforeach, TOKforeach_reverse,
|
|
233 TOKscope,
|
|
234 TOKon_scope_exit, TOKon_scope_failure, TOKon_scope_success,
|
|
235
|
|
236 // Contracts
|
|
237 TOKbody, TOKinvariant,
|
|
238
|
|
239 // Testing
|
|
240 TOKunittest,
|
|
241
|
|
242 // Added after 1.0
|
|
243 TOKref,
|
|
244 TOKmacro,
|
|
245
|
|
246 TOKMAX
|
|
247 }
|
|
248 }
|
|
249
|
|
250 import dmd.EnumUtils;
|
|
251 mixin(BringToCurrentScope!(TOK)); |