编译原理,递归下降分析器。有哪位高手有不错的idea给联系我并赐教。时间不多请多帮忙。(问题内详)
编译器设计:递归下降分析器
这个是要求:
Recursive-Descent Parser Design
1.Design a Recursive-Descent syntax analyzer for the grammar given in next slide.
2.Problem Specification
--Input: SPL program to find a minimum and a maximum
--Output: Left parse
--Methods:
1) Write the get_nextsymbol routine(scanner)
2) Compute LOOKAHEADs for each production.
3) Create a procedure for each nonterminal
4) Assemble the procedures with main program.
想问的是这个第四条 “Assemble the procedures with main program.”不是让我编译吧。这个Assemble在这里是“汇总”的意思吧?我想不是编译的意思吧
简单说一下情况。时间不多了。这里说的是:
使用C语言设计一个简单编译器,
输入:一组数字。寻找其中的最小数和最大数。
输出:使用LL(1)预测表的构造方法。
方法:
1)需要调用scaner读下一个数字。
2)在每个过程使用LOOKAHEADs(预测,前瞻)的算法。(这里我想我写的可能不是很对)
3)给每个终结符创造一个过程
4)给主程序汇总所有的过程。(Assemble我想是汇总的意思。)
还有一个EBNF的表
就是编译书上都见到的那种:
<spl_pro>::=<block>'.'
...
<letter>::=('a'|'b'|'c'|...'z')
<digit>::= ...
...
有哪位高手有不错的idea给联系我并赐教。时间不多请多帮忙。
我的 电邮,或MSN:blueink_200451@hotmail.com
我一直在。有问题就写在这里吧。我会一直看这个帖子的。谢谢。哪怕有一点想法也请您们不惜赐教。