⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 predictiveparser.h

📁 此为编译原理的作业中的预测分析表的生成的原代码
💻 H
字号:
#ifndef PREDICIVEPARSER_H
#define PREDICIVEPARSER_H
#include"wenfa.h"
#include"wenfa.cpp"
#include"Stack.h"
#include"Stack.cpp"
const int r=40;
typedef struct FI_FOL{
	char *element;//存放集合元素
	char text;//非终结符
	int cnt;//元素个数
	bool *bo_link;//是否赋了那个first或follow的值
}*FIRST,*FOLLOW;
class PrePar : public WenFa{//预测分析类并继承文法类
private:
	FIRST first;//first 集合
	FOLLOW follow;// follow 集合
	int VN_NUM;
    int VT_NUM;
	int (*table)[r];	
	char *Str,*scopy;//存放需要判断的字符串
public:
	PrePar();
	~PrePar();
	int Search_text(char s);
	bool Equal(char *p1,char *p);//判断p1中是否已经有p 了
	void fo_fCat(struct FI_FOL *fo_f);//集合相等的都赋值
	void Fin_first(void);//形成first集合
	void print(bool b);
	bool bool_kou(char s);
	void Fin_follow(void);//求follow集合
	int Test(struct FI_FOL *f,int a);
	int Search_VN(char ch);//在非终结符中找	 
	int Search_VT(char c);	
	void CreateTable();
	void PrintTable();
	char get();
	void  Error();
	void Fenxi();
	void Init();
};
#endif

⌨️ 快捷键说明

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