急需词法分析代码

来源:百度知道 编辑:UC知道 时间:2024/06/30 15:36:34
我想求的一个简单一点的用C++编写的词法分析的源代码,最好附上文字说明。时间紧迫,最好在30分钟内给我回复。

#include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#include <ctype.h>
using namespace std;
// 保留字数组定义
char* ReserveWords[35] = {
"and", "array", "begin", "case", "const", "div", "do", "downto", "else", "end", "file",
"for", "function", "goto", "if", "in", "label", "mod", "nil", "not", "of", "or", "packed",
"procedure", "program", "record", "repeat", "set", "then", "to", "type", "until", "var",
"