Adding a base clock in the Hept AST.

This commit is contained in:
Léonard Gérard 2010-11-30 11:54:15 +01:00
parent 5a62ca5335
commit 82caa5a83d
3 changed files with 9 additions and 4 deletions

View file

@ -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 }

View file

@ -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

View file

@ -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 }