summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/dp_1.lex
blob: 8c2c36402484a37cfd2f3e94818d1aeba2a6d0d5 (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
/*
Author: Dave Bone 
FILE:    dp_1.lex
Date:    7 mar 2014	
Purpose: Test out compiler/compiler with Deremer and Pennello lalr grammar page 632
*/

/@
@** Deremer and Pennello page 632 Lalr(1) Grammar.\fbreak
Efficient Computation of LALR(1) Look-Ahead Sets\fbreak
ACM Transactions on Programming Languages and Systems, 4(4):615—649, 1982\fbreak
@/

fsm	
(fsm-id "dp_1.lex",fsm-filename dp_1,fsm-namespace NS_dp_1
,fsm-class Cdp_1
,fsm-version	"1.0",fsm-date "7 mar 2014",fsm-debug "false"
,fsm-comments	"LALR(1) Deremer and Pennello grammar from page 632.")
@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T"

rules{
Rs(){
  -> Rs1 eog 
}

Rs1(){
  -> a Ra c
  -> a g d
  -> b Ra d
  -> b g c
}

Ra(){
  -> Rb
}

Rb(){
  -> g
}
}