Slightly simplify token declarations.
[cparser] / tokens.inc
1 #ifndef TS
2 #define TS(x,str,val)
3 #endif
4
5 TS(IDENTIFIER,              "identifier", = 256)
6 TS(INTEGER,                 "integer number",)
7 TS(CHARACTER_CONSTANT,      "character constant",)
8 TS(WIDE_CHARACTER_CONSTANT, "wide character constant",)
9 TS(FLOATINGPOINT,           "floatingpoint number",)
10 TS(STRING_LITERAL,          "string literal",)
11 TS(WIDE_STRING_LITERAL,     "wide string literal",)
12
13 #define PUNCTUATOR(name,string,val)   T(_ALL,name,string,val)
14 #include "tokens_punctuator.inc"
15 #undef PUNCTUATOR
16
17 #define S(mode,x)   T(mode,x,#x,)
18 S(_ALL, auto)
19 S(_ALL, break)
20 S(_ALL, case)
21 S(_ALL, char)
22 S(_ALL, continue)
23 S(_ALL, default)
24 S(_ALL, do)
25 S(_ALL, double)
26 S(_ALL, else)
27 S(_ALL, enum)
28 S(_ALL, extern)
29 S(_ALL, float)
30 S(_ALL, for)
31 S(_ALL, goto)
32 S(_ALL, if)
33 S(_ALL, int)
34 S(_ALL, long)
35 S(_ALL, register)
36 S(_ALL, return)
37 S(_ALL, short)
38 S(_ALL, sizeof)
39 S(_ALL, static)
40 S(_ALL, struct)
41 S(_ALL, switch)
42 S(_ALL, typedef)
43 S(_ALL, union)
44 S(_ALL, unsigned)
45 S(_ALL, void)
46 S(_ALL, while)
47
48 S(_C99|_GNUC, _Bool)
49 S(_ALL, __thread)
50 S(_ALL, __extension__)
51 S(_ALL, __builtin_classify_type)
52 S(_ALL, __builtin_va_list)
53 S(_ALL, __builtin_expect)
54 S(_ALL, __builtin_offsetof)
55 S(_ALL, __builtin_va_arg)
56 S(_ALL, __builtin_va_end)
57 S(_ALL, __builtin_alloca)
58 S(_ALL, __builtin_nanf)
59 S(_ALL, __builtin_nan)
60 S(_ALL, __builtin_nand)
61 S(_ALL, __builtin_isgreater)
62 S(_ALL, __builtin_isgreaterequal)
63 S(_ALL, __builtin_isless)
64 S(_ALL, __builtin_islessequal)
65 S(_ALL, __builtin_islessgreater)
66 S(_ALL, __builtin_isunordered)
67 S(_ALL, __builtin_constant_p)
68 S(_ALL, __builtin_prefetch)
69 S(_ALL, __builtin_huge_val)
70 S(_ALL, __PRETTY_FUNCTION__)
71 S(_ALL, __FUNCTION__)
72 S(_C99, __func__)
73 S(_MS, __FUNCSIG__)
74 S(_MS, __FUNCDNAME__)
75 #undef S
76
77 #define S(mode, x, val) T(mode, x, #x, val)
78 S(_ANSI|_C99,   signed,               )
79 S(_ALL,       __signed,               = T_signed)
80 S(_ALL,       __signed__,             = T_signed)
81 S(_C99|_GNUC,  _Complex,              )
82 S(_ALL,       __complex__,            = T__Complex)
83 S(_ALL,       __complex,              = T__Complex)
84 S(_C99|_GNUC,  _Imaginary,            )
85 S(_ALL,       __real__,               )
86 S(_ALL,       __real,                 = T___real__)
87 S(_ALL,       __imag__,               )
88 S(_ALL,       __imag,                 = T___imag__)
89 S(_ALL,       __alignof__,            )
90 S(_ALL,       __alignof,              = T___alignof__)
91 S(_MS,         _alignof,              = T___alignof__)
92 S(_ANSI|_C99,   const,                )
93 S(_ALL,       __const,                = T_const)
94 S(_ALL,       __const__,              = T_const)
95 S(_C99,         restrict,             )
96 S(_ALL,       __restrict__,           = T_restrict)
97 S(_ALL,       __restrict,             = T_restrict)
98 S(_MS,         _restrict,             = T_restrict)
99 S(_ALL,         asm,                  )
100 S(_ALL,       __asm__,                = T_asm)
101 S(_MS,         _asm,                  = T_asm)
102 S(_ALL,       __asm,                  = T_asm)
103 S(_ANSI|_C99,   volatile,             )
104 S(_ALL,       __volatile,             = T_volatile)
105 S(_ALL,       __volatile__,           = T_volatile)
106 S(_C99,         inline,               )
107 S(_ALL,       __inline,               = T_inline)
108 S(_ALL,       __inline__,             = T_inline)
109 S(_GNUC,        typeof,               )
110 S(_ALL,       __typeof,               = T_typeof)
111 S(_ALL,       __typeof__,             = T_typeof)
112 S(_ALL,       __attribute__,          )
113
114 S(_ALL,       __builtin_va_start,     )
115 S(_ALL,       __builtin_stdarg_start, = T___builtin_va_start)
116
117 S(_MS,         _near,                 )
118 S(_MS,        __near,                 = T__near)
119 S(_MS,         _far,                  )
120 S(_MS,        __far,                  = T__far)
121 S(_MS,          cdecl,                )
122 S(_MS,         _cdecl,                = T_cdecl)
123 S(_MS,        __cdecl,                = T_cdecl)
124 S(_MS,         _stdcall,              )
125 S(_MS,        __stdcall,              = T__stdcall)
126 S(_MS,         _fastcall,             )
127 S(_MS,        __fastcall,             = T__fastcall)
128 S(_MS,        __thiscall,             )
129 S(_MS,         _forceinline,          )
130 S(_MS,        __forceinline,          = T__forceinline)
131 S(_MS,        __unaligned,            )
132 S(_MS,         _assume,               )
133 S(_MS,        __assume,               = T__assume)
134 S(_MS,         _try,                  )
135 S(_MS,        __try,                  = T__try)
136 S(_MS,         _finally,              )
137 S(_MS,        __finally,              = T__finally)
138 S(_MS,         _leave,                )
139 S(_MS,        __leave,                = T__leave)
140 S(_MS,         _except,               )
141 S(_MS,        __except,               = T__except)
142 S(_MS,         _declspec,             )
143 S(_MS,        __declspec,             = T__declspec)
144 S(_MS,         _based,                )
145 S(_MS,        __based,                = T__based)
146 S(_MS,        __noop,                 )
147
148 S(_MS,        __ptr32,                )
149 S(_MS,        __ptr64,                )
150 S(_MS,        __sptr,                 )
151 S(_MS,        __uptr,                 )
152 S(_MS,         _w64,                  )
153 S(_MS,        __w64,                  = T__w64)
154
155 S(_MS,         _int8,                 )
156 S(_MS,        __int8,                 = T__int8)
157 S(_MS,         _int16,                )
158 S(_MS,        __int16,                = T__int16)
159 S(_MS,         _int32,                )
160 S(_MS,        __int32,                = T__int32)
161 S(_MS,         _int64,                )
162 S(_MS,        __int64,                = T__int64)
163 S(_MS,         _int128,               )
164 S(_MS,        __int128,               = T__int128)
165 #undef S