global.h

来自「基于c语言编写的关于编译中的词法分析算法的编程」· C头文件 代码 · 共 25 行

H
25
字号

//一些变量和数据结构的定义

#ifndef _GLOBAL_H
#define _GLOBAL_H

#include <stdio.h>
#include <ctype.h>
#include <string>
using namespace std;

# define  MAX 6 //分析表的最大容量
#define   MAXBUF 255

char  ch =' ';// 存放读入当前的输入字符
int lineno;//程序行数
struct entry{
			  const	char *lexptr;
				int token;
			};//关键字表中的结构

 struct entry symtable[MAX];//分析表
static string  str[] = { "if","then","else","while","begin","end"};//关键字

#endif

⌨️ 快捷键说明

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