summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/km_1.lex
blob: 90b1adaad181d2bc239ed721cc28da56d17a4334 (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
/*
Author: Dave Bone 
FILE:    km_1.lex
Date:    7 mar 2014	
Purpose: Test out compiler/compiler with Kristensen and Madsen grammar - lalr resolution
*/
/@
@** Kristensen and Madsen  Grammar.\fbreak
Bent Bruun Kristensen and Ole Lehrmann Madsen\fbreak
Correspondence ACM Sigplan Notices, 19(8), August 1984.\fbreak
Test out LALR(1) resolution.
@/
fsm	
(fsm-id "km_1.lex",fsm-filename km_1,fsm-namespace NS_km_1
,fsm-class Ckm_1
,fsm-version	"1.0",fsm-date "7 mar 2014",fsm-debug "false"
,fsm-comments	"Test out LALR(1) resolution.")
@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T"

rules{
Rs(){
  -> Re eog 
}

Re(){
  -> Ra a
  -> Rb b
  -> u Ra b
  -> u Rb a
}

Ra(){
  -> x y z Ra
  -> x q
}

Rb(){
  -> x y z Rb
  -> x q
}
}