实验四 中间代码生成.docVIP

  • 49
  • 0
  • 约 6页
  • 2017-01-11 发布于重庆
  • 举报
实验四 中间代码生成 实验要求: 熟悉中间代码生成原理 二:实验内容: 中缀表达式:(a+2)*(b/c)+(d*e) 后缀表达式:a 2 + b c / * d e * + 定义:int a,b; char c; float d,e; 三、实验代码: #includeprocess.h #includestdio.h #includestring.h typedef struct{ char name[10]; char type;//数据类型 }sem,*ptsem; typedef struct{ ptsem* base; int utop; }stack ;//语义信息栈 int i=1; int j=0; int n=0; stack list; char st[10],str1[10],*p; ptsem yylist=new sem[10]; void initlist()//初始化 { list.base=new ptsem[100]; list.utop=0; } void pop( ptsem pt) { pt=list.base[list.utop--]; return; } void push(ptsem pt) { list.b

文档评论(0)

1亿VIP精品文档

相关文档