合肥工业大学编译原理实验报告(完整代码版)_第1页
合肥工业大学编译原理实验报告(完整代码版)_第2页
合肥工业大学编译原理实验报告(完整代码版)_第3页
免费预览已结束,剩余20页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、计算机与信息学院编译原理 实验报告专业班级信息安全 131 班学生姓名及学号马骏 2013211869课程教学班号任课教师李宏芒实验指导教师李宏芒实验地点实验楼机房20152016 学年第 二 学期实验1 词法分析设计、 实验目得通过本实验得编程实践 ,使学生了解词法分析得任务 ,掌握词法分析程序设 计得原理与构造方法 ,使学生对编译得基本概念、原理与方法有完整得与清 楚得理解,并能正确地、熟练地运用、 实验要求1、编程时注意编程风格 :空行得使用、注释得使用、缩进得使用等。2、将标识符填写得相应符号表须提供给编译程序得以后各阶段使用。3、根据测试数据进行测试。测试实例应包括以下三个部分 :

2、全部合法得输入。各种组合得非法输入。 由记号组成得句子。4、词法分析程序设计要求输出形式 例:输入 VC+ 语言得实例程序 : If i=0 then n+;a= 3b %); 输出形式为 :单词二元序列(单词种别 ,单词属性 )类型位置(行,列)for(1,for )关键字(1,1)i( 6,i )标识符(1,2)12( 4,= )关系运算符(1,3)0( 5,0 )常数(1,4)then( 1,then)关键字(1,5)n(6,n )标识符(1,6)+ErrorError(1,7)( 2, ; )分界符(1,8)a(6,a )标识符(2,1)=(4,<= )关系运算符(2,2)3bE

3、rrorError(2,4)%ErrorError(2,4)( 2, ) )分界符(2,5)( 2, ; )分界符(2,6)用 VC+/VB/JA VA 语言实现对 C 语言子集得源程序进行词法分析。 通过 输 入源程序从左到右对字符串进行扫描与分解 ,依次输出各个单词得内部编 码及单 词符号自身值 ;若遇到错误则显示“ Error ”,然后跳过错误部分继续显示 ; 同时 进行标识符登记符号表得管理。 以下就是实现词法分析设计得主要工作 :(1) 从源程序文件中读入字符。(2) 统计行数与列数用于错误单词得定位。(3) 删除空格类字符 ,包括回车、制表符空格。(4) 按拼写单词 ,并用(内码,

4、属性)二元式表示。 (属性值 token 得机内 表示 )(5) 如果发现错误则报告出错7(6) 根据需要就是否填写标识符表供以后各阶段使用。四、实验步骤1、根据流程图编写出各个模块得源程序代码上机调试。2、编制好源程序后 ,设计若干用例对系统进行全面得上机测试 ,并通过所设计 得词法分析程序 ;直至能够得到完全满意得结果。3、书写实验报告 ;实验报告正文得内容 : 功能描述 :该程序具有什么功能?程序结构描述 :函数调用格式、参数含义、返回值描述、函数功能 ;函数 之间得调用关系图。详细得算法描述 (程序总体执行流程图 ) 。 给出软件得测试方法与测试结果。实验总结 (设计得特点、不足、收获

5、与体会 )。五、实验截图 先创建 salary 文件输入If i=0 then n+; a<= 3b %);六、核心代码#include<iostream>#include<string>#include<fstream>#include <sstream>using namespace std;const char* salaryfile="salary"const int max=40;string idmax="do","end","for","

6、if","printf","scanf","then","while"/ 关键 字表string /分界符表 算数运算符表 关系运算符表smax=",","","(",")","","","+","","*","/","<","<=","=&quo

7、t;string kmax;/ 标识符 string cimax;/ 常数 int fjfpoint=5;/ 分界符表尾 int mathpoint=9;/ 算数运算符表尾 int cipointer=0;/ 常数表尾 int idpointer=0;/ 关键字表尾int kpointer=0;/ 标识符表尾 int fjf;/0 不就是分界符 1 就是int rowy=1;/ 识别输入行位置int rowx=1;/ 识别输入列位置int outkey=0;/ 打印控制 0 为数字后有字母 其她可以 void searcht(int i,string m)/ 根据已识别得首字母识别字符串 /

8、cout<<"enter searcht!"<<endl;int x;if(i=0)/ 首字符就是字母识别关键字/ cout<<" a word!"<<endl; for(x=0;x<max;x+) if(idx=m) cout<<"(1,"<<idx<<")"<<" 关 ("<<rowy<<","<<rowx<<")

