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

📄 analysis.h

📁 简单赋值语句翻译成四元式 (编译原理实验)
💻 H
字号:
#ifndef GUARD_analysis
#define GUARD_analysis
#include <string>
#include <vector>
using namespace std;

//int k;
//string kys[]={"t0","t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","t14","t15"};


struct four_node{
	string opt;
	string arg1;
	string arg2;
	string result;
};

struct node{
	string words;
	int flag;
	node *next;
	node *up;
};

class analyse{
	struct  team{
	string type;
	string word;
	};

	string keys[16];
    vector<string> key;   //关键字
	vector<string> s_word;//单词
	vector<team> str_word;//分析后的类型
    vector<string> expressions;
	vector<four_node> four_node_expr;
	string text;          //文本内容
	
	int begin,end;        //文本内容时的指针
	public:
		analyse();
		void Get_text();
		void Get_word();
		bool Is_boundary(string str);
		bool Is_macthsign(string str);
		void find_key();
		bool Is_key(string str);
		string get_word( );
		void text_analysis( );
		void display( );
		//-------------------------------
		void find_Expression();
		void ana_Expression(string::size_type index,string::size_type i,int j);
		void Get_first_sign(node * &head,node * q1,int &k);
		void get_result(node * &head,node * &q,int &k);
};
#endif

⌨️ 快捷键说明

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