summaryrefslogtreecommitdiff
path: root/web/yacco2/qa/pathological.lex
blob: 0c93754e23e24b9b5e11127a17434c4518c6a2f0 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*	
$echo FILE:		  pathological.lex
$echo Purpose: Rules that do no derive T strings
$echo Error 
*/
/@
@** pathological Grammar.\fbreak
Test on the variants on pathological grammars.\fbreak
RA,RB,RD,RF are variants on rules not deriving ${^* \Rightarrow}$ t.
@/
fsm	
(fsm-id	"pathological.lex",fsm-filename	pathological,fsm-namespace NS_pathological
,fsm-class	 Cpathological
,fsm-version "1.0",fsm-date "24 Mar. 2006",fsm-debug "true"
,fsm-comments	"pathological grammar")
@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T"

/@
@** Rules.\fbreak
@/
rules{
Rstart AD AB(){
  -> RA eog
  -> RB eog
  -> RD eog
  -> RF eog
}

/@
@** |RA| rule.\fbreak
Call self.
@/
RA AD AB()
{
  ->  RA
}

/@
@** |RB| rule.\fbreak
Indirect call on self.
@/

RB AD AB()
{
  ->  RC 
}
RC AD AB()
{
  -> RB 
}

/@
@** |RD| rule.\fbreak
${\alpha}${} ${^* \Rightarrow}${} ${\epsilon}${} with right recursion.
@/
RD AD AB()
{
  ->  RE RD 
}
RE AD AB()
{
  -> 
}
/@
@** |RF| rule.\fbreak
${\alpha}${} ${^+ \Rightarrow}${} ${1}${} with right recursion.
@/

RF AD AB()
{
  ->  RG RF 
}
RG AD AB()
{
  -> 1
}
}// end of rules