summaryrefslogtreecommitdiff
path: root/frontend/ast_printer.ml
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-11 17:49:07 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-11 17:49:07 +0200
commitc8e565c22e149e70ae45cbe5b9afda5dd5685f43 (patch)
tree9c6d40dd23c27f1b7b6cd3cdc86abfbe80832e4d /frontend/ast_printer.ml
parentaefe04b278d37c5f1248ef631eeb08dbbb4da653 (diff)
downloadscade-analyzer-c8e565c22e149e70ae45cbe5b9afda5dd5685f43.tar.gz
scade-analyzer-c8e565c22e149e70ae45cbe5b9afda5dd5685f43.zip
Parse type groups.
Diffstat (limited to 'frontend/ast_printer.ml')
-rw-r--r--frontend/ast_printer.ml16
1 files changed, 12 insertions, 4 deletions
diff --git a/frontend/ast_printer.ml b/frontend/ast_printer.ml
index 422d446..611e802 100644
--- a/frontend/ast_printer.ml
+++ b/frontend/ast_printer.ml
@@ -75,12 +75,20 @@ let print_list f sep fmt l =
in
aux l
+let print_id_ext fmt (i, _) =
+ Format.pp_print_string fmt i
+
(* types *)
-let string_of_typ = function
+let rec string_of_typ = function
| AST_TINT -> "int"
| AST_TBOOL -> "bool"
| AST_TREAL -> "real"
+ | AST_TGROUP its ->
+ List.fold_left (fun s t ->
+ (if s = "" then "" else s ^ ", ") ^ (string_of_typ t))
+ ""
+ its
(* expressions *)
@@ -159,9 +167,9 @@ let rec print_expr fmt e =
let indent ind = ind^" "
let rec print_eqn ind fmt = function
- | AST_assign ((v,_),(e,_)) ->
- Format.fprintf fmt "%s%s = %a;@\n"
- ind v print_expr e
+ | AST_assign (l,(e,_)) ->
+ Format.fprintf fmt "%s%a = %a;@\n"
+ ind (print_list print_id_ext ", ") l print_expr e
| AST_assume((i, _), (e, _)) ->
Format.fprintf fmt "%sassume %s: %a;@\n"
ind i print_expr e