- 70
- 0
- 约1.39万字
- 约 23页
- 2018-01-26 发布于贵州
- 举报
简单的编译原理语法分析器的实现
简单的编译原理语法分析器的实现
摘 要
编译程序一般由词法分析程序、语法分析程序、语义分析程序、中间代码生成程序、目标代码生成程序、代码优化程序、表格管理程序和出错处理程序等成分构成。在编译原理的教学过程中,算法的讲解都需要对算法进行详细的分析,包括算法条件的判断,文法分析表的构造过程,文法分析表的具体生成,针对文法的句子的分析过程等,这些过程往往需要占用大量时间来分析、制表等。本软件的主要任务就是利用程序来完成算法的上述相关过程,以达到高效,直观的效果。本文旨在介绍语法分析方法中的一种自上而下的分析方法——LL(1)分析法。所谓LL(1)分析法是指语法分析是按自左至右的顺序向前查看一个输入字符串,并分析过程中产生句子的最左推导。
关键词:编译;语法分析;LL(1)算法;演示
The Design and Implementation of A Syntax Analyzer based on Compilation Theory
Abstract
The compiler generally 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 process 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 much 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 the 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引言 1
1.1项目背景 1
1.2目标 1
1.3名词解释 1
1.4算法简介 2
1.4.1自顶向下分析 2
1.4.2 递归子程序 3
1.4.3 LL(K)分析方法 4
1.4.4 LL(1)分析方法 4
1.4.5LL(1)分析表 5
2 系统流程图 6
2.1程序流程图 6
2.2 系统模块流程图 7
3 系统实施 7
3.1文件读取模块 8
3.1.1文件读取使用的CommonDialog控件介绍 8
3.1.2文法左递归的判断 9
3.2算法分析模块 9
3.2.1求select集 9
3.2.2求first集 10
3.2.3求follow集 10
3.3分析表构造模块 12
3.3.1构造文法分析表 12
3.3.2A::=aβ规则 13
3.3.3A::=Dβ规则 13
3.3.4A::=ε规则 13
您可能关注的文档
- 牡丹江曙光新城项目营销策略方案_81PPT.ppt
- 物价变动时投资决策研究.doc
- 物化法降解含聚丙烯酰胺废水的研究进展.doc
- 物流快递管理系统.doc
- 物流管理在B2C电子商务企业中的应用研究--以京东商城为例.doc
- 物流管理系统-医药物流管理系统.doc
- 物流系统的机械手搬运系统的设计.doc
- 物联网协议分析与协议中间件设计.doc
- 物联网应用的安全问题研究.doc
- 物联网技术在仓储管理中的应用研究.doc
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
最近下载
- 我们仨电子版.pdf VIP
- 妇幼保健院十五五发展规划.docx VIP
- 小学生必背古诗75首(打印版).pdf VIP
- 期末重难点检测卷(含解析)-2026年数学三年级下册北师大版.pdf VIP
- ZXK-7532数控立式钻铣床主运动、进给系统及控制系统的设计.doc VIP
- 2025至2030中国碳纤维复合材料在航空航天领域应用现状及投资机会报告.docx
- 雅马哈psre313使用说明书.pdf VIP
- 临床成人患者医用粘胶相关性皮肤损伤预防及护理-MARSI.pptx
- 电力行业深度:算力之争,电力为王,聚焦美国AI能源革命核心赛道.pptx VIP
- 房地产上市公司偿债能力分析【文献综述】.docx VIP
原创力文档

文档评论(0)