TINY扩充语言的语法分析

时间:2022-01-27 09:42:52
【文件属性】:

文件名称:TINY扩充语言的语法分析

文件大小:145KB

文件格式:RAR

更新时间:2022-01-27 09:42:52

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 (5) 大于>比较运算符号以及求余计算式子的文法规则请自行组织。 (6) 把TINY语言原有的if语句书写格式 if_stmt-->if exp then stmt-sequence end | | if exp then stmt-sequence else stmt-sequence end 改写为: if_stmt-->if(exp) stmt-sequence else stmt-sequence | if(exp) stmt-sequence 二、要求: (1)要提供一个源程序编辑界面,以让用户输入源程序(可保存、打开源程序) (2)可由用户选择是否生成语法树,并可查看所生成的语法树。 (3)应该书写完善的软件文档


【文件预览】:
lab 3
----Tiny实验报告.docx(132KB)
----tiny()
--------mainwindow.ui(3KB)
--------实验3 内容及要求.txt(2KB)
--------mainwindow.cpp(6KB)
--------tiny.pro.user(43KB)
--------test3.txt(257B)
--------test2.txt(237B)
--------globals.h(2KB)
--------util.cpp(5KB)
--------main.cpp(183B)
--------test1.txt(253B)
--------mainwindow.h(2KB)
--------util.h(698B)
--------scan.cpp(6KB)
--------scan.h(322B)
--------mymain.h(1KB)
--------parse.cpp(6KB)
--------tiny.pro(1KB)
--------parse.h(147B)

网友评论