测试SLR文法例子
来源:互联网 发布:单机游戏网络对战平台 编辑:程序博客网 时间:2024/05/01 19:25
int
if
then
else
while
do
and
not
true
id
(
)
{
}
;
:
<
=
+
*
$
##################################
O
P
D
A
S
K
C
B
R
W
U
L
N
E
T
F
M
H
[
##################################
O->P
P->D
D->D;D
D->A:id
D->id()D;S
A->int
S->id=K E
C->if B then
R->C S else
S->R S
S->C S
W->while
U->W B do
S->U S
S->{L}
L->L;NS
L->S
K->[
N->[
E->E+T
E->T
E->T*F
T->F
F->(E)
F->id
B->B and M B
B->not H B
B->id<id
B->true
M->[
H->[
##################################
注意:
1.务必把$作为最后一个终结符输入。
2.务必把З作为最后一个终结符输入。
3.务必把拓广符号S及原来的开始符号放在非终结符的第1、2个。
4.#号分隔符是必须的:终结符、非终结符、产生式。
First collection of "int" is :int
First collection of "if" is :if
First collection of "then" is :then
First collection of "else" is :else
First collection of "while" is :while
First collection of "do" is :do
First collection of "and" is :and
First collection of "not" is :not
First collection of "true" is :true
First collection of "id" is :id
First collection of "(" is :(
First collection of ")" is :)
First collection of "{" is :{
First collection of "}" is :}
First collection of ";" is :;
First collection of ":" is ::
First collection of "<" is :<
First collection of "=" is :=
First collection of "+" is :+
First collection of "*" is :*
First collection of "$" is :$
First collection of "O" is :id int
First collection of "P" is :id int
First collection of "D" is :id int
First collection of "A" is :int
First collection of "S" is :id { if while
First collection of "K" is :[
First collection of "C" is :if
First collection of "B" is :not id true
First collection of "R" is :if
First collection of "W" is :while
First collection of "U" is :while
First collection of "L" is :id { if while
First collection of "N" is :[
First collection of "E" is :( id
First collection of "T" is :( id
First collection of "F" is :( id
First collection of "M" is :[
First collection of "H" is :[
First collection of "[" is :
Follow collection of "O" is :$
Follow collection of "P" is :$
Follow collection of "D" is :$ ;
Follow collection of "A" is ::
Follow collection of "S" is :$ ; else }
Follow collection of "K" is :( id
Follow collection of "C" is :id { if while
Follow collection of "B" is :then do and
Follow collection of "R" is :id { if while
Follow collection of "W" is :not id true
Follow collection of "U" is :id { if while
Follow collection of "L" is :} ;
Follow collection of "N" is :id { if while
Follow collection of "E" is :$ ; + ) else }
Follow collection of "T" is :$ ; + * ) else }
Follow collection of "F" is :$ ; + * ) else }
Follow collection of "M" is :not id true
Follow collection of "H" is :not id true
Follow collection of "[" is :
(分析表太大,61×39项,这里只显示其左上部分)
1 2 3 4 5 6 7 8 9 10 11 12 ........39
state0 s4 0 0 0 0 0 0 0 0 s5 0 0
state1 0 0 0 0 0 0 0 0 0 0 0 0
state2 0 0 0 0 0 0 0 0 0 0 0 0
state3 0 0 0 0 0 0 0 0 0 0 0 0
state4 0 0 0 0 0 0 0 0 0 0 0 0
state5 0 0 0 0 0 0 0 0 0 0 s8 0
state6 s4 0 0 0 0 0 0 0 0 s5 0 0
state7 0 0 0 0 0 0 0 0 0 s10 0 0
state8 0 0 0 0 0 0 0 0 0 0 0 s11
state9 0 0 0 0 0 0 0 0 0 0 0 0
.
.
state60
- 测试SLR文法例子
- 求助 SLR 文法分析器
- SLR文法代码
- 编译原理(十) SLR文法分析法-算法原理
- 如何判断文法是LL(1)SLR(1)LR(1)LALR(1)的?
- 编译原理(十) SLR文法分析法(算法原理和C++实现)
- 从上下文无关文法(CFG)到语法分析树——SLR(1)分析法
- 基于SLR文法,将输入串翻译成三地址代码序列
- 编译原理(十) SLR文法分析法(算法原理和C++实现)
- 用例子来区分4种文法
- 用例子来区分4种文法
- 文法
- 文法
- 科学计算器 文法测试用例
- 科学计算器 文法测试用例
- 测试例子
- Systematic Literature Review(SLR)
- Web Services测试例子
- 不知道自己在干什么
- 语法分析表产生器的代码之一:主函数main.cpp
- 语法分析表产生器的代码之二:自定义类的声明文件myclass.h
- 我的初恋女友和现任女友。。。咳
- 语法分析表产生器的代码之三:自定义类的实现函数文件implement_syntax.cpp
- 测试SLR文法例子
- C++高手进阶
- 预计去南京
- 初学C#两星期,一片茫然
- Eular方法解常微分方程
- 富人和穷人的八大差异
- C++数据类型转换
- 改进Eular方法解常微分方程
- PING命令 前辈们说。首次中国红客攻击印尼的时候用的就是PING