9、"<<endl;break;if(x=max)/ 不就是关键字再识别标识符 for(x=0;x<max;x+) if(kx=m) cout<<"(6,"<<m<<") "<<" 标 ("<<rowy<<","<<rowx<<")"<<endl;break;if(x=max)/ 标识符表没有时插入标识符 cout<<"(6,"<

10、;<m<<") "<<" 标 ("<<rowy<<","<<rowx<<")"<<endl;kkpointer=m; kpointer+;if(i=1)/ 识别常数/ cout<<" a number!"<<endl; for(x=0;x<max;x+)键字识符识符if(cix=m)cout<<"(5,"<<x<<&quo

11、t;)"<<endl; break;if(x=max)cout<<"(5,"<<m<<") 常数 cicipointer=m; cipointer+; if(i=2)/ 识别 分界符 算数运算符 / cout<<" a signal!"<<endl;for(x=0;x<max;x+)if(sx=m) break; / x;if(x<6) fjf=1; if(x>5&&x<10) if(outkey=1) cout<&l

12、t;"(3,"<<sx<<") ("<<rowy<<","<<rowx<<")"<<endl; outkey=0; fjf=0;if(x>9&&x<max1)if(outkey=1)cout<<"(4,"<<sx<<")("<<rowy<<","<<rowx<<&

13、quot;)"<<endl; outkey=0;("<<rowy<<","<<rowx<<")"<<endl;关系运算符算数运算符关系运算符fjf=0;if(x=max)if(outkey=1)cout<<"ErrorError ("<<rowy<<","<<rowx<<")"<<endl;outkey=0;fjf=0;void wo

14、rdlook(char t,string sn)/ 识别首字符 ,分类识别字符串if(t>=48&&t<=57) searcht(1,sn);else if(t>64&&t<91)|(t>96&&t<123) searcht(0,sn);else searcht(2,sn);void split(string s)/ 分割字符串/ cout<<s<<endl;string nowmax;string sn;int nowpointer=0;int i=0;int x;int sign=2

