-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransform.ml
18 lines (13 loc) · 882 Bytes
/
transform.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let rec convert_aast_to_ast = function
| Aast.LET (_,a,b,c) -> Ast.LET (convert_aast_to_ast a, convert_aast_to_ast b, convert_aast_to_ast c)
| Aast.DECLARE (_,a,b)-> Ast.DECLARE (convert_aast_to_ast a, convert_aast_to_ast b)
| Aast.ASSIGN (_,a,b) -> Ast.ASSIGN (convert_aast_to_ast a, convert_aast_to_ast b)
| Aast.SEQ (_,a) -> Ast.SEQ (List.map convert_aast_to_ast a)
| Aast.INT (_,a) -> Ast.INT (a)
| Aast.BOOL (_,a) -> Ast.BOOL (a)
| Aast.IDENT (_,a) -> Ast.IDENT (a)
| Aast.TYPE_IDENT(_,a)-> Ast.TYPE_IDENT (a)
| Aast.INFIX (_,a,b,c)-> Ast.INFIX (convert_aast_to_ast a, b, convert_aast_to_ast c)
| Aast.IF (_,a,b,c) -> Ast.IF (convert_aast_to_ast a, convert_aast_to_ast b, convert_aast_to_ast c)
| Aast.WHILE (_,a,b) -> Ast.WHILE (convert_aast_to_ast a, convert_aast_to_ast b)
let transform = function x -> x