Add C++ keywords.
[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 ALTERNATE(name, val)          T(_CXX, name, #name,  val)
14 #define PUNCTUATOR(name, string, val) T(_ALL, name, string, val)
15 #include "tokens_punctuator.inc"
16 #undef PUNCTUATOR
17 #undef ALTERNATE
18
19 #define S(mode,x)   T(mode,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 #undef bool
52 S(_CXX, bool)
53 #define bool _Bool
54 S(_CXX, catch)
55 S(_CXX, class)
56 S(_CXX, const_cast)
57 S(_CXX, delete)
58 S(_CXX, dynamic_cast)
59 S(_CXX, explicit)
60 S(_CXX, export)
61 S(_CXX, false)
62 S(_CXX, friend)
63 S(_CXX, mutable)
64 S(_CXX, namespace)
65 S(_CXX, new)
66 S(_CXX, operator)
67 S(_CXX, private)
68 S(_CXX, protected)
69 S(_CXX, public)
70 S(_CXX, reinterpret_cast)
71 S(_CXX, static_cast)
72 S(_CXX, template)
73 S(_CXX, this)
74 S(_CXX, throw)
75 S(_CXX, true)
76 S(_CXX, try)
77 S(_CXX, typeid)
78 S(_CXX, typename)
79 S(_CXX, using)
80 S(_CXX, virtual)
81 S(_CXX, wchar_t)
82
83 S(_C99|_GNUC, _Bool)
84 S(_ALL, __thread)
85 S(_ALL, __extension__)
86 S(_ALL, __builtin_classify_type)
87 S(_ALL, __builtin_va_list)
88 S(_ALL, __builtin_expect)
89 S(_ALL, __builtin_offsetof)
90 S(_ALL, __builtin_va_arg)
91 S(_ALL, __builtin_va_end)
92 S(_ALL, __builtin_alloca)
93 S(_ALL, __builtin_inf)
94 S(_ALL, __builtin_inff)
95 S(_ALL, __builtin_infl)
96 S(_ALL, __builtin_nan)
97 S(_ALL, __builtin_nanf)
98 S(_ALL, __builtin_nanl)
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, __builtin_constant_p)
106 S(_ALL, __builtin_prefetch)
107 S(_ALL, __builtin_huge_val)
108 S(_ALL, __PRETTY_FUNCTION__)
109 S(_ALL, __FUNCTION__)
110 S(_ALL, __label__)
111 S(_C99, __func__)
112 S(_MS, __FUNCSIG__)
113 S(_MS, __FUNCDNAME__)
114 #undef S
115
116 /* needed on Windows */
117 #ifdef __w64
118 #undef __w64
119 #endif
120 #ifdef __ptr64
121 #undef __ptr64
122 #endif
123
124 /* needed on darwin... */
125 #ifdef __signed
126 #undef __signed
127 #endif
128 #ifdef __volatile
129 #undef __volatile
130 #endif
131 #ifdef __const
132 #undef __const
133 #endif
134 #ifdef __restrict
135 #undef __restrict
136 #endif
137
138 #define S(mode, x, val) T(mode, x, #x, val)
139 S(_ANSI|_C99,   signed,               )
140 S(_ALL,       __signed,               = T_signed)
141 S(_ALL,       __signed__,             = T_signed)
142 S(_C99|_GNUC,  _Complex,              )
143 S(_ALL,       __complex__,            = T__Complex)
144 S(_ALL,       __complex,              = T__Complex)
145 S(_C99|_GNUC,  _Imaginary,            )
146 S(_ALL,       __real__,               )
147 S(_ALL,       __real,                 = T___real__)
148 S(_ALL,       __imag__,               )
149 S(_ALL,       __imag,                 = T___imag__)
150 S(_ALL,       __alignof__,            )
151 S(_ALL,       __alignof,              = T___alignof__)
152 S(_MS,         _alignof,              = T___alignof__)
153 S(_ANSI|_C99,   const,                )
154 S(_ALL,       __const,                = T_const)
155 S(_ALL,       __const__,              = T_const)
156 S(_C99,         restrict,             )
157 S(_ALL,       __restrict__,           = T_restrict)
158 S(_ALL,       __restrict,             = T_restrict)
159 S(_MS,         _restrict,             = T_restrict)
160 S(_ALL,         asm,                  )
161 S(_ALL,       __asm__,                = T_asm)
162 S(_MS,         _asm,                  = T_asm)
163 S(_ALL,       __asm,                  = T_asm)
164 S(_ANSI|_C99,   volatile,             )
165 S(_ALL,       __volatile,             = T_volatile)
166 S(_ALL,       __volatile__,           = T_volatile)
167 S(_C99|_CXX,    inline,               )
168 S(_ALL,       __inline,               = T_inline)
169 S(_ALL,       __inline__,             = T_inline)
170 S(_GNUC,        typeof,               )
171 S(_ALL,       __typeof,               = T_typeof)
172 S(_ALL,       __typeof__,             = T_typeof)
173 S(_ALL,       __attribute__,          )
174
175 S(_ALL,       __builtin_va_start,     )
176 S(_ALL,       __builtin_stdarg_start, = T___builtin_va_start)
177
178 S(_MS,         _near,                 )
179 S(_MS,        __near,                 = T__near)
180 S(_MS,         _far,                  )
181 S(_MS,        __far,                  = T__far)
182 S(_MS,          cdecl,                )
183 S(_MS,         _cdecl,                = T_cdecl)
184 S(_MS,        __cdecl,                = T_cdecl)
185 S(_MS,         _stdcall,              )
186 S(_MS,        __stdcall,              = T__stdcall)
187 S(_MS,         _fastcall,             )
188 S(_MS,        __fastcall,             = T__fastcall)
189 S(_MS,        __thiscall,             )
190 S(_MS,         _forceinline,          )
191 S(_MS,        __forceinline,          = T__forceinline)
192 S(_MS,        __unaligned,            )
193 S(_MS,         _assume,               )
194 S(_MS,        __assume,               = T__assume)
195 S(_MS,         _try,                  )
196 S(_MS,        __try,                  = T__try)
197 S(_MS,         _finally,              )
198 S(_MS,        __finally,              = T__finally)
199 S(_MS,         _leave,                )
200 S(_MS,        __leave,                = T__leave)
201 S(_MS,         _except,               )
202 S(_MS,        __except,               = T__except)
203 S(_MS,         _declspec,             )
204 S(_MS,        __declspec,             = T__declspec)
205 S(_MS,         _based,                )
206 S(_MS,        __based,                = T__based)
207 S(_MS,        __noop,                 )
208
209 S(_MS,        __ptr32,                )
210 S(_MS,        __ptr64,                )
211 S(_MS,        __sptr,                 )
212 S(_MS,        __uptr,                 )
213 S(_MS,         _w64,                  )
214 S(_MS,        __w64,                  = T__w64)
215
216 S(_MS,         _int8,                 )
217 S(_MS,        __int8,                 = T__int8)
218 S(_MS,         _int16,                )
219 S(_MS,        __int16,                = T__int16)
220 S(_MS,         _int32,                )
221 S(_MS,        __int32,                = T__int32)
222 S(_MS,         _int64,                )
223 S(_MS,        __int64,                = T__int64)
224 S(_MS,         _int128,               )
225 S(_MS,        __int128,               = T__int128)
226 #undef S