合工大编译原理实验报告,后面附代码,孩纸,只能参考不能抄袭哦,好好学习天天向上,
struct LL//ll(1)分析表的构造字初始化 {
char*c; };
LL E[8]={"TG","TG","error","error","error","error","error","error"}; LL G[8]={"error","error","null","+TG","-TG","error","error","null"}; LL T[8]={"FS","FS","error","error","error","error","error","error"}; LL S[8]={"error","error","null","null","null","*FS","/FS","null"}; LL F[8]={"i","(E)","error","error","error","error","error","error"};
class stack//栈的构造及初始化 {
public:
stack();//初始化
bool empty() const;//是否为空 bool full() const;//是否已满
bool get_top(char &c)const;//取栈顶元素 bool push(const char c);//入栈 bool pop();//删除栈顶元素 void out();//输出栈中元素 ~stack(){}//析构 private:
int count;//栈长度
char data[MaxLen];//栈中元素 };
stack::stack() {
count=0; }
bool stack::empty() const {
if(count==0) return true; return false; }
bool stack::full() const {
if(count==MaxLen) return true; return false; }
bool stack::get_top(char &c)const {
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新高等教育编译原理实验报告-合肥工业大学版(13)全文阅读和word下载服务。
相关推荐: