文件名称:SLR1
- 所属分类:
- 编译器/词法分析
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 13kb
- 下载次数:
- 0次
- 提 供 者:
- chi***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
在VC下打开LRTrans1.dsp,阅读工程LRTrans1,LRTrans1为一个加、乘(适当扩充可为四则)运算表达式的SLR语法分析器,规定其文法如下:
文法3:
(0) S ->E
(1) E->E+E
(2) E->E*E
(3) E->(E)
(4) E->i
经分析其SLR(1)分析表如下(分析表按“操作符运算优先级和运算符的结合率”方法解决冲突——*优先集高于+,*和+的结合率均为左结合)
-In the VC to open LRTrans1.dsp, read the works LRTrans1, LRTrans1 as a plus, by (the appropriate expansion for 4) expression is the SLR parser, the provisions of the grammar as follows: Grammar 3: (0) S' -> E (1) E-> E+ E (2) E-> E* E (3) E-> (E) (4) E-> i by the analysis of the SLR (1) of the table as follows (of the table by " operation Fu operator precedence and operator binding rate " method of conflict resolution priority set higher than the+--*,* and+ binding rate for both left-associative)
文法3:
(0) S ->E
(1) E->E+E
(2) E->E*E
(3) E->(E)
(4) E->i
经分析其SLR(1)分析表如下(分析表按“操作符运算优先级和运算符的结合率”方法解决冲突——*优先集高于+,*和+的结合率均为左结合)
-In the VC to open LRTrans1.dsp, read the works LRTrans1, LRTrans1 as a plus, by (the appropriate expansion for 4) expression is the SLR parser, the provisions of the grammar as follows: Grammar 3: (0) S' -> E (1) E-> E+ E (2) E-> E* E (3) E-> (E) (4) E-> i by the analysis of the SLR (1) of the table as follows (of the table by " operation Fu operator precedence and operator binding rate " method of conflict resolution priority set higher than the+--*,* and+ binding rate for both left-associative)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
SLR1\gram.cpp
....\gram.h
....\rstack.cpp
....\rstack.h
....\SLR1.dsp
....\SLR1.dsw
....\SLR1.ncb
....\SLR1.opt
....\SLR1.plg
....\SLR1.sln
....\SLR1.suo
....\SLR1.vcproj
....\SLR1.vcproj.TCL-1BD8B03B4C4.Sun.user
....\Debug
SLR1
....\gram.h
....\rstack.cpp
....\rstack.h
....\SLR1.dsp
....\SLR1.dsw
....\SLR1.ncb
....\SLR1.opt
....\SLR1.plg
....\SLR1.sln
....\SLR1.suo
....\SLR1.vcproj
....\SLR1.vcproj.TCL-1BD8B03B4C4.Sun.user
....\Debug
SLR1