global.h

来自「编译原理下的作业词法分析器 它是用C++语言写的」· C头文件 代码 · 共 45 行

H
45
字号
#include <cstdio>
#include <cctype>
#include <map>
#include <string>
#include <cstring>
#include <utility>

#define BSIZE 100 //规定记号的长度小于100
#define NONE -1
#define EOS '\0'

#define NUM 256
#define ID 257
#define CONST 258
#define VAR 259
#define EQU 260
#define LESS_EQU 261
#define MORE_EQU 262
#define NOT_EQU 263
#define CALL 264
#define BEGIN 265
#define END 266
#define ODD 267
#define IF 268
#define THEN 269
#define WHILE 270
#define DO 271
#define DONE 273
#define PROCEDURE 274
#define EVU 275  //:=
#define LESS 276
#define MORE 277
using namespace std;

map<string,pair<int,int> > symtable;

struct entry
{
	char lexptr[BSIZE];
	int token;
};

char token[500][BSIZE];
int token_num;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?