__builtin_constant_p() implemented
[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(FLOATINGPOINT,       "floatingpoint number",)
8 TS(STRING_LITERAL,      "string literal",)
9 TS(WIDE_STRING_LITERAL, "wide string literal",)
10
11 #define S(mode,x)   T(mode,x,#x,)
12 S(_ALL, auto)
13 S(_ALL, break)
14 S(_ALL, case)
15 S(_ALL, char)
16 S(_ALL, continue)
17 S(_ALL, default)
18 S(_ALL, do)
19 S(_ALL, double)
20 S(_ALL, else)
21 S(_ALL, enum)
22 S(_ALL, extern)
23 S(_ALL, float)
24 S(_ALL, for)
25 S(_ALL, goto)
26 S(_ALL, if)
27 S(_ALL, int)
28 S(_ALL, long)
29 S(_ALL, register)
30 S(_ALL, return)
31 S(_ALL, short)
32 S(_ANSI|_C99, signed)
33 S(_ALL, sizeof)
34 S(_ALL, static)
35 S(_ALL, struct)
36 S(_ALL, switch)
37 S(_ALL, typedef)
38 S(_ALL, union)
39 S(_ALL, unsigned)
40 S(_ALL, void)
41 S(_ALL, while)
42
43 S(_C99|_GNUC, _Bool)
44 S(_C99|_GNUC, _Complex)
45 S(_C99|_GNUC, _Imaginary)
46 S(_GNUC, __thread)
47 S(_GNUC, __extension__)
48 S(_GNUC, __builtin_classify_type)
49 S(_GNUC, __builtin_va_list)
50 S(_GNUC, __builtin_expect)
51 S(_GNUC, __builtin_offsetof)
52 S(_GNUC, __builtin_va_arg)
53 S(_GNUC, __builtin_va_end)
54 S(_GNUC, __builtin_alloca)
55 S(_GNUC, __builtin_nanf)
56 S(_GNUC, __builtin_nan)
57 S(_GNUC, __builtin_nand)
58 S(_GNUC, __builtin_isgreater)
59 S(_GNUC, __builtin_isgreaterequal)
60 S(_GNUC, __builtin_isless)
61 S(_GNUC, __builtin_islessequal)
62 S(_GNUC, __builtin_islessgreater)
63 S(_GNUC, __builtin_isunordered)
64 S(_GNUC, __builtin_constant_p)
65 S(_C99, __PRETTY_FUNCTION__)
66 S(_ALL, __FUNCTION__)
67 S(_C99, __func__)
68 S(_C99, __alignof__)
69 #undef S
70
71 T(_GNUC,      real,           "__real__",)
72 T(_GNUC,      _real,          "__real",                 = T_real)
73 T(_GNUC,      imag,           "__imag__",)
74 T(_GNUC,      _imag,          "__imag",                 = T_imag)
75 T(_GNUC|_MS,  __alignof,      "__alignof",              = T___alignof__)
76 T(_MS,        _alignof,       "_alignof",               = T___alignof__)
77 T(_ANSI|_C99, const,          "const",)
78 T(_GNUC,      _const,         "__const",                = T_const)
79 T(_GNUC|_MS,  restrict,       "__restrict",)
80 T(_GNUC,      _restrict_,     "__restrict__",           = T_restrict)
81 T(_C99,       _restrict,      "restrict",               = T_restrict)
82 T(_ALL,       asm,            "asm",)
83 T(_GNUC,      __asm__,        "__asm__",                = T_asm)
84 T(_ANSI|_C99, volatile,       "volatile",)
85 T(_GNUC,      __volatile__,   "__volatile__",           = T_volatile)
86 T(_C99,       inline,         "inline",)
87 T(_GNUC|_MS,  __inline,       "__inline",               = T_inline)
88 T(_GNUC,      __inline__,     "__inline__",             = T_inline)
89 T(_GNUC,      typeof,         "typeof",)
90 T(_GNUC,      __typeof,       "__typeof",               = T_typeof)
91 T(_GNUC,      __typeof__,     "__typeof__",             = T_typeof)
92 T(_GNUC,      attribute,      "__attribute",)
93 T(_GNUC,      __attribute__,  "__attribute__",          = T_attribute)
94
95 T(_GNUC,     __builtin_va_start,     "__builtin_va_start",)
96 T(_GNUC,     __builtin_stdarg_start, "__builtin_stdarg_start", = T___builtin_va_start)
97
98 T(_MS,       near,            "_near",)
99 T(_MS,       _near,           "__near",                  = T_near)
100 T(_MS,       far,             "_far",)
101 T(_MS,       _far,            "__far",                   = T_far)
102 T(_MS,      _asm,             "_asm",                    = T_asm)
103 T(_MS,      __asm,            "__asm",                   = T_asm)
104 T(_MS,      cdecl,            "cdecl",)
105 T(_MS,      _cdecl,           "_cdecl",                  = T_cdecl)
106 T(_MS,      __cdecl,          "__cdecl",                 = T_cdecl)
107 T(_MS,      stdcall,          "_stdcall",)
108 T(_MS,      __stdcall,        "__stdcall",               = T_stdcall)
109 T(_MS,      fastcall,         "_fastcall",)
110 T(_MS,      __fastcall,       "__fastcall",              = T_fastcall)
111 T(_MS,      thiscall,         "_thiscall",)
112 T(_MS,      __thiscall,       "__thiscall",              = T_thiscall)
113 T(_MS,      forceinline,      "_forceinline",)
114 T(_MS,      __forceinline,    "__forceinline",           = T_forceinline)
115 T(_MS,      unaligned,        "_unaligned",)
116 T(_MS,      __unaligned,      "__unaligned",             = T_unaligned)
117 T(_MS,      assume,           "_assume",)
118 T(_MS,      __assume,         "__assume",                = T_assume)
119 T(_MS,      try,              "_try",)
120 T(_MS,      __try,            "__try",                   = T_try)
121 T(_MS,      finally,          "_finally",)
122 T(_MS,      __finally,        "__finally",               = T_finally)
123 T(_MS,      leave,            "_leave",)
124 T(_MS,      __leave,          "__leave",                 = T_leave)
125 T(_MS,      except,           "_except",)
126 T(_MS,      __except,         "__except",                = T_except)
127 T(_MS,      declspec,         "_declspec",)
128 T(_MS,      __declspec,       "__declspec",              = T_declspec)
129 T(_MS,      based,            "_based",)
130 T(_MS,      __based,          "__based",                 = T_based)
131
132 T(_MS,      int8,             "_int8",)
133 T(_MS,      __int8,           "__int8",                  = T_int8)
134 T(_MS,      int16,            "_int16",)
135 T(_MS,      __int16,          "__int16",                 = T_int16)
136 T(_MS,      int32,            "_int32",)
137 T(_MS,      __int32,          "__int32",                 = T_int32)
138 T(_MS,      int64,            "_int64",)
139 T(_MS,      __int64,          "__int64",                 = T_int64)
140
141 #define _T(x,str,val) T(_ALL,x,str,val)
142
143 _T(MINUSGREATER,             "->",)
144 _T(PLUSPLUS,                 "++",)
145 _T(MINUSMINUS,               "--",)
146 _T(LESSLESS,                 "<<",)
147 _T(GREATERGREATER,           ">>",)
148 _T(LESSEQUAL,                "<=",)
149 _T(GREATEREQUAL,             ">=",)
150 _T(EQUALEQUAL,               "==",)
151 _T(EXCLAMATIONMARKEQUAL,     "!=",)
152 _T(ANDAND,                   "&&",)
153 _T(PIPEPIPE,                 "||",)
154 _T(DOTDOTDOT,                "...",)
155 _T(ASTERISKEQUAL,            "*=",)
156 _T(SLASHEQUAL,               "/=",)
157 _T(PERCENTEQUAL,             "%=",)
158 _T(PLUSEQUAL,                "+=",)
159 _T(MINUSEQUAL,               "-=",)
160 _T(LESSLESSEQUAL,            "<<=",)
161 _T(GREATERGREATEREQUAL,      ">>=",)
162 _T(ANDEQUAL,                 "&=",)
163 _T(CARETEQUAL,               "^=",)
164 _T(PIPEEQUAL,                "|=",)
165 _T(HASHHASH,                 "##",)
166
167 #define T_LAST_TOKEN  (T_HASHHASH+1)
168
169 _T(LESSCOLON,                "<:",   = '[')
170 _T(COLONGREATER,             ":>",   = ']')
171 _T(LESSPERCENT,              "<%",   = '{')
172 _T(PERCENTGREATER,           "%>",   = '}')
173 _T(PERCENTCOLON,             "%:",   = '#')
174 _T(PERCENTCOLONPERCENTCOLON, "%:%:", = T_HASHHASH)
175
176 _T(RBRACK,          "[", = '[')
177 _T(LBRACK,          "]", = ']')
178 _T(LBRACE,          "(", = '(')
179 _T(RBRACE,          ")", = ')')
180 _T(RCURLY,          "{", = '{')
181 _T(LCURLY,          "}", = '}')
182 _T(DOT,             ".", = '.')
183 _T(AND,             "&", = '&')
184 _T(ASTERISK,        "*", = '*')
185 _T(PLUS,            "+", = '+')
186 _T(MINUS,           "-", = '-')
187 _T(TILDE,           "~", = '~')
188 _T(EXCLAMATIONMARK, "!", = '!')
189 _T(SLASH,           "/", = '/')
190 _T(PERCENT,         "%", = '%')
191 _T(LESS,            "<", = '<')
192 _T(GREATER,         ">", = '>')
193 _T(CARET,           "^", = '^')
194 _T(PIPE,            "|", = '|')
195 _T(QUESTIONMARK,    "?", = '?')
196 _T(COLON,           ":", = ':')
197 _T(SEMICOLON,       ";", = ';')
198 _T(EQUAL,           "=", = '=')
199 _T(COMMA,           ",", = ',')
200 _T(HASH,            "#", = '#')
201
202 #undef _T
203
204 TS(NEWLINE,        "newline", = '\n')