repo.or.cz
/
prop.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
simple.cc - generated code example
[prop.git]
/
tools
/
test
/
g1.pcc
blob
b2409a1a8ce12c0414840a90cb9733f7001ede31
1
//
2
// Sample grammar that is LR(1) but not LALR(1)
3
//
4
5
datatype T :: lexeme = Id;
6
7
syntax class Testing {};
8
9
syntax Testing
10
{
11
S : '(' Exp1 ')' // Should have 2 reduce/reduce conflicts here.
12
| '[' Exp1 ']'
13
| '(' Exp2 ']'
14
| '[' Exp2 ')'
15
| '[' Exp2 '>'
16
;
17
Exp1 : Id ;
18
Exp2 : Id ;
19
};