data.cpp
来自「与vc++界面十分类似的词法分析器」· C++ 代码 · 共 47 行
CPP
47 行
#include "stdafx.h"
#include "Data.h"
int IsKeyWord(LPCTSTR pszChars, int nLength)
{
for (int L = 0; KeywordList[L] != NULL; L ++)
{
if (strncmp(KeywordList[L], pszChars, nLength) == 0
&&KeywordList[L][nLength] == 0)
return L;
}
return -1;
}
int IsOperator(LPCTSTR pszChars, int nLength)
{
for (int L = 0; OperateorList[L] != NULL; L ++)
{
if (strncmp(OperateorList[L], pszChars, nLength) == 0
&&OperateorList[L][nLength] == 0)
return L;
}
return -1;
}
int IsBoundary(char *pszChars)
{
char ch;
for (int L = 0; BoundaryList[L] != NULL; L ++)
{
ch=BoundaryList[L];
if (strncmp(&ch, pszChars,1) == 0)
return L;
}
return -1;
}
void SpliterPath(CString Path)
{
/*memset(drive,0,_MAX_DRIVE);
memset(dir,0,_MAX_DIR);
memset(fname,0,_MAX_FNAME);
memset(ext,0,_MAX_EXT);
_splitpath(Path,drive,dir,fname,ext);*/
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?