From 82caa5a83dbbe04f73845c27c98f377823baab70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Tue, 30 Nov 2010 11:54:15 +0100 Subject: [PATCH] Adding a base clock in the Hept AST. --- compiler/heptagon/heptagon.ml | 4 +++- compiler/heptagon/parsing/hept_scoping.ml | 1 + compiler/minils/minils.ml | 8 +++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/heptagon/heptagon.ml b/compiler/heptagon/heptagon.ml index f3335be..b959840 100644 --- a/compiler/heptagon/heptagon.ml +++ b/compiler/heptagon/heptagon.ml @@ -29,6 +29,7 @@ type exp = { e_desc : desc; e_ty : ty; e_ct_annot : ct; + e_base_ck : ck; e_loc : location } and desc = @@ -181,7 +182,8 @@ and interface_desc = (* Helper functions to create AST. *) let mk_exp desc ?(ct_annot = Clocks.invalid_clock) ty = - { e_desc = desc; e_ty = ty; e_ct_annot = ct_annot; e_loc = no_location; } + { e_desc = desc; e_ty = ty; e_ct_annot = ct_annot; + e_base_ck = Cbase; e_loc = no_location; } let mk_op ?(params=[]) ?(unsafe=false) op = { a_op = op; a_params = params; a_unsafe = unsafe } diff --git a/compiler/heptagon/parsing/hept_scoping.ml b/compiler/heptagon/parsing/hept_scoping.ml index f84b39e..31dcf69 100644 --- a/compiler/heptagon/parsing/hept_scoping.ml +++ b/compiler/heptagon/parsing/hept_scoping.ml @@ -222,6 +222,7 @@ let rec translate_exp env e = try { Heptagon.e_desc = translate_desc e.e_loc env e.e_desc; Heptagon.e_ty = Types.invalid_type; + Heptagon.e_base_ck = Clocks.Cbase; Heptagon.e_ct_annot = e.e_ct_annot; Heptagon.e_loc = e.e_loc } with ScopingError(error) -> message e.e_loc error diff --git a/compiler/minils/minils.ml b/compiler/minils/minils.ml index 286a0f8..7d15357 100644 --- a/compiler/minils/minils.ml +++ b/compiler/minils/minils.ml @@ -40,6 +40,7 @@ and tdesc = and exp = { e_desc : edesc; + e_base_ck : ck; mutable e_ck: ck; mutable e_ty: ty; e_loc : location } @@ -132,9 +133,10 @@ type program = { (*Helper functions to build the AST*) -let mk_exp ?(ty = invalid_type) - ?(clock = fresh_clock()) ?(loc = no_location) desc = - { e_desc = desc; e_ty = ty; e_ck = clock; e_loc = loc } +let mk_exp ?(ty = invalid_type) ?(clock = fresh_clock()) + ?(loc = no_location) ?(base_clock = Cbase) desc = + { e_desc = desc; e_ty = ty; + e_base_ck = base_clock; e_ck = clock; e_loc = loc } let mk_var_dec ?(loc = no_location) ?(clock = fresh_clock()) ident ty = { v_ident = ident; v_type = ty; v_clock = clock; v_loc = loc }