diff --git a/CommonCheck.cpp b/CommonCheck.cpp index d90eb1ba0..17a12be30 100644 --- a/CommonCheck.cpp +++ b/CommonCheck.cpp @@ -19,3 +19,16 @@ void ReportErr(const std::string errmsg) } //--------------------------------------------------------------------------- +bool IsName(const char str[]) +{ + return (str[0]=='_' || std::isalpha(str[0])); +} +//--------------------------------------------------------------------------- + +bool IsNumber(const char str[]) +{ + return std::isdigit(str[0]); +} +//--------------------------------------------------------------------------- + + diff --git a/CommonCheck.h b/CommonCheck.h index 112eae154..a6ae635cf 100644 --- a/CommonCheck.h +++ b/CommonCheck.h @@ -11,5 +11,9 @@ std::string FileLine(TOKEN *tok); void ReportErr(const std::string errmsg); + +bool IsName(const char str[]); +bool IsNumber(const char str[]); + //--------------------------------------------------------------------------- #endif