| OLD | NEW |
| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 case GT: return 10; | 512 case GT: return 10; |
| 513 case LTE: return 10; | 513 case LTE: return 10; |
| 514 case GTE: return 10; | 514 case GTE: return 10; |
| 515 case IS: return 10; | 515 case IS: return 10; |
| 516 default: return -1; | 516 default: return -1; |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 static String rawOperatorFromMethod(String name) { | 520 static String rawOperatorFromMethod(String name) { |
| 521 switch(name) { | 521 switch(name) { |
| 522 case '\$bit_not': return '~'; | 522 case ':bit_not': return '~'; |
| 523 case '\$bit_or': return '|'; | 523 case ':bit_or': return '|'; |
| 524 case '\$bit_xor': return '^'; | 524 case ':bit_xor': return '^'; |
| 525 case '\$bit_and': return '&'; | 525 case ':bit_and': return '&'; |
| 526 case '\$shl': return '<<'; | 526 case ':shl': return '<<'; |
| 527 case '\$sar': return '>>'; | 527 case ':sar': return '>>'; |
| 528 case '\$shr': return '>>>'; | 528 case ':shr': return '>>>'; |
| 529 case '\$add': return '+'; | 529 case ':add': return '+'; |
| 530 case '\$sub': return '-'; | 530 case ':sub': return '-'; |
| 531 case '\$mul': return '*'; | 531 case ':mul': return '*'; |
| 532 case '\$div': return '/'; | 532 case ':div': return '/'; |
| 533 case '\$truncdiv': return '~/'; | 533 case ':truncdiv': return '~/'; |
| 534 case '\$mod': return '%'; | 534 case ':mod': return '%'; |
| 535 case '\$eq': return '=='; | 535 case ':eq': return '=='; |
| 536 case '\$lt': return '<'; | 536 case ':lt': return '<'; |
| 537 case '\$gt': return '>'; | 537 case ':gt': return '>'; |
| 538 case '\$lte': return '<='; | 538 case ':lte': return '<='; |
| 539 case '\$gte': return '>='; | 539 case ':gte': return '>='; |
| 540 case '\$index': return '[]'; | 540 case ':index': return '[]'; |
| 541 case '\$setindex': return '[]='; | 541 case ':setindex': return '[]='; |
| 542 case '\$ne': return '!='; | 542 case ':ne': return '!='; |
| 543 } | 543 } |
| 544 } | 544 } |
| 545 | 545 |
| 546 static String binaryMethodName(int kind) { | 546 static String binaryMethodName(int kind) { |
| 547 switch(kind) { | 547 switch(kind) { |
| 548 case BIT_NOT: return '\$bit_not'; | 548 case BIT_NOT: return ':bit_not'; |
| 549 case BIT_OR: return '\$bit_or'; | 549 case BIT_OR: return ':bit_or'; |
| 550 case BIT_XOR: return '\$bit_xor'; | 550 case BIT_XOR: return ':bit_xor'; |
| 551 case BIT_AND: return '\$bit_and'; | 551 case BIT_AND: return ':bit_and'; |
| 552 case SHL: return '\$shl'; | 552 case SHL: return ':shl'; |
| 553 case SAR: return '\$sar'; | 553 case SAR: return ':sar'; |
| 554 case SHR: return '\$shr'; | 554 case SHR: return ':shr'; |
| 555 case ADD: return '\$add'; | 555 case ADD: return ':add'; |
| 556 case SUB: return '\$sub'; | 556 case SUB: return ':sub'; |
| 557 case MUL: return '\$mul'; | 557 case MUL: return ':mul'; |
| 558 case DIV: return '\$div'; | 558 case DIV: return ':div'; |
| 559 case TRUNCDIV: return '\$truncdiv'; | 559 case TRUNCDIV: return ':truncdiv'; |
| 560 case MOD: return '\$mod'; | 560 case MOD: return ':mod'; |
| 561 case EQ: return '\$eq'; | 561 case EQ: return ':eq'; |
| 562 case LT: return '\$lt'; | 562 case LT: return ':lt'; |
| 563 case GT: return '\$gt'; | 563 case GT: return ':gt'; |
| 564 case LTE: return '\$lte'; | 564 case LTE: return ':lte'; |
| 565 case GTE: return '\$gte'; | 565 case GTE: return ':gte'; |
| 566 case INDEX: return '\$index'; | 566 case INDEX: return ':index'; |
| 567 case SETINDEX: return '\$setindex'; | 567 case SETINDEX: return ':setindex'; |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 static String unaryMethodName(int kind) { | 571 static String unaryMethodName(int kind) { |
| 572 } | 572 } |
| 573 | 573 |
| 574 static int kindFromAssign(int kind) { | 574 static int kindFromAssign(int kind) { |
| 575 if (kind == ASSIGN) return 0; | 575 if (kind == ASSIGN) return 0; |
| 576 if (kind > ASSIGN && kind <= ASSIGN_MOD) { | 576 if (kind > ASSIGN && kind <= ASSIGN_MOD) { |
| 577 return kind + (ADD - ASSIGN_ADD); | 577 return kind + (ADD - ASSIGN_ADD); |
| 578 } | 578 } |
| 579 return -1; | 579 return -1; |
| 580 } | 580 } |
| 581 } | 581 } |
| OLD | NEW |