1 // 2 // The CODE[] table may include the things below, or 3 // ascii characters for simple operators 4 // 5 6 #define THE_END 0 // actually it should be infty.. 7 8 #define CALL_AGAIN 256 9 #define IDENT_DUMMY 257 10 11 // Intermediate reserved 12 #define FCONSTANT 258 13 #define CCONSTANT 259 14 #define CONSTANT 300 15 #define STRING 301 16 #define FORCEERROR 302 17 18 // Special reserved 19 #define CPP_CONCAT 302 20 #define CPP_DIRECTIVE 303 21 #define MEGATOKEN 304 22 #define ANONYMOUS 305 23 24 // C/C++ operators 25 #define DOTSTAR 350 26 #define ELLIPSIS 351 27 #define POINTSAT_STAR 352 28 #define POINTSAT 353 29 #define MINUSMINUS 354 30 #define PLUSPLUS 355 31 #define SCOPE 356 32 #define GEQCMP 357 33 #define LSH 358 34 #define OROR 359 35 #define ANDAND 360 36 #define EQCMP 361 37 #define NEQCMP 362 38 #define RSH 363 39 #define LEQCMP 364 40 // '=' 41 #define ASSIGNA 367 42 #define ASSIGNS 368 43 #define ASSIGNM 369 44 #define ASSIGND 370 45 #define ASSIGNR 371 46 #define ASSIGNBA 372 47 #define ASSIGNBX 373 48 #define ASSIGNBO 374 49 #define ASSIGNRS 375 50 #define ASSIGNLS 376 51 52 // Indexed symbols 53 #define NSTRINGS 100000 54 #define NSYMBOLS 1000000 55 #define BASE 2000 56 #define STRINGBASE BASE 57 58 // bases for multiplexed quantities 59 #define SYMBASE (BASE + NSTRINGS) 60 #define NUMBASE (SYMBASE + NSYMBOLS) 61 #define INT8BASE (NUMBASE) 62 #define INT16BASE (INT8BASE + 1000000) 63 #define INT32BASE (INT8BASE + 2000000) 64 #define UINT32BASE (INT8BASE + 3000000) 65 #define FLOATBASE (INT8BASE + 4000000) 66 #define INUMBER (INT8BASE + 5000000) 67 68 #define ISSTRING(x) (x >= BASE && x < SYMBASE) 69 #define ISSYMBOL(x) (x >= SYMBASE && x < NUMBASE) 70 #define ISNUMBER(x) (x >= NUMBASE) 71 72 // Helper routines 73 #define ISOPERATOR(x) (x <= '~' || x >= DOTSTAR && x <= ASSIGNLS) 74 #define ISASSIGNMENT(x) (x == '=' || x >= ASSIGNA && x <= ASSIGNLS) 75 #define ISRESERVED(x) (x >= RESERVED_auto && x <= RESERVED_END) 76 #define ISDCLFLAG(x) (x >= RESERVED_auto && x <= RESERVED_volatile) 77 #define ISBASETYPE(x) (x >= RESERVED_void && x <= RESERVED_bool) 78 #define ISSTRUCTSPC(x) (x >= RESERVED_class && x <= RESERVED_union) 79 #define ISHBASETYPE(x) (x >= RESERVED_long && x <= RESERVED_unsigned) 80 #define ISDCLSTRT(x) (x >= RESERVED_long && x <= RESERVED_bool) 81 #define SYMBOLID(x) (x - SYMBASE) 82 83 // C and C++ declaration flags 84 #define RESERVED_auto 700 85 #define RESERVED_const 701 86 #define RESERVED_extern 702 87 #define RESERVED_inline 703 88 #define RESERVED___inline__ 703 89 #define RESERVED___inline 703 90 #define RESERVED_register 704 91 #define RESERVED_static 705 92 #define RESERVED_typedef 706 93 #define RESERVED_volatile 707 94 95 // these can define a type 96 #define RESERVED_long 708 97 #define RESERVED_short 709 98 #define RESERVED_signed 710 99 #define RESERVED_unsigned 711 100 101 // C and C++ base types 102 #define RESERVED_void 720 103 #define RESERVED_char 721 104 #define RESERVED_int 722 105 #define RESERVED_float 723 106 #define RESERVED_double 724 107 #define RESERVED_bool 725 108 109 // C and C++ aggregate specifiers 110 #define RESERVED_class 731 111 #define RESERVED_struct 732 112 #define RESERVED_union 733 113 114 // C and C++ reserved words -- not including basic types 115 #define RESERVED_break 741 116 #define RESERVED_case 742 117 #define RESERVED_catch 743 118 #define RESERVED_const_cast 745 119 #define RESERVED_continue 746 120 #define RESERVED_default 747 121 #define RESERVED_delete 748 122 #define RESERVED_do 749 123 #define RESERVED_dynamic_cast 750 124 #define RESERVED_else 751 125 #define RESERVED_enum 752 126 #define RESERVED_explict 753 127 #define RESERVED_export 754 128 #define RESERVED_false 755 // -Dfalse=0 129 #define RESERVED_for 756 130 #define RESERVED_friend 757 131 #define RESERVED_goto 758 132 #define RESERVED_if 759 133 #define RESERVED_mutable 760 134 #define RESERVED_RESERVED 761 135 #define RESERVED_namespace 762 136 #define RESERVED_new 763 137 #define RESERVED_operator 764 138 #define RESERVED_private 765 139 #define RESERVED_protected 766 140 #define RESERVED_public 767 141 #define RESERVED_reinterpret_cast 768 142 #define RESERVED_return 769 143 #define RESERVED_sizeof 770 144 #define RESERVED_static_cast 771 145 #define RESERVED_switch 773 146 #define RESERVED_template 774 147 #define RESERVED_this 775 148 #define RESERVED_throw 776 149 #define RESERVED_true 777 // -Dtrue=1 150 #define RESERVED_try 778 151 #define RESERVED_typeid 779 152 #define RESERVED_typename 780 153 #define RESERVED_using 781 154 #define RESERVED_virtual 782 155 #define RESERVED_while 783 156 #define RESERVED___asm__ 784 157 #ifdef GNU_VIOLATIONS 158 #define RESERVED___typeof__ 800 159 #define RESERVED___label__ 801 160 #define RESERVED__Complex 802 161 #endif 162 #define RESERVED_END 888