15、;/ 非法数字标志int diannumber=0;/ 数中点得个数 for(x=0;x<s 、 length;x+)if(sx>64&&sx<91)|(sx>96&&sx<123)|(sx>=48&&sx<=57)|(x>0& &sx=46&&sign=1)/ 判断数字后跟字母还就是字母后有数字if(i=0) if(sx>=48&&sx<=57) sign=1;else sign=2;elseif(sign=1)if(sx>=48&

16、amp;&sx<=57|sx=46)if(sx=46)if(diannumber=0) diannumber+;else sign=0;else sign=0;i+;if(x=(s 、 length1)sn=s、 substr(xi+1,i);if(i>0)/ cout<<sn<<" i="<<i<<endl;cout<<sn<<" "if(sign=0)/ 数字后有字母得情况Errorcout<<" Error("<<

17、rowy<<","<<rowx<<")"<<endl;else /字母开头得字符串/cout<<" true"<<endl;wordlook(sn0,sn);rowx+;elseif(x>0&&(sx1>64&&sx1<91)|(sx1>96&&sx1<123)|(sx1>=48&&sx1<=57)/ 遇到分界符运算符 如果前面就是数字或字母sn=s、 sub

18、str(xi,i);if(i>0)/ cout<<sn<<" i="<<i<<endl;cout<<sn<<" "if(sign=0)cout<<" Error Error ("<<rowy<<","<<rowx<<")"<<endl;else/ cout<<" true"<<endl; wordlook

19、(sn0,sn); rowx+;i=0;string ll=s 、substr(x,1);/ 判断就是运算符还就是分界符 wordlook(sx,ll);if(fjf=0)/ 就是运算符i+;if(sx+1>64&&sx+1<91)|(sx+1>96&&sx+1<123)|(sx+1>=48&&sx+1 <=57)/ 如果后面就是数字或字母sn=s、 substr(xi+1,i);/ cout<<sn<<" 运算符 i="<<i<<endl;c

20、out<<sn<<" "outkey=1;wordlook(sn0,sn);rowx+;i=0;if(fjf=1)if(sx1>64&&sx1<91)|(sx1>96&&sx1<123)|(sx1>=48&&sx1<=57)/ 如 果前面就是数字或字母else if(i>0)sn=s、substr(xi,i);/ cout<<sn<<" 运算符 i="<<i<<endl; cout<<

21、;sn<<" "outkey=1;wordlook(sn0,sn);rowx+;i=0;cout<<sx<<" (2,"<<sx<<") 分 界 符 ("<<rowy<<","<<rowx<<")"<<endl;rowx+;/* if(ll="")rowy+;rowx=1;*/;int mainint x;string instring;/ 读入一行stri

22、ng sn;/*getline(cin,sn);/ string 带空格输入cout<<sn<<endl;char t=sn0;if(t>=48&&t<=57)searcht(1,sn);elseif(t>64&&t<91)|(t>96&&t<123)searcht(0,sn);else searcht(2,sn);*/ifstream inputinput(salaryfile);/ inputfile>>noskipws;if(!inputfile)cout<<

23、;"no file"<<endl;string pp; while(!input) getline(input);istringstream istr(pp);string ppword;while(istr>>ppword)/ 按照空格分割字符串 split(ppword);/*int begin = 0;/ 去掉字符串得所有空格begin = pp 、find(" ",begin); /查找空格在 str 中第一次出现得位置 while(begin != 1) /表示字符串中存在空格pp 、replace(begin, 1,

24、""); / 用空串替换 str 中从 begin 开始得 1 个字 符begin = pp 、find(" ",begin); / 查找空格在替换后得 str 中第一次出现 得位置*/ cout<<"good "<<pp<<endl;/ rowx+;rowy+;/ 换行 rowx=1;return 0;七、实验总结通过本次试验使我不仅对词法分析器有了更深得了解,而且提高了编程能力,希望在以后得学习中可以解决词法分析更多得问题。实验 2 LL(1) 分析法、实验目得通过完成预测分析法得语法分析程序

25、,了解预测分析法与递归子程序法得区 别与联系。使学生了解语法分析得功能 ,掌握语法分析程序设计得原理与构 造方 法,训练学生掌握开发应用程序得基本方法。有利于提高学生得专业素质,为培养适应社会多方面需要得能力。、实验要求1、编程时注意编程风格 :空行得使用、注释得使用、缩进得使用等。2、如果遇到错误得表达式 ,应输出错误提示信息。3、对下列文法 ,用 LL(1) 分析法对任意输入得符号串进行分析 :(1) E>TG(2) G>+TG|TG(3) G>(4) T>FS(5) S>*FS|/FS(6) S>(7) F>(E)(8) F>i三、实验内容

26、 根据某一文法编制调试 LL ( 1 )分析程序 ,以便对任意输入得符号串 进行分析。构造预测分析表 ,并利用分析表与一个栈来实现对上述程序设计语言得 分 析程序。分析法得功能就是利用 LL(1) 控制程序根据显示栈栈顶内容、向前瞧符 号以及 LL(1) 分析表 ,对输入符号串自上而下得分析过程。四、实验步骤1、根据流程图编写出各个模块得源程序代码上机调试。2、编制好源程序后 ,设计若干用例对系统进行全面得上机测试 ,并通过所设计 得 LL(1)分析程序 ;直至能够得到完全满意得结果。3、书写实验报告 ;实验报告正文得内容 :写出 LL(1)分析法得思想及写出符合 LL(1) 分析法得文法。程

27、序结构描述 :函数调用格式、参数含义、返回值描述、函数功能 ;函数 之间得调用关系图。详细得算法描述 (程序执行流程图 ) 。 给出软件得测试方法与测试结果。 实验总结 (设计得特点、不足、收获与体会 )。五、实验截图六、核心代码#include<iostream> #include<string> using namespace std; string pp;/ 输出字符串 string hh="rn"/ 换行 const int max=50; int endfumax;/ 终止符序号表 int endfupointer=8; char endf

28、urealmax='+','','*','/','(','i',')','#' int unendfumax; int unendfupointer=5; char unendfurealmax='E','G','T','S','F' string makemathmax="E>TG","G>+TG","G>TG"

29、;,"G>$","T>FS","S>*FS","S>/ FS","S>$","F>(E)","F>i"/0 E>TG,1 G>+TG,2 G>TG,3 G>$,4 T>FS,5 S>*FS,6 S>/FS,7 S>$,8 F>(E),9 F>i /$代表空串string behaviormax=" 初始化 ","POP&quo

30、t;int smarttablemaxmax;/ 分析表int checkendfu(char fu)/ 查终结符序号int x; for(x=0;x<endfupointer;x+) if(endfurealx=fu) break;if(x<endfupointer)return x;else return 1;int checkunendfu(char fu)/ 查非终结符序号int x;for(x=0;x<unendfupointer;x+)if(unendfurealx=fu) break;if(x<unendfupointer)return x;else re

31、turn1;string checkmakemath(int x)/ 查产生式表return makemathx;int checksmarttable(int x,int y)/ 查分析表return smarttablexy;class smartboxpublic:smartboxbox0='#'box1='E'boxpointer=1;void push(char fu)boxpointer+; boxboxpointer=fu;char popchar a=boxboxpointer; if(a!='#')/cout<<&q

32、uot;pop: "<<boxpointer<<""<<a<<endl;/stringstream oss;/*pp=pp+"pop: "char buffermax; sprintf(buffer,"%d",boxpointer); string s=buffer;pp=pp+" " pp=pp+s; pp=pp+hh;*/boxpointer;return a;void check if(checkendfu(boxboxpointer)!=1) cha

33、r a;/ cout<<boxboxpointer<<checkendfu(boxboxpointer)<<" /char buffermax;/sprintf(buffer/pp=pp+boxboxpointer;/ pp=pp+checkendfu(boxboxpointer);/pp=pp+" "a=pop;/ cout<<"out "<<a<<endl;char boxmax;int boxpointer;int main/ TODO: Add extra vali

34、dation here动作 "+hh;/ pp=pp+" 步骤 分析栈 剩余输入串 所用产生式 /*string s1="sdsfs rnsdfsds"string s3="aaaaaaaaaaaaa" s3=s3+s1;CString s2(s3、c_str);/ CString s2=CString(s1);SetDlgItemText(IDC_EDIT2,s2);/ 用 SetDlgItemText( 文本框 ID,字符串 ),将文 本框得内容设置为字符串得内容、SetDlgItemText(IDC_EDIT2,s2);*/ M

35、essageBox(str);string str;cin>>str;int x,y;for(x=0;x<max;x+) /初始化分析表 99 为错误代号 for(y=0;y<max;y+)smarttablexy=99; smarttable04=0;smarttable05=0;smarttable10=1;smarttable11=2;smarttable16=3;smarttable17=3;smarttable24=4;smarttable25=4;smarttable30=7;smarttable31=7;smarttable32=5;smarttable3

36、3=5;smarttable36=7;smarttable37=7;smarttable44=8;smarttable45=9;smartbox mark;char fu;char enterfu;int endfunumber;int unendfunumber;string readyin;string enter;/ cin>>enter;/enter="i+i*i#"enter=str;/enter="(i)#"int count=0;/步骤char buffer1max; sprintf(buffer1,"%d"

37、,count);string s1=buffer1;pp=pp+s1+" "/分析栈for(int qq1=0;qq1<=mark 、 boxpointer;qq1+) pp=pp+mark 、boxqq1;for(qq1=0;qq1<10mark 、 boxpointer;qq1+)pp=pp+" "/剩余输入栈string jiequ1=enter 、substr(0,enter 、 length); pp=pp+jiequ1;for(int t1=0;t1<20;t1+) pp=pp+" "pp=pp+&quo

38、t;初始化 "+hh;for(x=0;x<enter 、 length;)/步骤count+;char buffermax;sprintf(buffer,"%d",count);string s=buffer;pp=pp+s+" "/分析栈for(int qq=0;qq<=mark 、 boxpointer;qq+)pp=pp+mark 、boxqq;for(qq=0;qq<10mark 、 boxpointer;qq+)pp=pp+" "/剩余输入栈string jiequ=enter 、 substr(

39、x,enter 、 lengthx); pp=pp+jiequ;for(int t=0;t<x+10;t+) pp=pp+" "enterfu=enterx;/ cout<<"enterfu: "<<enterfu<<endl; mark 、 check; fu=mark 、pop;/ cout<<"fu: "<<fu<<endl; if(fu='#')/&&enterfu='#') / cout<<

