1*c2c66affSColin Finck // iskeyword.cpp 2*c2c66affSColin Finck 3*c2c66affSColin Finck #ifdef _MSC_VER 4*c2c66affSColin Finck #pragma warning ( disable : 4786 ) 5*c2c66affSColin Finck #endif//_MSC_VER 6*c2c66affSColin Finck 7*c2c66affSColin Finck #include <string> 8*c2c66affSColin Finck 9*c2c66affSColin Finck #include "iskeyword.h" 10*c2c66affSColin Finck 11*c2c66affSColin Finck using std::string; 12*c2c66affSColin Finck iskeyword(const string & ident)13*c2c66affSColin Finckbool iskeyword ( const string& ident ) 14*c2c66affSColin Finck { 15*c2c66affSColin Finck #define I(s) if ( ident == #s ) return true; 16*c2c66affSColin Finck switch ( ident[0] ) 17*c2c66affSColin Finck { 18*c2c66affSColin Finck case '_': 19*c2c66affSColin Finck I(__cdecl); 20*c2c66affSColin Finck I(__declspec); 21*c2c66affSColin Finck I(__except); 22*c2c66affSColin Finck I(__fastcall); 23*c2c66affSColin Finck I(__finally); 24*c2c66affSColin Finck I(__inline); 25*c2c66affSColin Finck I(__int8); 26*c2c66affSColin Finck I(__int16); 27*c2c66affSColin Finck I(__int32); 28*c2c66affSColin Finck I(__int64); 29*c2c66affSColin Finck I(__leave); 30*c2c66affSColin Finck I(__stdcall); 31*c2c66affSColin Finck I(__try); 32*c2c66affSColin Finck break; 33*c2c66affSColin Finck case 'b': 34*c2c66affSColin Finck I(bool); 35*c2c66affSColin Finck I(break); 36*c2c66affSColin Finck break; 37*c2c66affSColin Finck case 'c': 38*c2c66affSColin Finck I(case); 39*c2c66affSColin Finck I(catch); 40*c2c66affSColin Finck I(char); 41*c2c66affSColin Finck I(class); 42*c2c66affSColin Finck I(const); 43*c2c66affSColin Finck I(const_cast); 44*c2c66affSColin Finck I(continue); 45*c2c66affSColin Finck break; 46*c2c66affSColin Finck case 'd': 47*c2c66affSColin Finck I(default); 48*c2c66affSColin Finck I(delete); 49*c2c66affSColin Finck I(dllexport); 50*c2c66affSColin Finck I(dllimport); 51*c2c66affSColin Finck I(do); 52*c2c66affSColin Finck I(double); 53*c2c66affSColin Finck I(dynamic_cast); 54*c2c66affSColin Finck break; 55*c2c66affSColin Finck case 'e': 56*c2c66affSColin Finck I(else); 57*c2c66affSColin Finck I(enum); 58*c2c66affSColin Finck I(explicit); 59*c2c66affSColin Finck I(extern); 60*c2c66affSColin Finck break; 61*c2c66affSColin Finck case 'f': 62*c2c66affSColin Finck I(false); 63*c2c66affSColin Finck I(float); 64*c2c66affSColin Finck I(for); 65*c2c66affSColin Finck I(friend); 66*c2c66affSColin Finck break; 67*c2c66affSColin Finck case 'g': 68*c2c66affSColin Finck I(goto); 69*c2c66affSColin Finck break; 70*c2c66affSColin Finck case 'i': 71*c2c66affSColin Finck I(if); 72*c2c66affSColin Finck I(inline); 73*c2c66affSColin Finck I(int); 74*c2c66affSColin Finck break; 75*c2c66affSColin Finck case 'l': 76*c2c66affSColin Finck I(long); 77*c2c66affSColin Finck break; 78*c2c66affSColin Finck case 'm': 79*c2c66affSColin Finck I(mutable); 80*c2c66affSColin Finck break; 81*c2c66affSColin Finck case 'n': 82*c2c66affSColin Finck I(naked); 83*c2c66affSColin Finck I(namespace); 84*c2c66affSColin Finck I(new); 85*c2c66affSColin Finck I(noreturn); 86*c2c66affSColin Finck break; 87*c2c66affSColin Finck case 'o': 88*c2c66affSColin Finck I(operator); 89*c2c66affSColin Finck break; 90*c2c66affSColin Finck case 'p': 91*c2c66affSColin Finck I(private); 92*c2c66affSColin Finck I(protected); 93*c2c66affSColin Finck I(public); 94*c2c66affSColin Finck break; 95*c2c66affSColin Finck case 'r': 96*c2c66affSColin Finck I(register); 97*c2c66affSColin Finck I(reinterpret_cast); 98*c2c66affSColin Finck I(return); 99*c2c66affSColin Finck break; 100*c2c66affSColin Finck case 's': 101*c2c66affSColin Finck I(short); 102*c2c66affSColin Finck I(signed); 103*c2c66affSColin Finck I(sizeof); 104*c2c66affSColin Finck I(static); 105*c2c66affSColin Finck I(static_cast); 106*c2c66affSColin Finck I(struct); 107*c2c66affSColin Finck I(switch); 108*c2c66affSColin Finck break; 109*c2c66affSColin Finck case 't': 110*c2c66affSColin Finck I(template); 111*c2c66affSColin Finck I(this); 112*c2c66affSColin Finck I(thread); 113*c2c66affSColin Finck I(throw); 114*c2c66affSColin Finck I(true); 115*c2c66affSColin Finck I(try); 116*c2c66affSColin Finck I(typedef); 117*c2c66affSColin Finck I(typeid); 118*c2c66affSColin Finck I(typename); 119*c2c66affSColin Finck break; 120*c2c66affSColin Finck case 'u': 121*c2c66affSColin Finck I(union); 122*c2c66affSColin Finck I(unsigned); 123*c2c66affSColin Finck I(using); 124*c2c66affSColin Finck I(uuid); 125*c2c66affSColin Finck I(__uuidof); 126*c2c66affSColin Finck break; 127*c2c66affSColin Finck case 'v': 128*c2c66affSColin Finck I(virtual); 129*c2c66affSColin Finck I(void); 130*c2c66affSColin Finck I(volatile); 131*c2c66affSColin Finck break; 132*c2c66affSColin Finck case 'w': 133*c2c66affSColin Finck I(wmain); 134*c2c66affSColin Finck I(while); 135*c2c66affSColin Finck break; 136*c2c66affSColin Finck } 137*c2c66affSColin Finck return false; 138*c2c66affSColin Finck } 139