2 * This file is part of cparser.
3 * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
6 /* These must go first. Some set explicit values. */
7 #define ALTERNATE(name, val) T(_CXX, T_##name, #name, val)
8 #define PUNCTUATOR(name, string, val) T(_ALL, T_##name, string, val)
9 #include "tokens_punctuator.inc"
13 #define S(name, description) T(_ALL, T_##name, description,)
14 S(EOF, "end of input")
15 S(IDENTIFIER, "identifier")
16 S(NUMBER, "number constant")
17 S(CHARACTER_CONSTANT, "character constant")
18 S(STRING_LITERAL, "string literal")
19 S(MACRO_PARAMETER, "macro parameter")
20 S(UNKNOWN_CHAR, "unknown character")
23 #define S(mode,x) T(mode,T_##x,#x,)
72 S(_CXX, reinterpret_cast)
91 S(_C11, _Static_assert)
93 S(_ALL, __extension__)
94 S(_ALL, __builtin_classify_type)
95 S(_ALL, __builtin_va_list)
96 S(_ALL, __builtin_va_arg)
97 S(_ALL, __builtin_va_copy)
98 S(_ALL, __builtin_offsetof)
99 S(_ALL, __builtin_constant_p)
100 S(_ALL, __builtin_types_compatible_p)
101 S(_ALL, __builtin_isgreater)
102 S(_ALL, __builtin_isgreaterequal)
103 S(_ALL, __builtin_isless)
104 S(_ALL, __builtin_islessequal)
105 S(_ALL, __builtin_islessgreater)
106 S(_ALL, __builtin_isunordered)
107 S(_ALL, __PRETTY_FUNCTION__)
110 S(_MS, __FUNCDNAME__)
113 #define S(mode, x, val) T(mode, T_##x, #x, val)
115 S(_ALL, __FUNCTION__, = T___func__)
116 S(_C11, _Thread_local, )
117 S(_ALL, __thread, = T__Thread_local)
119 S(_ALL, __signed, = T_signed)
120 S(_ALL, __signed__, = T_signed)
121 S(_C99|_GNUC, _Complex, )
122 S(_ALL, __complex__, = T__Complex)
123 S(_ALL, __complex, = T__Complex)
124 S(_C99|_GNUC, _Imaginary, )
126 S(_ALL, __real, = T___real__)
128 S(_ALL, __imag, = T___imag__)
130 S(_ALL, __alignof__, = T__Alignof)
131 S(_ALL, __alignof, = T__Alignof)
132 S(_MS, _alignof, = T__Alignof)
134 S(_ALL, __const, = T_const)
135 S(_ALL, __const__, = T_const)
137 S(_ALL, __restrict__, = T_restrict)
138 S(_ALL, __restrict, = T_restrict)
139 S(_MS, _restrict, = T_restrict)
141 S(_ALL, __asm__, = T_asm)
142 S(_MS, _asm, = T_asm)
143 S(_ALL, __asm, = T_asm)
145 S(_ALL, __volatile, = T_volatile)
146 S(_ALL, __volatile__, = T_volatile)
147 S(_C99|_CXX|_GNUC, inline, )
148 S(_ALL, __inline, = T_inline)
149 S(_ALL, __inline__, = T_inline)
151 S(_ALL, __typeof, = T_typeof)
152 S(_ALL, __typeof__, = T_typeof)
153 S(_ALL, __attribute__, )
155 S(_ALL, __builtin_va_start, )
156 S(_ALL, __builtin_stdarg_start, = T___builtin_va_start)
159 S(_MS, __near, = T__near)
161 S(_MS, __far, = T__far)
163 S(_MS, _cdecl, = T_cdecl)
164 S(_MS, __cdecl, = T_cdecl)
166 S(_MS, __stdcall, = T__stdcall)
168 S(_MS, __fastcall, = T__fastcall)
170 S(_MS, _forceinline, )
171 S(_MS, __forceinline, = T__forceinline)
172 S(_MS, __unaligned, )
174 S(_MS, __assume, = T__assume)
176 S(_MS, __try, = T__try)
178 S(_MS, __finally, = T__finally)
180 S(_MS, __leave, = T__leave)
182 S(_MS, __except, = T__except)
184 S(_MS, __declspec, = T__declspec)
186 S(_MS, __based, = T__based)
194 S(_MS, __w64, = T__w64)
197 S(_MS, __int8, = T__int8)
199 S(_MS, __int16, = T__int16)
201 S(_MS, __int32, = T__int32)
203 S(_MS, __int64, = T__int64)
205 S(_MS, __int128, = T__int128)
208 /* Redefine required macros for MinGW headers */
209 #if defined(__MINGW32__) || defined(__CYGWIN__)
210 #define __stdcall __attribute__((__stdcall__))
211 #define __fastcall __attribute__((__fastcall__))
212 #define __cdecl __attribute__((__cdecl__))