signrule.h

来自「这是一个用c++写的预测分析法程序,是编译原理课程设计的内容,可以预测分析语言」· C头文件 代码 · 共 45 行

H
45
字号

#include <windows.h>

#define  MAX_RULE_LEN   30
#define  END_SIGN       '#'
#define  IsNonTerminalSign(ch)  (ch >= 'A' && ch <= 'Z')

typedef int          STATE;
typedef char         SIGN;

struct   RULE
{
	SIGN   Left;
	SIGN   Right[MAX_RULE_LEN + 1];
	RULE();
	RULE(const RULE&);	
	void  operator=(const RULE&);	
	bool  operator==(const RULE&);
};

class SIGN_SET
{
public:
	SIGN_SET();
	SIGN_SET(const SIGN_SET&);	
	~SIGN_SET();
	
	int  GetSignNum();	
	bool IsSignInSet(SIGN);
	bool AppendSign(SIGN,bool CanRepeat = false);	
	bool DeleteSign(SIGN,bool CheckRepeat = false);
	bool DeleteSign(int);

	SIGN operator[](int);
	void operator=(const SIGN_SET&);
	void operator=(const SIGN*);
	bool operator+=(const SIGN_SET&);

	void Reset();
	void Output();
	
private:
	SIGN* pSigns;
	int   SignNum;
};

⌨️ 快捷键说明

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