summaryrefslogtreecommitdiff
path: root/web/yacco2/qa/knu1_sick.lex
blob: 0de5214012cb17f997052f3cff942d70bbb47e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*	
$echo FILE:       knu1_sick.lex
$echo Purpose:	  Pathological test not lr1 on the gening closure state network
$echo variation on knu1.lex grammar
$echo Error ---	Grammar is not lr1.		
*/
/*	
FILE:    knu1_sick.lex
dates:   27 oct 2008	
Purpose: test out non lr1 grammar due to a coding mistake on knu1.lex
where the closure network being gened never stops.
The symptom is this:
the gened state is trying to merge into its self and is not lr1.
*/
/@
@** |knu1_sick| Grammar.\fbreak
Test out non lr1 grammar due to a coding mistake on |knu1.lex| grammar.
When the closure state network is being gened,
 it never stops generating states.\fbreak
The symptom is this:\fbreak
The new gened state is trying to merge into 
one of its states but this merge makes it non lr1.
The run away forever gening' symptom is due to the right recursion
with the grammar --- rule `RS'.\fbreak
\fbreak
Solution: when above detected stop gening lr state network
due to not lr1 condition.
@/
fsm	
(fsm-id "knu1_sick.lex",fsm-filename knu1_sick,fsm-namespace NS_knu1_sick
,fsm-class Cknu1_sick
,fsm-version	"1.0",fsm-date "23 oct 2008",fsm-debug "true"
,fsm-comments	"knuth grammar (24) --- modified as not lr1 on rt recursion cycling")
@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T"

rules{
Rstart(){
  -> RS eog 
}

RS (){
  -> 
  -> a RA b RS
  -> b RA a RS // RA should be RB but used to detect run away generation
}
RA (){
  -> 
  -> a RA b RA
}
RB (){
  -> 
  -> b RB a RB
}

}// end of rules