Remove the unnecessary distinction between T_INTEGER, T_INTEGER_HEXADECIMAL and T_INT...
[cparser] / tokens.inc
1 #ifndef TS
2 #define TS(x,str,val)
3 #endif
4
5 /* These must go first. Some set explicit values. */
6 #define ALTERNATE(name, val)          T(_CXX, name, #name,  val)
7 #define PUNCTUATOR(name, string, val) T(_ALL, name, string, val)
8 #include "tokens_punctuator.inc"
9 #undef PUNCTUATOR
10 #undef ALTERNATE
11
12 TS(IDENTIFIER,                "identifier",)
13 TS(INTEGER,                   "integer number",)
14 TS(FLOATINGPOINT,             "floatingpoint number",)
15 TS(FLOATINGPOINT_HEXADECIMAL, "hexadecimal floatingpoint number",)
16 TS(CHARACTER_CONSTANT,        "character constant",)
17 TS(WIDE_CHARACTER_CONSTANT,   "wide character constant",)
18 TS(STRING_LITERAL,            "string literal",)
19 TS(WIDE_STRING_LITERAL,       "wide string literal",)
20
21 #define S(mode,x)   T(mode,x,#x,)
22 S(_ALL, auto)
23 S(_ALL, break)
24 S(_ALL, case)
25 S(_ALL, char)
26 S(_ALL, continue)
27 S(_ALL, default)
28 S(_ALL, do)
29 S(_ALL, double)
30 S(_ALL, else)
31 S(_ALL, enum)
32 S(_ALL, extern)
33 S(_ALL, float)
34 S(_ALL, for)
35 S(_ALL, goto)
36 S(_ALL, if)
37 S(_ALL, int)
38 S(_ALL, long)
39 S(_ALL, register)
40 S(_ALL, return)
41 S(_ALL, short)
42 S(_ALL, sizeof)
43 S(_ALL, static)
44 S(_ALL, struct)
45 S(_ALL, switch)
46 S(_ALL, typedef)
47 S(_ALL, union)
48 S(_ALL, unsigned)
49 S(_ALL, void)
50 S(_ALL, while)
51
52 /* C++ keywords */
53 #undef bool
54 S(_CXX, bool)
55 #define bool _Bool
56 S(_CXX, catch)
57 S(_CXX, class)
58 S(_CXX, const_cast)
59 S(_CXX, delete)
60 S(_CXX, dynamic_cast)
61 S(_CXX, explicit)
62 S(_CXX, export)
63 #undef false
64 S(_CXX, false)
65 #define false 0
66 S(_CXX, friend)
67 S(_CXX, mutable)
68 S(_CXX, namespace)
69 S(_CXX, new)
70 S(_CXX, operator)
71 S(_CXX, private)
72 S(_CXX, protected)
73 S(_CXX, public)
74 S(_CXX, reinterpret_cast)
75 S(_CXX, static_cast)
76 S(_CXX, template)
77 S(_CXX, this)
78 S(_CXX, throw)
79 #undef true
80 S(_CXX, true)
81 #define true 1
82 S(_CXX, try)
83 S(_CXX, typeid)
84 S(_CXX, typename)
85 S(_CXX, using)
86 S(_CXX, virtual)
87 S(_CXX, wchar_t)
88
89 S(_C99|_GNUC, _Bool)
90 S(_ALL, __thread)
91 S(_ALL, __extension__)
92 S(_ALL, __builtin_classify_type)
93 S(_ALL, __builtin_va_list)
94 S(_ALL, __builtin_va_arg)
95 S(_ALL, __builtin_va_copy)
96 S(_ALL, __builtin_offsetof)
97 S(_ALL, __builtin_constant_p)
98 S(_ALL, __builtin_types_compatible_p)
99 S(_ALL, __builtin_isgreater)
100 S(_ALL, __builtin_isgreaterequal)
101 S(_ALL, __builtin_isless)
102 S(_ALL, __builtin_islessequal)
103 S(_ALL, __builtin_islessgreater)
104 S(_ALL, __builtin_isunordered)
105 S(_ALL, __PRETTY_FUNCTION__)
106 S(_ALL, __FUNCTION__)
107 S(_ALL, __label__)
108 S(_C99, __func__)
109 S(_MS, __FUNCSIG__)
110 S(_MS, __FUNCDNAME__)
111 #undef S
112
113 /* needed on Windows */
114 #undef __w64
115 #undef __ptr32
116 #undef __ptr64
117
118 /* needed on MinGW */
119 #undef __int8
120 #undef __int16
121 #undef __int32
122 #undef __int64
123
124 /* needed on MinGW and Cygwin */
125 #undef __cdecl
126 #undef __stdcall
127 #undef __fastcall
128
129 /* needed on Darwin... */
130 #undef __signed
131 #undef __volatile
132 #undef __const
133 #undef __restrict
134
135 #define S(mode, x, val) T(mode, x, #x, val)
136 S(_ANSI|_C99|_CXX,   signed,               )
137 S(_ALL,            __signed,               = T_signed)
138 S(_ALL,            __signed__,             = T_signed)
139 S(_C99|_GNUC,       _Complex,              )
140 S(_ALL,            __complex__,            = T__Complex)
141 S(_ALL,            __complex,              = T__Complex)
142 S(_C99|_GNUC,       _Imaginary,            )
143 S(_ALL,            __real__,               )
144 S(_ALL,            __real,                 = T___real__)
145 S(_ALL,            __imag__,               )
146 S(_ALL,            __imag,                 = T___imag__)
147 S(_ALL,            __alignof__,            )
148 S(_ALL,            __alignof,              = T___alignof__)
149 S(_MS,              _alignof,              = T___alignof__)
150 S(_ANSI|_C99|_CXX,   const,                )
151 S(_ALL,            __const,                = T_const)
152 S(_ALL,            __const__,              = T_const)
153 S(_C99,              restrict,             )
154 S(_ALL,            __restrict__,           = T_restrict)
155 S(_ALL,            __restrict,             = T_restrict)
156 S(_MS,              _restrict,             = T_restrict)
157 S(_ALL,              asm,                  )
158 S(_ALL,            __asm__,                = T_asm)
159 S(_MS,              _asm,                  = T_asm)
160 S(_ALL,            __asm,                  = T_asm)
161 S(_ANSI|_C99|_CXX,   volatile,             )
162 S(_ALL,            __volatile,             = T_volatile)
163 S(_ALL,            __volatile__,           = T_volatile)
164 S(_C99|_CXX|_GNUC,   inline,               )
165 S(_ALL,            __inline,               = T_inline)
166 S(_ALL,            __inline__,             = T_inline)
167 S(_GNUC,             typeof,               )
168 S(_ALL,            __typeof,               = T_typeof)
169 S(_ALL,            __typeof__,             = T_typeof)
170 S(_ALL,            __attribute__,          )
171
172 S(_ALL,            __builtin_va_start,     )
173 S(_ALL,            __builtin_stdarg_start, = T___builtin_va_start)
174
175 S(_MS,              _near,                 )
176 S(_MS,             __near,                 = T__near)
177 S(_MS,              _far,                  )
178 S(_MS,             __far,                  = T__far)
179 S(_MS,               cdecl,                )
180 S(_MS,              _cdecl,                = T_cdecl)
181 S(_MS,             __cdecl,                = T_cdecl)
182 S(_MS,              _stdcall,              )
183 S(_MS,             __stdcall,              = T__stdcall)
184 S(_MS,              _fastcall,             )
185 S(_MS,             __fastcall,             = T__fastcall)
186 S(_MS,             __thiscall,             )
187 S(_MS,              _forceinline,          )
188 S(_MS,             __forceinline,          = T__forceinline)
189 S(_MS,             __unaligned,            )
190 S(_MS,              _assume,               )
191 S(_MS,             __assume,               = T__assume)
192 S(_MS,              _try,                  )
193 S(_MS,             __try,                  = T__try)
194 S(_MS,              _finally,              )
195 S(_MS,             __finally,              = T__finally)
196 S(_MS,              _leave,                )
197 S(_MS,             __leave,                = T__leave)
198 S(_MS,              _except,               )
199 S(_MS,             __except,               = T__except)
200 S(_MS,              _declspec,             )
201 S(_MS,             __declspec,             = T__declspec)
202 S(_MS,              _based,                )
203 S(_MS,             __based,                = T__based)
204 S(_MS,             __noop,                 )
205
206 S(_MS,             __ptr32,                )
207 S(_MS,             __ptr64,                )
208 S(_MS,             __sptr,                 )
209 S(_MS,             __uptr,                 )
210 S(_MS,              _w64,                  )
211 S(_MS,             __w64,                  = T__w64)
212
213 S(_MS,              _int8,                 )
214 S(_MS,             __int8,                 = T__int8)
215 S(_MS,              _int16,                )
216 S(_MS,             __int16,                = T__int16)
217 S(_MS,              _int32,                )
218 S(_MS,             __int32,                = T__int32)
219 S(_MS,              _int64,                )
220 S(_MS,             __int64,                = T__int64)
221 S(_MS,              _int128,               )
222 S(_MS,             __int128,               = T__int128)
223 #undef S
224
225 /* Redefine required macros for MinGW headers */
226 #if defined(__MINGW32__) || defined(__CYGWIN__)
227 #define __stdcall __attribute__((__stdcall__))
228 #define __fastcall __attribute__((__fastcall__))
229 #define __cdecl __attribute__((__cdecl__))
230 #endif