Welcome![Sign In][Sign Up]
Location:
Search - code for lalr parser

Search list

[ELanguageLR

Description: 1.实验目的 设计一个LR分析器,实现对表达式语言的分析,加深对LR语法分析方法的基本思想的理解,掌握LR分析器设计与实现的基本方法。 2.实验要求 建立文法及其LR分析表表示的数据结构,设计并实现一个LALR(1)的分析器,对源程序经词法分析后生成的二元式代码流进行分析,如果输入串是文法定义的句子则输出“是”,否则输出“否”。 3.实验内容 (1)文法描述及其LALR(1)分析表 描述表达式语言的文法G如下: -1. The experiment was to design a LR parser, the realization of the analysis of the expression language, better understanding of the LR parsing method to understand the basic idea of the master LR parser design and implementation of the basic method. 2. Experiment called for the establishment of grammar and LR analysis table that the data structure, design and realization of a LALR (1) of the analyzer, lexical analysis of source code generated by the binary-type code flow analysis, if the input strings is the definition of grammar sentence is the output " yes" , otherwise output " no." 3. Experimental (1) grammar description and LALR (1) Analysis of the expression language described in Table G of the grammar are as follows:
Platform: | Size: 289792 | Author: sh_xj | Hits:

CodeBus www.codebus.net