文件名称:yffx
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 329kb
- 下载次数:
- 0次
- 提 供 者:
- zhan*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
语法分析
C2.1 实验目的
编制一个递归下降分析程序,实现对词法分析程序所提供的单词序列的语法检查和结构分析.
C2.2 实验要求
利用C语言编制递归下降分析程序,并对简单语言进行语法分析.
C2.2.1待分析的简单语言的语法
用扩充的BNF表示如下:
(1)<程序>::=begin<语句串>end
(2)<语句串>::=<语句>{ <语句>}
(3)<语句>::=<赋值语句>
(4)<赋值语句>::=ID:=<表达式>
(5)<表达式>::=<项>{+<项> | —项>}
(6)<项>::=<因子>{*<因子> | /<因子>}
(7)<因子>::=ID | NUM | (<表达式>)
C2。2。2实验要求说明
输入单词串,以“#”结束,如果是文法正确的句子,则输出成功信息,打印“success”,否则输出“error”.
-Syntax analysis
The experiment was C2.1
Recursive analysis of a decline in the preparation of procedures, procedures for the realization of the lexical analysis provided by the grammar checker word sequence and structure analysis.
C2.2 Experimental requirements
The use of C language procedures for the preparation of analysis of recursive descent, and a simple analysis of language syntax.
C2.2.1 to be analyzed in a simple language syntax
With the expansion of the BNF as follows:
(1) <program>:: = begin <statement string> end
(2) <statement string >::=< statement> ( <statement>)
(3) <>::=< assignment statement>
(4) <assignment statement>:: = ID: = <expression>
(5) <>::=< expression of> (+ <item> |- item>)
(6) <>::=< factor of> (* <factor> |/<factor>)
(7) <factor>:: = ID | NUM | (<expression>)
C2. 2. 2 Experimental requested clarification
Enter t
C2.1 实验目的
编制一个递归下降分析程序,实现对词法分析程序所提供的单词序列的语法检查和结构分析.
C2.2 实验要求
利用C语言编制递归下降分析程序,并对简单语言进行语法分析.
C2.2.1待分析的简单语言的语法
用扩充的BNF表示如下:
(1)<程序>::=begin<语句串>end
(2)<语句串>::=<语句>{ <语句>}
(3)<语句>::=<赋值语句>
(4)<赋值语句>::=ID:=<表达式>
(5)<表达式>::=<项>{+<项> | —项>}
(6)<项>::=<因子>{*<因子> | /<因子>}
(7)<因子>::=ID | NUM | (<表达式>)
C2。2。2实验要求说明
输入单词串,以“#”结束,如果是文法正确的句子,则输出成功信息,打印“success”,否则输出“error”.
-Syntax analysis
The experiment was C2.1
Recursive analysis of a decline in the preparation of procedures, procedures for the realization of the lexical analysis provided by the grammar checker word sequence and structure analysis.
C2.2 Experimental requirements
The use of C language procedures for the preparation of analysis of recursive descent, and a simple analysis of language syntax.
C2.2.1 to be analyzed in a simple language syntax
With the expansion of the BNF as follows:
(1) <program>:: = begin <statement string> end
(2) <statement string >::=< statement> ( <statement>)
(3) <>::=< assignment statement>
(4) <assignment statement>:: = ID: = <expression>
(5) <>::=< expression of> (+ <item> |- item>)
(6) <>::=< factor of> (* <factor> |/<factor>)
(7) <factor>:: = ID | NUM | (<expression>)
C2. 2. 2 Experimental requested clarification
Enter t
(系统自动生成,下载前可以参看下载内容)
下载文件列表
语法分析
........\2_1
........\...\2.1
........\...\2.1.cpp
........\...\2.1.dsp
........\...\2.1.dsw
........\...\2.1.ncb
........\...\2.1.opt
........\...\2.1.plg
........\...\2_1.dsp
........\...\2_1.dsw
........\...\2_1.ncb
........\...\2_1.opt
........\...\2_1.plg
........\...\Debug
........\...\.....\2.1.exe
........\...\.....\2.1.ilk
........\...\.....\2.1.obj
........\...\.....\2.1.pdb
........\...\.....\2_1.exe
........\...\.....\2_1.ilk
........\...\.....\2_1.pch
........\...\.....\2_1.pdb
........\...\.....\vc60.idb
........\...\.....\vc60.pdb
........\...\wordscan.h
........\语法分析.doc
........\语法分析实验报告.doc
........\2_1
........\...\2.1
........\...\2.1.cpp
........\...\2.1.dsp
........\...\2.1.dsw
........\...\2.1.ncb
........\...\2.1.opt
........\...\2.1.plg
........\...\2_1.dsp
........\...\2_1.dsw
........\...\2_1.ncb
........\...\2_1.opt
........\...\2_1.plg
........\...\Debug
........\...\.....\2.1.exe
........\...\.....\2.1.ilk
........\...\.....\2.1.obj
........\...\.....\2.1.pdb
........\...\.....\2_1.exe
........\...\.....\2_1.ilk
........\...\.....\2_1.pch
........\...\.....\2_1.pdb
........\...\.....\vc60.idb
........\...\.....\vc60.pdb
........\...\wordscan.h
........\语法分析.doc
........\语法分析实验报告.doc