Parse __builtin_inf{,f,l} and correct __builtin_nand to __builtin_nanl.
[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_inf)
59 S(_ALL, __builtin_inff)
60 S(_ALL, __builtin_infl)
61 S(_ALL, __builtin_nan)
62 S(_ALL, __builtin_nanf)
63 S(_ALL, __builtin_nanl)
64 S(_ALL, __builtin_isgreater)
65 S(_ALL, __builtin_isgreaterequal)
66 S(_ALL, __builtin_isless)
67 S(_ALL, __builtin_islessequal)
68 S(_ALL, __builtin_islessgreater)
69 S(_ALL, __builtin_isunordered)
70 S(_ALL, __builtin_constant_p)
71 S(_ALL, __builtin_prefetch)
72 S(_ALL, __builtin_huge_val)
73 S(_ALL, __PRETTY_FUNCTION__)
74 S(_ALL, __FUNCTION__)
75 S(_ALL, __label__)
76 S(_C99, __func__)
77 S(_MS, __FUNCSIG__)
78 S(_MS, __FUNCDNAME__)
79 #undef S
80
81 /* needed on Windows */
82 #ifdef __w64
83 #undef __w64
84 #endif
85 #ifdef __ptr64
86 #undef __ptr64
87 #endif
88
89 /* needed on darwin... */
90 #ifdef __signed
91 #undef __signed
92 #endif
93 #ifdef __volatile
94 #undef __volatile
95 #endif
96 #ifdef __const
97 #undef __const
98 #endif
99 #ifdef __restrict
100 #undef __restrict
101 #endif
102
103 #define S(mode, x, val) T(mode, x, #x, val)
104 S(_ANSI|_C99,   signed,               )
105 S(_ALL,       __signed,               = T_signed)
106 S(_ALL,       __signed__,             = T_signed)
107 S(_C99|_GNUC,  _Complex,              )
108 S(_ALL,       __complex__,            = T__Complex)
109 S(_ALL,       __complex,              = T__Complex)
110 S(_C99|_GNUC,  _Imaginary,            )
111 S(_ALL,       __real__,               )
112 S(_ALL,       __real,                 = T___real__)
113 S(_ALL,       __imag__,               )
114 S(_ALL,       __imag,                 = T___imag__)
115 S(_ALL,       __alignof__,            )
116 S(_ALL,       __alignof,              = T___alignof__)
117 S(_MS,         _alignof,              = T___alignof__)
118 S(_ANSI|_C99,   const,                )
119 S(_ALL,       __const,                = T_const)
120 S(_ALL,       __const__,              = T_const)
121 S(_C99,         restrict,             )
122 S(_ALL,       __restrict__,           = T_restrict)
123 S(_ALL,       __restrict,             = T_restrict)
124 S(_MS,         _restrict,             = T_restrict)
125 S(_ALL,         asm,                  )
126 S(_ALL,       __asm__,                = T_asm)
127 S(_MS,         _asm,                  = T_asm)
128 S(_ALL,       __asm,                  = T_asm)
129 S(_ANSI|_C99,   volatile,             )
130 S(_ALL,       __volatile,             = T_volatile)
131 S(_ALL,       __volatile__,           = T_volatile)
132 S(_C99,         inline,               )
133 S(_ALL,       __inline,               = T_inline)
134 S(_ALL,       __inline__,             = T_inline)
135 S(_GNUC,        typeof,               )
136 S(_ALL,       __typeof,               = T_typeof)
137 S(_ALL,       __typeof__,             = T_typeof)
138 S(_ALL,       __attribute__,          )
139
140 S(_ALL,       __builtin_va_start,     )
141 S(_ALL,       __builtin_stdarg_start, = T___builtin_va_start)
142
143 S(_MS,         _near,                 )
144 S(_MS,        __near,                 = T__near)
145 S(_MS,         _far,                  )
146 S(_MS,        __far,                  = T__far)
147 S(_MS,          cdecl,                )
148 S(_MS,         _cdecl,                = T_cdecl)
149 S(_MS,        __cdecl,                = T_cdecl)
150 S(_MS,         _stdcall,              )
151 S(_MS,        __stdcall,              = T__stdcall)
152 S(_MS,         _fastcall,             )
153 S(_MS,        __fastcall,             = T__fastcall)
154 S(_MS,        __thiscall,             )
155 S(_MS,         _forceinline,          )
156 S(_MS,        __forceinline,          = T__forceinline)
157 S(_MS,        __unaligned,            )
158 S(_MS,         _assume,               )
159 S(_MS,        __assume,               = T__assume)
160 S(_MS,         _try,                  )
161 S(_MS,        __try,                  = T__try)
162 S(_MS,         _finally,              )
163 S(_MS,        __finally,              = T__finally)
164 S(_MS,         _leave,                )
165 S(_MS,        __leave,                = T__leave)
166 S(_MS,         _except,               )
167 S(_MS,        __except,               = T__except)
168 S(_MS,         _declspec,             )
169 S(_MS,        __declspec,             = T__declspec)
170 S(_MS,         _based,                )
171 S(_MS,        __based,                = T__based)
172 S(_MS,        __noop,                 )
173
174 S(_MS,        __ptr32,                )
175 S(_MS,        __ptr64,                )
176 S(_MS,        __sptr,                 )
177 S(_MS,        __uptr,                 )
178 S(_MS,         _w64,                  )
179 S(_MS,        __w64,                  = T__w64)
180
181 S(_MS,         _int8,                 )
182 S(_MS,        __int8,                 = T__int8)
183 S(_MS,         _int16,                )
184 S(_MS,        __int16,                = T__int16)
185 S(_MS,         _int32,                )
186 S(_MS,        __int32,                = T__int32)
187 S(_MS,         _int64,                )
188 S(_MS,        __int64,                = T__int64)
189 S(_MS,         _int128,               )
190 S(_MS,        __int128,               = T__int128)
191 #undef S