X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=tokens.inc;h=e649437c3f48feeae0e66dacea67bae385dcfe7f;hb=ae52b69dfadbd0835e01f55167d979cb6a9a6305;hp=9c86492210ee0e53237a0cf10e8bffa81de60eee;hpb=8f16244781a004fefe9a14d55f0e2463dee04eaf;p=cparser diff --git a/tokens.inc b/tokens.inc index 9c86492..e649437 100644 --- a/tokens.inc +++ b/tokens.inc @@ -10,9 +10,11 @@ TS(FLOATINGPOINT, "floatingpoint number",) TS(STRING_LITERAL, "string literal",) TS(WIDE_STRING_LITERAL, "wide string literal",) -#define PUNCTUATOR(name,string,val) T(_ALL,name,string,val) +#define ALTERNATE(name, val) T(_CXX, name, #name, val) +#define PUNCTUATOR(name, string, val) T(_ALL, name, string, val) #include "tokens_punctuator.inc" #undef PUNCTUATOR +#undef ALTERNATE #define S(mode,x) T(mode,x,#x,) S(_ALL, auto) @@ -45,6 +47,39 @@ S(_ALL, unsigned) S(_ALL, void) S(_ALL, while) +/* C++ keywords */ +#undef bool +S(_CXX, bool) +#define bool _Bool +S(_CXX, catch) +S(_CXX, class) +S(_CXX, const_cast) +S(_CXX, delete) +S(_CXX, dynamic_cast) +S(_CXX, explicit) +S(_CXX, export) +S(_CXX, false) +S(_CXX, friend) +S(_CXX, mutable) +S(_CXX, namespace) +S(_CXX, new) +S(_CXX, operator) +S(_CXX, private) +S(_CXX, protected) +S(_CXX, public) +S(_CXX, reinterpret_cast) +S(_CXX, static_cast) +S(_CXX, template) +S(_CXX, this) +S(_CXX, throw) +S(_CXX, true) +S(_CXX, try) +S(_CXX, typeid) +S(_CXX, typename) +S(_CXX, using) +S(_CXX, virtual) +S(_CXX, wchar_t) + S(_C99|_GNUC, _Bool) S(_ALL, __thread) S(_ALL, __extension__) @@ -55,9 +90,12 @@ S(_ALL, __builtin_offsetof) S(_ALL, __builtin_va_arg) S(_ALL, __builtin_va_end) S(_ALL, __builtin_alloca) -S(_ALL, __builtin_nanf) +S(_ALL, __builtin_inf) +S(_ALL, __builtin_inff) +S(_ALL, __builtin_infl) S(_ALL, __builtin_nan) -S(_ALL, __builtin_nand) +S(_ALL, __builtin_nanf) +S(_ALL, __builtin_nanl) S(_ALL, __builtin_isgreater) S(_ALL, __builtin_isgreaterequal) S(_ALL, __builtin_isless) @@ -69,11 +107,34 @@ S(_ALL, __builtin_prefetch) S(_ALL, __builtin_huge_val) S(_ALL, __PRETTY_FUNCTION__) S(_ALL, __FUNCTION__) +S(_ALL, __label__) S(_C99, __func__) S(_MS, __FUNCSIG__) S(_MS, __FUNCDNAME__) #undef S +/* needed on Windows */ +#ifdef __w64 +#undef __w64 +#endif +#ifdef __ptr64 +#undef __ptr64 +#endif + +/* needed on darwin... */ +#ifdef __signed +#undef __signed +#endif +#ifdef __volatile +#undef __volatile +#endif +#ifdef __const +#undef __const +#endif +#ifdef __restrict +#undef __restrict +#endif + #define S(mode, x, val) T(mode, x, #x, val) S(_ANSI|_C99, signed, ) S(_ALL, __signed, = T_signed) @@ -103,7 +164,7 @@ S(_ALL, __asm, = T_asm) S(_ANSI|_C99, volatile, ) S(_ALL, __volatile, = T_volatile) S(_ALL, __volatile__, = T_volatile) -S(_C99, inline, ) +S(_C99|_CXX, inline, ) S(_ALL, __inline, = T_inline) S(_ALL, __inline__, = T_inline) S(_GNUC, typeof, )