一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)

上传人:豆浆 文档编号:43430184 上传时间:2018-06-06 格式:DOC 页数:59 大小:537KB
返回 下载 相关 举报
一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)_第1页
第1页 / 共59页
一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)_第2页
第2页 / 共59页
一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)_第3页
第3页 / 共59页
一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)_第4页
第4页 / 共59页
一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)_第5页
第5页 / 共59页
点击查看更多>>
资源描述

《一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)》由会员分享,可在线阅读,更多相关《一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计—计算机毕业设计(论文)(59页珍藏版)》请在金锄头文库上搜索。

1、学学 位位 论论 文文一个编译原理语法分析器的实现与设计一个编译原理语法分析器的实现与设计论论文作者姓名:文作者姓名:申申请请学位学位专业专业: :申申请请学位学位类别类别: :指指导导教教师师姓姓名名( (职职称称) ): :论论文提交日期:文提交日期:一个编译原理语法分析器的实现一个编译原理语法分析器的实现与设计与设计摘摘 要要编译程序一般由词法分析程序、语法分析程序、语义分析程序、中间代码生成程序、目标代码生成程序、代码优化程序、表格管理程序和出错处理程序等成分构成。在编译原理的教学过程中,算法的讲解都需要对算法进行详细的分析,包括算法条件的判断,文法分析表的构造过程,文法分析表的具体生

2、成,针对文法的句子的分析过程等,这些过程往往需要占用大量时间来分析、制表等。本软件的主要任务就是利用程序来完成算法的上述相关过程,以达到高效,直观的效果。本文旨在介绍语法分析方法中的一种自上而下的分析方法LL(1)分析法。所谓 LL(1)分析法是指语法分析是按自左至右的顺序向前查看一个输入字符串,并分析过程中产生句子的最左推导。关键词关键词:编译;语法分析;LL(1)算法;演示The Design and Implementation of A Syntax Analyzer based on Compilation Theory AbstractThe compiler generally

3、is made up of the lexical analyzer program, the syntax analysis program, the semantics analysis program, the inter-language production procedure, the goal code production procedure, the code optimization procedure, the form executive program and the procedure of disposing mistakes. In the teaching p

4、rocess of compiler principle, all algorithm explanation needs to be explain clearly, including algorithm condition judgment, grammar analytical table structure process, grammar analytical table concrete production, in view of grammar sentence analysis process and so on. These processes often take mu

5、ch time to analyze, the scheduling and so on. This program mainly work is to complete the algorithm which take advantage of the procedure to deal with those above mentioned processes , in order to save time. The paper aims at introducing a syntax analytical method named LL(1) algorithm which from th

6、e up to down. The syntax analyzer analyzes the character string beginning from the left to right one word each time and educes the most left deduction of the sentence in the analyze course.Key words: compiler; grammar analysis; LL(1) algorithm; demonstrate目目 录录论文总页数:22 页1 引言 .11.1 项目背景 .11.2 目标 .11.

7、3 名词解释 .11.4 算法简介 .21.4.1 自顶向下分析 .21.4.2 递归子程序.31.4.3 LL(K)分析方法.41.4.4 LL(1)分析方法.41.4.5LL(1)分析表.52 系统流程图.62.1 程序流程图 .62.2 系统模块流程图.73 系统实施.73.1 文件读取模块 .83.1.1 文件读取使用的 CommonDialog 控件介绍 .83.1.2 文法左递归的判断 .93.2 算法分析模块 .93.2.1 求 select 集 .93.2.2 求 first 集 .103.2.3 求 follow 集 .103.3 分析表构造模块 .123.3.1 构造文法分析表 .123.3.2A:=a 规则 .133.3.3A:=D 规则 .133.3.4A:= 规则 .133.4 句子分析模块 .133.4.1 读取句子 .143.4.2 分析句子 .144 特殊问题及解决方法.144.1 Select 集的求解 .154.1.1 问题描述.154.1.2 解决方案.154.1.3 解决结果.154.2 为 ListBox 添加水平滚动条 .154.2.1 问题描述.154.2.2 解决方案.154.2.3 解决结果.165 结果测试.165.1 测试正确文法 .165.2 测试错误文法 .19结 论.20参考文献.20致 谢.21声 明.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号