40、;"sucessed! over!"<<endl; pp=pp+"sucessed! over!"+hh; break; unendfunumber=checkunendfu(fu); endfunumber=checkendfu(enterfu);/ cout<<unendfunumber<<endl;/ cout<<endfunumber<<endl; if(smarttableunendfunumberendfunumber=99) pp=pp+"error!" bre

41、ak; readyin=makemathsmarttableunendfunumberendfunumber; pp=pp+readyin;for(int ddd=0;ddd<14readyin 、 length;ddd+) pp=pp+" " pp=pp+"POP,PUSH("for(y=readyin 、 length1;y>2;y) pp=pp+readyiny; pp=pp+")"+hh;/ cout<<"readyin: "<<readyin<<endl;

42、int firsttime=0;for(y=readyin 、 length1;y>2;y) / cout<<readyiny<<" " if(readyiny!='$') mark 、push(readyiny); if(firsttime=0) if(checkendfu(readyiny)!=1) /cout<<"now x: "<<x<<"/步骤 count+; char buffermax; sprintf(buffer,"%d",c

43、ount); string s=buffer; pp=pp+s+" "/分析栈for(int qq=0;qq<=mark 、 boxpointer;qq+) pp=pp+mark 、boxqq;for(qq=0;qq<10mark 、 boxpointer;qq+) pp=pp+" "/剩余输入栈string jiequ=enter 、 substr(x,enter 、 lengthx); pp=pp+jiequ;for(int t=0;t<x+10;t+) pp=pp+" "pp=pp+" GETNEXT

