X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=tokens.inc;h=7074783678630ae874b0eb7b0d1123838d747c68;hb=f3f57226195059ecb38d482c469a4c665fc9c2d1;hp=9915f1884e069ee4b7e287c454512c17e41417b9;hpb=9e29e9c33f6511c4583e5b8ed83194d433e82c45;p=cparser diff --git a/tokens.inc b/tokens.inc index 9915f18..7074783 100644 --- a/tokens.inc +++ b/tokens.inc @@ -2,107 +2,149 @@ #define TS(x,str,val) #endif -TS(IDENTIFIER, "identifier", = 256) -TS(INTEGER, "integer number",) -TS(STRING_LITERAL, "string literal",) +TS(IDENTIFIER, "identifier", = 256) +TS(INTEGER, "integer number",) +TS(CHARACTER_CONSTANT, "character constant",) +TS(WIDE_CHARACTER_CONSTANT, "wide character constant",) +TS(FLOATINGPOINT, "floatingpoint number",) +TS(STRING_LITERAL, "string literal",) +TS(WIDE_STRING_LITERAL, "wide string literal",) -#define S(x) T(x,#x,) -S(auto) -S(break) -S(case) -S(char) -S(const) -S(continue) -S(default) -S(do) -S(double) -S(else) -S(enum) -S(extern) -S(float) -S(for) -S(goto) -S(if) -S(inline) -S(int) -S(long) -S(register) -S(restrict) -S(return) -S(short) -S(signed) -S(sizeof) -S(static) -S(struct) -S(switch) -S(typedef) -S(union) -S(unsigned) -S(void) -S(volatile) -S(while) -S(_Bool) -S(_Complex) -S(_Imaginary) +#define PUNCTUATOR(name,string,val) T(_ALL,name,string,val) +#include "tokens_punctuator.inc" +#undef PUNCTUATOR + +#define S(mode,x) T(mode,x,#x,) +S(_ALL, auto) +S(_ALL, break) +S(_ALL, case) +S(_ALL, char) +S(_ALL, continue) +S(_ALL, default) +S(_ALL, do) +S(_ALL, double) +S(_ALL, else) +S(_ALL, enum) +S(_ALL, extern) +S(_ALL, float) +S(_ALL, for) +S(_ALL, goto) +S(_ALL, if) +S(_ALL, int) +S(_ALL, long) +S(_ALL, register) +S(_ALL, return) +S(_ALL, short) +S(_ANSI|_C99, signed) +S(_ALL, sizeof) +S(_ALL, static) +S(_ALL, struct) +S(_ALL, switch) +S(_ALL, typedef) +S(_ALL, union) +S(_ALL, unsigned) +S(_ALL, void) +S(_ALL, while) + +S(_C99|_GNUC, _Bool) +S(_C99|_GNUC, _Complex) +S(_C99|_GNUC, _Imaginary) +S(_GNUC, __thread) +S(_GNUC, __extension__) +S(_GNUC, __builtin_classify_type) +S(_GNUC, __builtin_va_list) +S(_GNUC, __builtin_expect) +S(_GNUC, __builtin_offsetof) +S(_GNUC, __builtin_va_arg) +S(_GNUC, __builtin_va_end) +S(_GNUC, __builtin_alloca) +S(_GNUC, __builtin_nanf) +S(_GNUC, __builtin_nan) +S(_GNUC, __builtin_nand) +S(_GNUC, __builtin_isgreater) +S(_GNUC, __builtin_isgreaterequal) +S(_GNUC, __builtin_isless) +S(_GNUC, __builtin_islessequal) +S(_GNUC, __builtin_islessgreater) +S(_GNUC, __builtin_isunordered) +S(_GNUC, __builtin_constant_p) +S(_GNUC, __builtin_prefetch) +S(_GNUC, __PRETTY_FUNCTION__) +S(_ALL, __FUNCTION__) +S(_C99, __func__) #undef S -T(SELECT, "->",) -T(PLUSPLUS, "++",) -T(MINUSMINUS, "--",) -T(LESSLESS, "<<",) -T(GREATERGREATER, ">>",) -T(LESSEQUAL, "<=",) -T(GREATEREQUAL, ">=",) -T(EQUALEQUAL, "==",) -T(EXCLAMATIONMARKEQUAL, "!=",) -T(ANDAND, "&&",) -T(PIPEPIPE, "||",) -T(DOTDOTDOT, "...",) -T(ASTERISKEQUAL, "*=",) -T(SLASHEQUAL, "/=",) -T(PERCENTEQUAL, "%=",) -T(PLUSEQUAL, "+=",) -T(MINUSEQUAL, "-=",) -T(LESSLESSEQUAL, "<<=",) -T(GREATERGREATEREQUAL, ">>=",) -T(ANDEQUAL, "&=",) -T(CARETEQUAL, "^=",) -T(PIPEEQUAL, "|=",) -T(HASHHASH, "##",) +T(_GNUC, __real__, "__real__",) +T(_GNUC, __real, "__real", = T___real__) +T(_GNUC, __imag__, "__imag__",) +T(_GNUC, __imag, "__imag", = T___imag__) +T(_GNUC|_MS, __alignof__, "__alignof__",) +T(_GNUC|_MS, __alignof, "__alignof", = T___alignof__) +T(_MS, _alignof, "_alignof", = T___alignof__) +T(_ANSI|_C99, const, "const",) +T(_GNUC, __const, "__const", = T_const) +T(_C99, restrict, "restrict",) +T(_GNUC, __restrict__, "__restrict__", = T_restrict) +T(_GNUC, __restrict, "__restrict", = T_restrict) +T(_MS, _restrict, "_restrict", = T_restrict) +T(_ALL, asm, "asm",) +T(_GNUC, __asm__, "__asm__", = T_asm) +T(_MS, _asm, "_asm", = T_asm) +T(_GNUC|_MS, __asm, "__asm", = T_asm) +T(_ANSI|_C99, volatile, "volatile",) +T(_GNUC, __volatile__, "__volatile__", = T_volatile) +T(_C99, inline, "inline",) +T(_GNUC|_MS, __inline, "__inline", = T_inline) +T(_GNUC, __inline__, "__inline__", = T_inline) +T(_GNUC, typeof, "typeof",) +T(_GNUC, __typeof, "__typeof", = T_typeof) +T(_GNUC, __typeof__, "__typeof__", = T_typeof) +T(_GNUC, __attribute__, "__attribute__",) + +T(_GNUC, __builtin_va_start, "__builtin_va_start",) +T(_GNUC, __builtin_stdarg_start, "__builtin_stdarg_start", = T___builtin_va_start) -#define T_LAST_TOKEN (T_HASHHASH+1) +T(_MS, near, "_near",) +T(_MS, _near, "__near", = T_near) +T(_MS, far, "_far",) +T(_MS, _far, "__far", = T_far) +T(_MS, cdecl, "cdecl",) +T(_MS, _cdecl, "_cdecl", = T_cdecl) +T(_MS, __cdecl, "__cdecl", = T_cdecl) +T(_MS, stdcall, "_stdcall",) +T(_MS, __stdcall, "__stdcall", = T_stdcall) +T(_MS, fastcall, "_fastcall",) +T(_MS, __fastcall, "__fastcall", = T_fastcall) +T(_MS, thiscall, "_thiscall",) +T(_MS, __thiscall, "__thiscall", = T_thiscall) +T(_MS, forceinline, "_forceinline",) +T(_MS, __forceinline, "__forceinline", = T_forceinline) +T(_MS, unaligned, "_unaligned",) +T(_MS, __unaligned, "__unaligned", = T_unaligned) +T(_MS, assume, "_assume",) +T(_MS, __assume, "__assume", = T_assume) +T(_MS, try, "_try",) +T(_MS, __try, "__try", = T_try) +T(_MS, finally, "_finally",) +T(_MS, __finally, "__finally", = T_finally) +T(_MS, leave, "_leave",) +T(_MS, __leave, "__leave", = T_leave) +T(_MS, except, "_except",) +T(_MS, __except, "__except", = T_except) +T(_MS, declspec, "_declspec",) +T(_MS, __declspec, "__declspec", = T_declspec) +T(_MS, based, "_based",) +T(_MS, __based, "__based", = T_based) -T(RBRACK, "[", = '[') -T(LBRACK, "]", = ']') -T(LBRACE, "(", = '(') -T(RBRACE, ")", = ')') -T(RCURLY, "{", = '{') -T(LCURLY, "}", = '}') -T(DOT, ".", = '.') -T(AND, "&", = '&') -T(ASTERISK, "*", = '*') -T(PLUS, "+", = '+') -T(MINUS, "-", = '-') -T(TILDE, "~", = '~') -T(EXCLAMATIONMARK, "!", = '!') -T(SLASH, "/", = '/') -T(PERCENT, "%", = '%') -T(LESS, "<", = '<') -T(GREATER, ">", = '>') -T(CARET, "^", = '^') -T(PIPE, "|", = '|') -T(QUESTIONMARK, "?", = '?') -T(COLON, ":", = ':') -T(SEMICOLON, ";", = ';') -T(EQUAL, "=", = '=') -T(COMMA, ",", = ',') -T(HASH, "#", = '#') +T(_MS, int8, "_int8",) +T(_MS, __int8, "__int8", = T_int8) +T(_MS, int16, "_int16",) +T(_MS, __int16, "__int16", = T_int16) +T(_MS, int32, "_int32",) +T(_MS, __int32, "__int32", = T_int32) +T(_MS, int64, "_int64",) +T(_MS, __int64, "__int64", = T_int64) -T(LESSCOLON, "<:", = '[') -T(COLONGREATER, ":>", = ']') -T(LESSPERCENT, "<%", = '{') -T(PERCENTGREATER, "%>", = '}') -T(PERCENTCOLON, "%:", = '#') -T(PERCENTCOLONPERCENTCOLON, "%:%:", = T_HASHHASH) +#define T_LAST_TOKEN (T___int64+1) -TS(NEWLINE, "newline", = '\n') +#undef _T