我目前正在为XML编写令牌识别器。我是按照金融服务管理局的规定来做的。所以我有一个头文件,它有以下代码…
#define MAX_LENGTH 512
#define MAX_NAME 25
struct token
{
char name[MAX_NAME + 1];
int type;
unsigned char str[MAX_LENGTH + 1];
};
#define TOKEN_TYPES 8
#define SPACES 0
#define NEWLINE 1
#define WORD 2
#define BEGINTAG 3
#define ENDTAG 4
#define EMPTYTAG 5
#define ERROR 6
#define ENDFILE 7
这样我就得到了错误:
error C2011: 'token' : 'struct' type redefinition
我也有一个奇怪的错误
gettoken.cpp
文件。在那里我实际执行了FSA。文件太长,无法显示全部内容。但是有了这个,我得到了错误…
error C1014: too many include files : depth = 1024
这是该.cpp文件的部分代码。我只会把我的进口货包括在这里面。
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string>
#include "Token.h"
using namespace std;
我相信这是一件很愚蠢的事情,因为它通常对我来说。但请帮帮我!谢谢!