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]
/
prop-src
/
T2.pcc
blob
cc96abed935527a5e16bb289089bc65444408563
1
datatype Exp = INT int => _
2
| ADD (Exp, Exp) => _ "+" _
3
| SUB (Exp, Exp) => _ "-" _
4
| MUL (Exp, Exp) => _ "*" _
5
| DIV (Exp, Exp) => _ "/" _
6
;
7
8
graphtype Foo
9
( nodes: Node Exp
10
edges: edge Node -> Node
11
)
12
{
13
};
14
15
instantiate datatype Exp;
16
17
graphrewrite Transform (e : Exp)
18
{
19
ADD(x,y), ADD(x,y)
20
------------------
21
INT(1);
22
};