token: refactoring the 'isStandardType' a little

This commit is contained in:
Daniel Marjamäki 2008-11-26 07:22:34 +00:00
parent c95fee7266
commit b179083788
2 changed files with 7 additions and 10 deletions

View File

@ -193,16 +193,13 @@ bool TOKEN::isNumber() const
return _isNumber;
}
bool TOKEN::IsStandardType(const char str[])
bool TOKEN::isStandardType() const
{
if (!str)
return false;
bool Ret = false;
bool ret = false;
const char *type[] = {"bool","char","short","int","long","float","double",0};
for (int i = 0; type[i]; i++)
Ret |= (strcmp(str,type[i])==0);
return Ret;
ret |= (_str == type[i]);
return ret;
}
//---------------------------------------------------------------------------

View File

@ -64,7 +64,7 @@ public:
static bool Match(const TOKEN *tok, const char pattern[], const char *varname1[]=0, const char *varname2[]=0);
bool isName() const;
bool isNumber() const;
static bool IsStandardType(const char str[]);
bool isStandardType() const;
static const TOKEN *findmatch(const TOKEN *tok, const char pattern[], const char *varname1[]=0, const char *varname2[]=0);
static const TOKEN *findtoken(const TOKEN *tok1, const char *tokenstr[]);