cifa.h

来自「c语言做的pl0编译器」· C头文件 代码 · 共 37 行

H
37
字号
// cifa.h: interface for the cifa class.
//////////////////////////////////////////////////////////////////////
#ifndef __CIFA_H
#define __CIFA_H
#include <stdio.h>
#include "symset.h"
#include "pl0.h"
#define IDENT_LENGTH	9		        //标识符最长长度
#define NUMBER_LENGTH	14		        //最大数位
#define MAX_NUMBER		2047	        //最大整数

class CCifa
{
public:
	CCifa(CPlCompiler * );
	~CCifa();
	symbol GetSymbol();
	int GetLine() {return line;}
public:
	char id[IDENT_LENGTH+1];
	int num;
private:
	void create_ht();
	int hushsrch(char *word);
	int hush(char *s);			        //哈希函数
private:
	struct word_table{
		char word[IDENT_LENGTH+1];
		symbol sym;
	}	*wt;			                //关键字表
	char ht[20];	                    //关键字的哈希表
	char ch;                            //当前字符
	int line;		                    //行号
	CPlCompiler *pl;
};

#endif

⌨️ 快捷键说明

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