| 1 |
(* |
| 2 |
* Various translation functions |
| 3 |
*) |
| 4 |
signature MDL_AST_REWRITER = |
| 5 |
sig |
| 6 |
|
| 7 |
structure Ast : MDL_AST |
| 8 |
|
| 9 |
type 'a rewriter = ('a -> 'a) -> ('a -> 'a) |
| 10 |
|
| 11 |
type clients = {exp : Ast.exp rewriter, |
| 12 |
decl : Ast.decl rewriter, |
| 13 |
sexp : Ast.structexp rewriter, |
| 14 |
pat : Ast.pat rewriter, |
| 15 |
ty : Ast.ty rewriter |
| 16 |
} |
| 17 |
type trans = {exp : Ast.exp -> Ast.exp, |
| 18 |
decl : Ast.decl -> Ast.decl, |
| 19 |
sexp : Ast.structexp -> Ast.structexp, |
| 20 |
pat : Ast.pat -> Ast.pat, |
| 21 |
ty : Ast.ty -> Ast.ty |
| 22 |
} |
| 23 |
|
| 24 |
val noRewrite : 'a rewriter |
| 25 |
val rewrite : clients -> trans |
| 26 |
end |