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