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