Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: frog/token_kind.g.dart

Issue 8457007: Better runtime type checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged, and fix typo in member name Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Generated by scripts/token_kind_gen.py. 4 // Generated by scripts/token_kind_gen.py.
5 5
6 class TokenKind { 6 class TokenKind {
7 /** [TokenKind] representing end of file tokens. */ 7 /** [TokenKind] representing end of file tokens. */
8 static final int END_OF_FILE = 1; 8 static final int END_OF_FILE = 1;
9 9
10 /** [TokenKind] representing ( tokens. */ 10 /** [TokenKind] representing ( tokens. */
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 /** [TokenKind] representing []= tokens. */ 175 /** [TokenKind] representing []= tokens. */
176 static final int SETINDEX = 57; 176 static final int SETINDEX = 57;
177 177
178 /** [TokenKind] representing string tokens. */ 178 /** [TokenKind] representing string tokens. */
179 static final int STRING = 58; 179 static final int STRING = 58;
180 180
181 /** [TokenKind] representing string part tokens. */ 181 /** [TokenKind] representing string part tokens. */
182 static final int STRING_PART = 59; 182 static final int STRING_PART = 59;
183 183
184 /** [TokenKind] representing number tokens. */ 184 /** [TokenKind] representing integer tokens. */
185 static final int NUMBER = 60; 185 static final int INTEGER = 60;
186 186
187 /** [TokenKind] representing hex number tokens. */ 187 /** [TokenKind] representing hex integer tokens. */
188 static final int HEX_NUMBER = 61; 188 static final int HEX_INTEGER = 61;
189
190 /** [TokenKind] representing double tokens. */
191 static final int DOUBLE = 62;
189 192
190 /** [TokenKind] representing whitespace tokens. */ 193 /** [TokenKind] representing whitespace tokens. */
191 static final int WHITESPACE = 62; 194 static final int WHITESPACE = 63;
192 195
193 /** [TokenKind] representing comment tokens. */ 196 /** [TokenKind] representing comment tokens. */
194 static final int COMMENT = 63; 197 static final int COMMENT = 64;
195 198
196 /** [TokenKind] representing error tokens. */ 199 /** [TokenKind] representing error tokens. */
197 static final int ERROR = 64; 200 static final int ERROR = 65;
198 201
199 /** [TokenKind] representing incomplete string tokens. */ 202 /** [TokenKind] representing incomplete string tokens. */
200 static final int INCOMPLETE_STRING = 65; 203 static final int INCOMPLETE_STRING = 66;
201 204
202 /** [TokenKind] representing incomplete comment tokens. */ 205 /** [TokenKind] representing incomplete comment tokens. */
203 static final int INCOMPLETE_COMMENT = 66; 206 static final int INCOMPLETE_COMMENT = 67;
204 207
205 /** [TokenKind] representing incomplete multiline string dq tokens. */ 208 /** [TokenKind] representing incomplete multiline string dq tokens. */
206 static final int INCOMPLETE_MULTILINE_STRING_DQ = 67; 209 static final int INCOMPLETE_MULTILINE_STRING_DQ = 68;
207 210
208 /** [TokenKind] representing incomplete multiline string sq tokens. */ 211 /** [TokenKind] representing incomplete multiline string sq tokens. */
209 static final int INCOMPLETE_MULTILINE_STRING_SQ = 68; 212 static final int INCOMPLETE_MULTILINE_STRING_SQ = 69;
210 213
211 /** [TokenKind] representing identifier tokens. */ 214 /** [TokenKind] representing identifier tokens. */
212 static final int IDENTIFIER = 69; 215 static final int IDENTIFIER = 70;
213 216
214 /** [TokenKind] representing pseudo-keyword 'abstract' tokens. */ 217 /** [TokenKind] representing pseudo-keyword 'abstract' tokens. */
215 static final int ABSTRACT = 70; 218 static final int ABSTRACT = 71;
216 219
217 /** [TokenKind] representing pseudo-keyword 'assert' tokens. */ 220 /** [TokenKind] representing pseudo-keyword 'assert' tokens. */
218 static final int ASSERT = 71; 221 static final int ASSERT = 72;
219 222
220 /** [TokenKind] representing pseudo-keyword 'class' tokens. */ 223 /** [TokenKind] representing pseudo-keyword 'class' tokens. */
221 static final int CLASS = 72; 224 static final int CLASS = 73;
222 225
223 /** [TokenKind] representing pseudo-keyword 'extends' tokens. */ 226 /** [TokenKind] representing pseudo-keyword 'extends' tokens. */
224 static final int EXTENDS = 73; 227 static final int EXTENDS = 74;
225 228
226 /** [TokenKind] representing pseudo-keyword 'factory' tokens. */ 229 /** [TokenKind] representing pseudo-keyword 'factory' tokens. */
227 static final int FACTORY = 74; 230 static final int FACTORY = 75;
228 231
229 /** [TokenKind] representing pseudo-keyword 'get' tokens. */ 232 /** [TokenKind] representing pseudo-keyword 'get' tokens. */
230 static final int GET = 75; 233 static final int GET = 76;
231 234
232 /** [TokenKind] representing pseudo-keyword 'implements' tokens. */ 235 /** [TokenKind] representing pseudo-keyword 'implements' tokens. */
233 static final int IMPLEMENTS = 76; 236 static final int IMPLEMENTS = 77;
234 237
235 /** [TokenKind] representing pseudo-keyword 'import' tokens. */ 238 /** [TokenKind] representing pseudo-keyword 'import' tokens. */
236 static final int IMPORT = 77; 239 static final int IMPORT = 78;
237 240
238 /** [TokenKind] representing pseudo-keyword 'interface' tokens. */ 241 /** [TokenKind] representing pseudo-keyword 'interface' tokens. */
239 static final int INTERFACE = 78; 242 static final int INTERFACE = 79;
240 243
241 /** [TokenKind] representing pseudo-keyword 'library' tokens. */ 244 /** [TokenKind] representing pseudo-keyword 'library' tokens. */
242 static final int LIBRARY = 79; 245 static final int LIBRARY = 80;
243 246
244 /** [TokenKind] representing pseudo-keyword 'native' tokens. */ 247 /** [TokenKind] representing pseudo-keyword 'native' tokens. */
245 static final int NATIVE = 80; 248 static final int NATIVE = 81;
246 249
247 /** [TokenKind] representing pseudo-keyword 'negate' tokens. */ 250 /** [TokenKind] representing pseudo-keyword 'negate' tokens. */
248 static final int NEGATE = 81; 251 static final int NEGATE = 82;
249 252
250 /** [TokenKind] representing pseudo-keyword 'operator' tokens. */ 253 /** [TokenKind] representing pseudo-keyword 'operator' tokens. */
251 static final int OPERATOR = 82; 254 static final int OPERATOR = 83;
252 255
253 /** [TokenKind] representing pseudo-keyword 'set' tokens. */ 256 /** [TokenKind] representing pseudo-keyword 'set' tokens. */
254 static final int SET = 83; 257 static final int SET = 84;
255 258
256 /** [TokenKind] representing pseudo-keyword 'source' tokens. */ 259 /** [TokenKind] representing pseudo-keyword 'source' tokens. */
257 static final int SOURCE = 84; 260 static final int SOURCE = 85;
258 261
259 /** [TokenKind] representing pseudo-keyword 'static' tokens. */ 262 /** [TokenKind] representing pseudo-keyword 'static' tokens. */
260 static final int STATIC = 85; 263 static final int STATIC = 86;
261 264
262 /** [TokenKind] representing pseudo-keyword 'typedef' tokens. */ 265 /** [TokenKind] representing pseudo-keyword 'typedef' tokens. */
263 static final int TYPEDEF = 86; 266 static final int TYPEDEF = 87;
264 267
265 /** [TokenKind] representing keyword 'break' tokens. */ 268 /** [TokenKind] representing keyword 'break' tokens. */
266 static final int BREAK = 87; 269 static final int BREAK = 88;
267 270
268 /** [TokenKind] representing keyword 'case' tokens. */ 271 /** [TokenKind] representing keyword 'case' tokens. */
269 static final int CASE = 88; 272 static final int CASE = 89;
270 273
271 /** [TokenKind] representing keyword 'catch' tokens. */ 274 /** [TokenKind] representing keyword 'catch' tokens. */
272 static final int CATCH = 89; 275 static final int CATCH = 90;
273 276
274 /** [TokenKind] representing keyword 'const' tokens. */ 277 /** [TokenKind] representing keyword 'const' tokens. */
275 static final int CONST = 90; 278 static final int CONST = 91;
276 279
277 /** [TokenKind] representing keyword 'continue' tokens. */ 280 /** [TokenKind] representing keyword 'continue' tokens. */
278 static final int CONTINUE = 91; 281 static final int CONTINUE = 92;
279 282
280 /** [TokenKind] representing keyword 'default' tokens. */ 283 /** [TokenKind] representing keyword 'default' tokens. */
281 static final int DEFAULT = 92; 284 static final int DEFAULT = 93;
282 285
283 /** [TokenKind] representing keyword 'do' tokens. */ 286 /** [TokenKind] representing keyword 'do' tokens. */
284 static final int DO = 93; 287 static final int DO = 94;
285 288
286 /** [TokenKind] representing keyword 'else' tokens. */ 289 /** [TokenKind] representing keyword 'else' tokens. */
287 static final int ELSE = 94; 290 static final int ELSE = 95;
288 291
289 /** [TokenKind] representing keyword 'false' tokens. */ 292 /** [TokenKind] representing keyword 'false' tokens. */
290 static final int FALSE = 95; 293 static final int FALSE = 96;
291 294
292 /** [TokenKind] representing keyword 'final' tokens. */ 295 /** [TokenKind] representing keyword 'final' tokens. */
293 static final int FINAL = 96; 296 static final int FINAL = 97;
294 297
295 /** [TokenKind] representing keyword 'finally' tokens. */ 298 /** [TokenKind] representing keyword 'finally' tokens. */
296 static final int FINALLY = 97; 299 static final int FINALLY = 98;
297 300
298 /** [TokenKind] representing keyword 'for' tokens. */ 301 /** [TokenKind] representing keyword 'for' tokens. */
299 static final int FOR = 98; 302 static final int FOR = 99;
300 303
301 /** [TokenKind] representing keyword 'if' tokens. */ 304 /** [TokenKind] representing keyword 'if' tokens. */
302 static final int IF = 99; 305 static final int IF = 100;
303 306
304 /** [TokenKind] representing keyword 'in' tokens. */ 307 /** [TokenKind] representing keyword 'in' tokens. */
305 static final int IN = 100; 308 static final int IN = 101;
306 309
307 /** [TokenKind] representing keyword 'is' tokens. */ 310 /** [TokenKind] representing keyword 'is' tokens. */
308 static final int IS = 101; 311 static final int IS = 102;
309 312
310 /** [TokenKind] representing keyword 'new' tokens. */ 313 /** [TokenKind] representing keyword 'new' tokens. */
311 static final int NEW = 102; 314 static final int NEW = 103;
312 315
313 /** [TokenKind] representing keyword 'null' tokens. */ 316 /** [TokenKind] representing keyword 'null' tokens. */
314 static final int NULL = 103; 317 static final int NULL = 104;
315 318
316 /** [TokenKind] representing keyword 'return' tokens. */ 319 /** [TokenKind] representing keyword 'return' tokens. */
317 static final int RETURN = 104; 320 static final int RETURN = 105;
318 321
319 /** [TokenKind] representing keyword 'super' tokens. */ 322 /** [TokenKind] representing keyword 'super' tokens. */
320 static final int SUPER = 105; 323 static final int SUPER = 106;
321 324
322 /** [TokenKind] representing keyword 'switch' tokens. */ 325 /** [TokenKind] representing keyword 'switch' tokens. */
323 static final int SWITCH = 106; 326 static final int SWITCH = 107;
324 327
325 /** [TokenKind] representing keyword 'this' tokens. */ 328 /** [TokenKind] representing keyword 'this' tokens. */
326 static final int THIS = 107; 329 static final int THIS = 108;
327 330
328 /** [TokenKind] representing keyword 'throw' tokens. */ 331 /** [TokenKind] representing keyword 'throw' tokens. */
329 static final int THROW = 108; 332 static final int THROW = 109;
330 333
331 /** [TokenKind] representing keyword 'true' tokens. */ 334 /** [TokenKind] representing keyword 'true' tokens. */
332 static final int TRUE = 109; 335 static final int TRUE = 110;
333 336
334 /** [TokenKind] representing keyword 'try' tokens. */ 337 /** [TokenKind] representing keyword 'try' tokens. */
335 static final int TRY = 110; 338 static final int TRY = 111;
336 339
337 /** [TokenKind] representing keyword 'var' tokens. */ 340 /** [TokenKind] representing keyword 'var' tokens. */
338 static final int VAR = 111; 341 static final int VAR = 112;
339 342
340 /** [TokenKind] representing keyword 'void' tokens. */ 343 /** [TokenKind] representing keyword 'void' tokens. */
341 static final int VOID = 112; 344 static final int VOID = 113;
342 345
343 /** [TokenKind] representing keyword 'while' tokens. */ 346 /** [TokenKind] representing keyword 'while' tokens. */
344 static final int WHILE = 113; 347 static final int WHILE = 114;
345 348
346 static String kindToString(int kind) { 349 static String kindToString(int kind) {
347 switch(kind) { 350 switch(kind) {
348 case TokenKind.END_OF_FILE: return "end of file"; 351 case TokenKind.END_OF_FILE: return "end of file";
349 case TokenKind.LPAREN: return "("; 352 case TokenKind.LPAREN: return "(";
350 case TokenKind.RPAREN: return ")"; 353 case TokenKind.RPAREN: return ")";
351 case TokenKind.LBRACK: return "["; 354 case TokenKind.LBRACK: return "[";
352 case TokenKind.RBRACK: return "]"; 355 case TokenKind.RBRACK: return "]";
353 case TokenKind.LBRACE: return "{"; 356 case TokenKind.LBRACE: return "{";
354 case TokenKind.RBRACE: return "}"; 357 case TokenKind.RBRACE: return "}";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 case TokenKind.EQ_STRICT: return "==="; 400 case TokenKind.EQ_STRICT: return "===";
398 case TokenKind.NE_STRICT: return "!=="; 401 case TokenKind.NE_STRICT: return "!==";
399 case TokenKind.LT: return "<"; 402 case TokenKind.LT: return "<";
400 case TokenKind.GT: return ">"; 403 case TokenKind.GT: return ">";
401 case TokenKind.LTE: return "<="; 404 case TokenKind.LTE: return "<=";
402 case TokenKind.GTE: return ">="; 405 case TokenKind.GTE: return ">=";
403 case TokenKind.INDEX: return "[]"; 406 case TokenKind.INDEX: return "[]";
404 case TokenKind.SETINDEX: return "[]="; 407 case TokenKind.SETINDEX: return "[]=";
405 case TokenKind.STRING: return "string"; 408 case TokenKind.STRING: return "string";
406 case TokenKind.STRING_PART: return "string part"; 409 case TokenKind.STRING_PART: return "string part";
407 case TokenKind.NUMBER: return "number"; 410 case TokenKind.INTEGER: return "integer";
408 case TokenKind.HEX_NUMBER: return "hex number"; 411 case TokenKind.HEX_INTEGER: return "hex integer";
412 case TokenKind.DOUBLE: return "double";
409 case TokenKind.WHITESPACE: return "whitespace"; 413 case TokenKind.WHITESPACE: return "whitespace";
410 case TokenKind.COMMENT: return "comment"; 414 case TokenKind.COMMENT: return "comment";
411 case TokenKind.ERROR: return "error"; 415 case TokenKind.ERROR: return "error";
412 case TokenKind.INCOMPLETE_STRING: return "incomplete string"; 416 case TokenKind.INCOMPLETE_STRING: return "incomplete string";
413 case TokenKind.INCOMPLETE_COMMENT: return "incomplete comment"; 417 case TokenKind.INCOMPLETE_COMMENT: return "incomplete comment";
414 case TokenKind.INCOMPLETE_MULTILINE_STRING_DQ: return "incomplete multilin e string dq"; 418 case TokenKind.INCOMPLETE_MULTILINE_STRING_DQ: return "incomplete multilin e string dq";
415 case TokenKind.INCOMPLETE_MULTILINE_STRING_SQ: return "incomplete multilin e string sq"; 419 case TokenKind.INCOMPLETE_MULTILINE_STRING_SQ: return "incomplete multilin e string sq";
416 case TokenKind.IDENTIFIER: return "identifier"; 420 case TokenKind.IDENTIFIER: return "identifier";
417 case TokenKind.ABSTRACT: return "pseudo-keyword 'abstract'"; 421 case TokenKind.ABSTRACT: return "pseudo-keyword 'abstract'";
418 case TokenKind.ASSERT: return "pseudo-keyword 'assert'"; 422 case TokenKind.ASSERT: return "pseudo-keyword 'assert'";
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 } 568 }
565 569
566 static int kindFromAssign(int kind) { 570 static int kindFromAssign(int kind) {
567 if (kind == ASSIGN) return 0; 571 if (kind == ASSIGN) return 0;
568 if (kind > ASSIGN && kind <= ASSIGN_MOD) { 572 if (kind > ASSIGN && kind <= ASSIGN_MOD) {
569 return kind + (ADD - ASSIGN_ADD); 573 return kind + (ADD - ASSIGN_ADD);
570 } 574 }
571 return -1; 575 return -1;
572 } 576 }
573 } 577 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698