文件名称:LL-(1)-parser
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:185.65kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
LL(1)语法分析器设计
1.如下为给定的LL(1)文法。
G[<P>]:
1) <P>->program <D> : <T> begin <S> end {program}
2) D->i D’ {i}
3) D’->, i D’ {,}
4) D’->ε {:}
5) S->s S’ {s}
6) S’-> s S’ { }
7) S’->ε {end}
8) T->real {real}
9) T->integer {integer}
其中右侧{}内为产生的可选集。
2.调试并完善如下给出的文法的LL(1)分析器示例程序,并设输入的文法的句子为:
program
i , i , i : integer
begin
s s s
end
给出输出结果并进行分析说明。
-1. Below for a given LL (1) grammar.
G [<P>]:
1) <P>-> program <D>: <T> begin <S> end {program}
2) D-> i D {i}
3) D ->, i D {,}
4) D -> ε {:}
5) S-> s S {s}
6) S -> s S { }
7) S -> ε {end}
8) T-> real {real}
9) T-> integer {integer}
{} within which the right to produce an optional set.
2. Debug and improve the grammar given in the following LL (1) analyzer sample program, and set the input sentence is the grammar:
program
i, i, i: integer
begin
s s s
end
Output and analysis are given instructions.
1.如下为给定的LL(1)文法。
G[<P>]:
1) <P>->program <D> : <T> begin <S> end {program}
2) D->i D’ {i}
3) D’->, i D’ {,}
4) D’->ε {:}
5) S->s S’ {s}
6) S’-> s S’ { }
7) S’->ε {end}
8) T->real {real}
9) T->integer {integer}
其中右侧{}内为产生的可选集。
2.调试并完善如下给出的文法的LL(1)分析器示例程序,并设输入的文法的句子为:
program
i , i , i : integer
begin
s s s
end
给出输出结果并进行分析说明。
-1. Below for a given LL (1) grammar.
G [<P>]:
1) <P>-> program <D>: <T> begin <S> end {program}
2) D-> i D {i}
3) D ->, i D {,}
4) D -> ε {:}
5) S-> s S {s}
6) S -> s S { }
7) S -> ε {end}
8) T-> real {real}
9) T-> integer {integer}
{} within which the right to produce an optional set.
2. Debug and improve the grammar given in the following LL (1) analyzer sample program, and set the input sentence is the grammar:
program
i, i, i: integer
begin
s s s
end
Output and analysis are given instructions.
相关搜索: LL parser program
(系统自动生成,下载前可以参看下载内容)
下载文件列表
LL (1) parser/Debug/text3.exe
LL (1) parser/Debug/text3.ilk
LL (1) parser/Debug/text3.obj
LL (1) parser/Debug/text3.pch
LL (1) parser/Debug/text3.pdb
LL (1) parser/Debug/vc60.idb
LL (1) parser/Debug/vc60.pdb
LL (1) parser/g1.dat
LL (1) parser/LL1.dat
LL (1) parser/text3-1.txt
LL (1) parser/text3-2.txt
LL (1) parser/text3.cpp
LL (1) parser/text3.dsp
LL (1) parser/text3.dsw
LL (1) parser/text3.ncb
LL (1) parser/text3.opt
LL (1) parser/text3.plg
LL (1) parser/Debug
LL (1) parser
LL (1) parser/Debug/text3.ilk
LL (1) parser/Debug/text3.obj
LL (1) parser/Debug/text3.pch
LL (1) parser/Debug/text3.pdb
LL (1) parser/Debug/vc60.idb
LL (1) parser/Debug/vc60.pdb
LL (1) parser/g1.dat
LL (1) parser/LL1.dat
LL (1) parser/text3-1.txt
LL (1) parser/text3-2.txt
LL (1) parser/text3.cpp
LL (1) parser/text3.dsp
LL (1) parser/text3.dsw
LL (1) parser/text3.ncb
LL (1) parser/text3.opt
LL (1) parser/text3.plg
LL (1) parser/Debug
LL (1) parser
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.