44、(I)"+hh;x+;/ cout<<"next x: "<<x<<" "<<endl; firsttime=1;mark 、 check;/ cout<<endl; / pp=pp+hh; cout<<pp; return 0;/CDialog:OnOK;七、实验总结 通过本次试验使我不仅对 ll(1) 分析法有了更深得了解 ,而且提高了编程能 力 ,希望在以后得学习中可以解决自动构造 follow 集得问题。实验 3 LR(1) 分析法、实验目得构造 LR(1)分析程序

45、 ,利用它进行语法分析 ,判断给出得符号串就是否为该文 法识别得句子 ,了解 LR(K) 分析方法就是严格得从左向右扫描 ,与自底向上 得语法分析方法。、实验要求1、编程时注意编程风格 :空行得使用、注释得使用、缩进得使用等。2、如果遇到错误得表达式 ,应输出错误提示信息。3、程序输入 /输出实例 : 输入一以#结束得符号串 (包括+*i#):在此位置输入符号串 输出过程如下 :步骤状态栈符号栈剩余输入串动作10#i+i*i#移进i+i*i得 LR 分析过程步骤状态栈 符号栈输入串动作说明10# i+i*i#ACTION0,i=S5, 状态 5 入栈205#i+i*i#r6: Fi 归约 ,G

46、OTO(0,F)=3 入栈303#F+i*i#r4: TF 归约 ,GOTO(0,T)=3 入栈402#T+i*i#r2: ET 归约 ,GOTO(0,E)=1 入栈501#E+i*i#ACTION1,+=S6, 状态 6 入栈6 016 #E+ i*i# ACTION6,i=S5, 状态 5 入栈7 0165 #E+i *i# r6: F i 归约,GOTO(6,F)=3 入栈8 0163 #E+F *i# r4: TF 归约 ,GOTO(6,T)=9 入栈9 0169 #E+T *i# ACTION9,*=S7, 状态 7 入栈10 01697 #E+T* i# ACTION7,i=S5,

47、 状态 5 入栈11 016975 #E+T*i # r6:F i 归约,GOTO(7,F)=10 入栈12 0169710 #E+T*F # r3: TT*F 归约 ,GOTO(6,T)=9 入栈13 0169 #E+T # r1:EE+T,GOTO(0,E)=1 入栈14 01 #E # Acc: 分析成功三、实验内容对下列文法 ,用 LR(1)分析法对任意输入得符号串进行分析 :(1) E> E+T(2) E>T(3) T> T*F(4) T>F(5) F> (E)(6) F> i四、实验步骤1、根据流程图编写出各个模块得源程序代码上机调试。2、编制好

48、源程序后 ,设计若干用例对系统进行全面得上机测试 ,并通过所设计 得 LR(1)语法分析程序 ; 直至能够得到完全满意得结果。3、书写实验报告 ;实验报告正文得内容 :描述 LR(1)语法分析程序得设计思想。程序结构描述 :函数调用格式、参数含义、返回值描述、函数功能 ;函数之间得调用关系图。详细得算法描述 (程序执行流程图 ) 给出软件得测试方法与测试结果。五、实验截图六、核心代码#include<iostream>#include<string> using namespace std;int count=1;string pp;/ 输出字符串string hh=&

