summaryrefslogtreecommitdiff
path: root/web/yacco2/grammar-testsuite/sp_1.lex
blob: 4acf0be476f27bf896c3a7d801b0ce41d5c0d2cd (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:    sp_1.lex
Date:    7 mar 2014	
Purpose: Test out compiler/compiler with Kristensen and Madsen grammar - lalr resolution
*/
/@
@** Spector  Grammar.\fbreak
David Spector\fbreak
Full LR(1) Parser Generator ACM Sigplan Notices, 16(8), August 1981.\fbreak
Test out LR(1) resolution - page 64.
@/
fsm	
(fsm-id "sp_1.lex",fsm-filename sp_1,fsm-namespace NS_sp_1
,fsm-class Csp_1
,fsm-version	"1.0",fsm-date "7 mar 2014",fsm-debug "false"
,fsm-comments	"Test out Spector LR(1) resolution from page 64.")
@"/usr/local/yacco2/compiler/grammars/yacco2_T_includes.T"

rules{

Rmm(){
  -> Rs eog 
}

Rs(){
  -> Ra b
  -> Rb c
}

Ra(){
  -> a Ra c
  -> a
}

Rb(){
  -> a Rb b
  -> a
}
}