文件名称:YFFXQ
- 所属分类:
- 编译器/词法分析
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 190kb
- 下载次数:
- 0次
- 提 供 者:
- 龙*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
使用递归子程序法设计一个语法分析程序,自顶向下分析方法.
1、使用递归下降分析算法分析表达式文法:
exp ::= exp addop term | term
addop ::= + | -
term ::= term mulop factor | factor
mulop ::= * | /
factor ::= (exp) | number
其中number可以是多位的十进制数字串(整数即可),因此这里还需要一个小的词法分析器来得到number的值。
2、该词法分析器以子程序形式出现,当需要进行词法分析时进行调用;
3、能够识别正确和错误的表达式;
4、在进行语法分析的过程中,计算输入表达式的值。
-Recursive subroutine method to design a syntax analysis program, top-down analysis. 1, using recursive descent parsing algorithm analysis of the expression grammar: exp:: = exp addop term | term addop:: =+ |- term:: = term mulop factor | factor mulop:: =* |/factor:: = (exp) | number of which is the number of decimal number can number string (integer can be), so here also need a small lexical analyzer to get the number value. 2, the lexical analyzer in subroutine form, when the need for lexical analysis of a call 3, able to recognize right and wrong expression 4, during the course of parsing, calculating import value of the expression.
1、使用递归下降分析算法分析表达式文法:
exp ::= exp addop term | term
addop ::= + | -
term ::= term mulop factor | factor
mulop ::= * | /
factor ::= (exp) | number
其中number可以是多位的十进制数字串(整数即可),因此这里还需要一个小的词法分析器来得到number的值。
2、该词法分析器以子程序形式出现,当需要进行词法分析时进行调用;
3、能够识别正确和错误的表达式;
4、在进行语法分析的过程中,计算输入表达式的值。
-Recursive subroutine method to design a syntax analysis program, top-down analysis. 1, using recursive descent parsing algorithm analysis of the expression grammar: exp:: = exp addop term | term addop:: =+ |- term:: = term mulop factor | factor mulop:: =* |/factor:: = (exp) | number of which is the number of decimal number can number string (integer can be), so here also need a small lexical analyzer to get the number value. 2, the lexical analyzer in subroutine form, when the need for lexical analysis of a call 3, able to recognize right and wrong expression 4, during the course of parsing, calculating import value of the expression.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
语法分析器\语法分析器.dsp
..........\语法分析器.dsw
..........\语法分析器.plg
..........\语法分析.ncb
..........\语法分析.plg
..........\语法分析器.ncb
..........\语法分析器.opt
..........\Debug\vc60.idb
..........\.....\vc60.pdb
..........\.....\语法分析.pch
..........\.....\语法分析.obj
..........\.....\语法分析.pdb
..........\.....\语法分析.exe
..........\.....\语法分析.ilk
..........\语法分析.dsp
..........\语法分析.c
..........\语法分析.opt
..........\语法分析.dsw
..........\Debug
语法分析器
..........\语法分析器.dsw
..........\语法分析器.plg
..........\语法分析.ncb
..........\语法分析.plg
..........\语法分析器.ncb
..........\语法分析器.opt
..........\Debug\vc60.idb
..........\.....\vc60.pdb
..........\.....\语法分析.pch
..........\.....\语法分析.obj
..........\.....\语法分析.pdb
..........\.....\语法分析.exe
..........\.....\语法分析.ilk
..........\语法分析.dsp
..........\语法分析.c
..........\语法分析.opt
..........\语法分析.dsw
..........\Debug
语法分析器