49、quot;rn"/ 换行const int max=100;char endfurealmax='i','+','*','(',')','#','E','T','F'int endfupointer=8;string creatwordmax="E>E+T","E>T","T>T*F","T>F","F>(E)",

50、"F>i"/(0)E> E+T(1)E>T (2)T> T*F (3)T>F (4)F> (E) (5)F> i/注意 rj 时 j 应对应数组下标int checkendfu(char fu)/ 查终结符序号int x; for(x=0;x<=endfupointer;x+)if(endfurealx=fu)break; if(x<=endfupointer) return x; else return 1;class actiongo/原子动作 public:actiongo/ cout<<"e

51、roor! wrong action or goto creat"<<endl; actype=4; action(int i,int j) actype=i; number=j;/ cout<<i<<" "<<j<<endl;int actype;/0=s 1=r 2=acc 3=goto 表 4=wrongint number;actiongo smarttablemaxmax;class stylebox/状态栈public: styleboxbox0=0; boxpointer=0;void pu

52、sh(int style) boxpointer+; boxboxpointer=style;int popint a=boxboxpointer; boxpointer;/cout<<"pop now"<<endl;return a;int boxmax;int boxpointer;class readybox/已归约栈public: readybox box0='#' boxpointer=0;void push(char fu)boxpointer+; boxboxpointer=fu; char popchar a=boxb

53、oxpointer;boxpointer;return a;char boxmax;int boxpointer;ptr,intint program(stylebox&style,readybox&ready,char fu,int icount,string control)/ 返回就是否需要移进信号 if(control=1)/ char bermax; sprintf(ber,"%d",count); string st=ber; pp=pp+st+" " count+;/pp=pp+" " for(int q

54、q=0;qq<=style 、 boxpointer;qq+) char bssmax;sprintf(bss,"%d",style 、 boxqq); string st=bss; pp=pp+st;for(qq=0;qq<10style 、 boxpointer;qq+) pp=pp+" "for( qq=0;qq<=ready 、boxpointer;qq+) pp=pp+ready 、boxqq;for(qq=0;qq<10ready 、 boxpointer;qq+)pp=pp+" "for(int

55、dj=icount;dj<ptr 、length;dj+)pp=pp+ptrdj;pp=pp+" "/int i=style 、pop;/ 如果就是 s 则状态还要入栈/ cout<<" 现在状态 "<<i;int j=checkendfu(fu);if(j=1)pp=pp+"error!"return 4;/wrong!/ cout<<" 现在符号 : "<<fu<<" "<<j<<endl;int ch

56、eckstyle=smarttableij 、actype;/ 查表 if(checkstyle=4)pp=pp+"error!"return 4;/wrong!if(checkstyle=0|checkstyle=3)style、push(i);/ 如果就是 s 则状态还要入栈 if(checkstyle=0)number<<", 状 /cout<<"ACTION"<<i<<","<<fu<<"=S"<<smarttab

57、leij 态"<<smarttableij 、 number<<" 入栈 "<<endl; pp=pp+"ACTION"char buffermax;sprintf(buffer,"%d",i);string s=buffer;pp=pp+s;pp=pp+","pp=pp+fu;pp=pp+"=S"char bufmax;sprintf(buf,"%d",smarttableij 、 number); s=buf;pp=pp+s;

58、pp=pp+", 状态 "pp=pp+s+" 入栈 "+hh;if(checkstyle=3)/ cout<<i<<","<<endfurealj<<")="<<smarttableij 入栈 "<<endl;char bfmax;sprintf(bf,"%d",i);string s=bf;pp=pp+s;pp=pp+","+endfurealj+")="char bfff

59、max; sprintf(bfff,"%d",smarttableij、 number);s=bfff;pp=pp+s+" 入栈 "+hh;ready、push(fu);style、 push(smarttableij 、 number);/cout<<style 、 boxstyle 、boxpointer<<endl;return 1;/ 移进if(checkstyle=1)string l=creatwordsmarttableij 、 number;/ cout<<"r"<<sm

60、arttableij 、 number+1<<": "<<l<<" pp=pp+"r"int dd=smarttableij 、 number+1;char bfcmax;sprintf(bfc,"%d",dd);string ss=bfc;pp=pp+ss+": "+l+" 归约 ,GOTO("char n;/pop 用得、 number<<"归约,GOTO("int x;/ cout<<l 、length<<endl;char sq=ready 、pop;for(x=0;x<l 、 leng

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论