文件名称:lab2
-
所属分类:
- 标签属性:
- 上传时间:2013-03-16
-
文件大小:307kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
实验二:TINY扩充语言的语法分析
扩充的语法规则有:实现 while、do while、for语句和求余计算式子,具体文法规则自行构造。
可参考:P97及P136的文法规则。
(1) While-stmt --> while exp do stmt-sequence endwhile
(2) Dowhile-stmt-->do stmt-sequence while exp
(3) for-stmt-->for identifier:=simple-exp to simple-exp do stmt-sequence enddo 步长递增1
(4) for-stmt-->for identifier:=simple-exp downto simple-exp do stmt-sequence enddo 步长递减1
可由用户选择是否生成语法树,并可查看所生成的语法树。-Experiment II: TINY extension language syntax analysis of the expansion of grammar rules: to achieve the while, do while, for statement and the remainder calculation formulas, specific grammar rules to construct their own. Reference: P97 and P136 grammar rules. (1) While-stmt-> while exp do stmt-sequence endwhile (2) Dowhile-stmt-> do stmt-sequence while exp (3) for-stmt-> for identifier: = simple-exp to simple- exp do stmt-sequence enddo increments of 1 (4) for-stmt-> for identifier: = simple-exp downto simple-exp do stmt-sequence enddo variety step decrement by the user to choose whether to generate a syntax tree, and view generated syntax tree.
扩充的语法规则有:实现 while、do while、for语句和求余计算式子,具体文法规则自行构造。
可参考:P97及P136的文法规则。
(1) While-stmt --> while exp do stmt-sequence endwhile
(2) Dowhile-stmt-->do stmt-sequence while exp
(3) for-stmt-->for identifier:=simple-exp to simple-exp do stmt-sequence enddo 步长递增1
(4) for-stmt-->for identifier:=simple-exp downto simple-exp do stmt-sequence enddo 步长递减1
可由用户选择是否生成语法树,并可查看所生成的语法树。-Experiment II: TINY extension language syntax analysis of the expansion of grammar rules: to achieve the while, do while, for statement and the remainder calculation formulas, specific grammar rules to construct their own. Reference: P97 and P136 grammar rules. (1) While-stmt-> while exp do stmt-sequence endwhile (2) Dowhile-stmt-> do stmt-sequence while exp (3) for-stmt-> for identifier: = simple-exp to simple- exp do stmt-sequence enddo increments of 1 (4) for-stmt-> for identifier: = simple-exp downto simple-exp do stmt-sequence enddo variety step decrement by the user to choose whether to generate a syntax tree, and view generated syntax tree.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lab2/analyze.c
lab2/analyze.h
lab2/cgen.c
lab2/cgen.h
lab2/code.c
lab2/code.h
lab2/Debug/analyze.obj
lab2/Debug/analyze.sbr
lab2/Debug/cgen.obj
lab2/Debug/cgen.sbr
lab2/Debug/code.obj
lab2/Debug/code.sbr
lab2/Debug/lab2.bsc
lab2/Debug/lab2.exe
lab2/Debug/lab2.ilk
lab2/Debug/lab2.pch
lab2/Debug/lab2.pdb
lab2/Debug/main.obj
lab2/Debug/main.sbr
lab2/Debug/parse.obj
lab2/Debug/parse.sbr
lab2/Debug/r.tm
lab2/Debug/r.tny
lab2/Debug/sample.tny
lab2/Debug/scan.obj
lab2/Debug/scan.sbr
lab2/Debug/symtab.obj
lab2/Debug/symtab.sbr
lab2/Debug/util.obj
lab2/Debug/util.sbr
lab2/Debug/vc60.idb
lab2/Debug/vc60.pdb
lab2/globals.h
lab2/lab2.dsp
lab2/lab2.dsw
lab2/lab2.ncb
lab2/lab2.opt
lab2/lab2.plg
lab2/main.c
lab2/parse.c
lab2/parse.cpp
lab2/parse.h
lab2/sample.tm
lab2/sample.tny
lab2/scan.c
lab2/scan.h
lab2/symtab.c
lab2/symtab.h
lab2/util.c
lab2/util.h
lab2/Debug
lab2
lab2/analyze.h
lab2/cgen.c
lab2/cgen.h
lab2/code.c
lab2/code.h
lab2/Debug/analyze.obj
lab2/Debug/analyze.sbr
lab2/Debug/cgen.obj
lab2/Debug/cgen.sbr
lab2/Debug/code.obj
lab2/Debug/code.sbr
lab2/Debug/lab2.bsc
lab2/Debug/lab2.exe
lab2/Debug/lab2.ilk
lab2/Debug/lab2.pch
lab2/Debug/lab2.pdb
lab2/Debug/main.obj
lab2/Debug/main.sbr
lab2/Debug/parse.obj
lab2/Debug/parse.sbr
lab2/Debug/r.tm
lab2/Debug/r.tny
lab2/Debug/sample.tny
lab2/Debug/scan.obj
lab2/Debug/scan.sbr
lab2/Debug/symtab.obj
lab2/Debug/symtab.sbr
lab2/Debug/util.obj
lab2/Debug/util.sbr
lab2/Debug/vc60.idb
lab2/Debug/vc60.pdb
lab2/globals.h
lab2/lab2.dsp
lab2/lab2.dsw
lab2/lab2.ncb
lab2/lab2.opt
lab2/lab2.plg
lab2/main.c
lab2/parse.c
lab2/parse.cpp
lab2/parse.h
lab2/sample.tm
lab2/sample.tny
lab2/scan.c
lab2/scan.h
lab2/symtab.c
lab2/symtab.h
lab2/util.c
lab2/util.h
lab2/Debug
lab2
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.