Minils and signature tweaked further.

This commit is contained in:
Léonard Gérard 2010-07-01 19:35:24 +02:00 committed by Cédric Pasteur
parent 50bd90183d
commit 3cc1652425
2 changed files with 29 additions and 24 deletions

View file

@ -13,7 +13,7 @@ open Static
(** Warning: Whenever these types are modified,
interface_format_version should be incremented. *)
let interface_format_version = "7"
let interface_format_version = "8"
(** Node argument *)
type arg = { a_name : name option; a_type : ty }
@ -42,11 +42,11 @@ let mk_arg name ty = { a_type = ty; a_name = name }
let mk_param name = { p_name = name }
let mk_field n ty = { f_name = n; f_type = ty }
let print_param ff p = Names.print_name ff p.p_name
let mk_field n ty =
{ f_name = n; f_type = ty }
let rec field_assoc f = function
| [] -> raise Not_found

View file

@ -32,7 +32,7 @@ and tdesc =
| Type_struct of structure
and exp =
{ e_desc: edesc; (* its descriptor *)
{ e_desc: edesc;
mutable e_ck: ck;
mutable e_ty: ty;
e_loc: location }
@ -40,31 +40,37 @@ and exp =
and edesc =
| Econst of static_exp
| Evar of ident
| Econstvar of name
| Efby of static_exp option * exp
(** static_exp fby exp *)
| Eapp of app * exp list * ident option
(** ident option is the optional reset *)
(** app ~args=(exp,exp...) reset ~r=ident *)
| Ewhen of exp * longname * ident
(** exp when Constructor(ident) *)
| Emerge of ident * (longname * exp) list
(** merge ident (Constructor -> exp)+ *)
| Estruct of (longname * exp) list
(** { field=exp; ... } *)
| Eiterator of iterator_type * app * static_exp * exp list * ident option
(** map f <<n>> (exp,exp...) reset ident *)
and app = { a_op: op; a_params: static_exp list }
and app = { a_op: op; a_params: static_exp list; a_unsafe: bool }
(** Unsafe applications could have side effects
and be delicate about optimizations, !be careful! *)
and op =
| Efun of longname
| Enode of longname
| Eifthenelse
| Efield_update of longname (* field name args would be [record ; value] *)
| Efield of longname
| Earray
| Etuple
| Erepeat
| Eselect
| Eselect_dyn
| Eupdate
| Eselect_slice
| Econcat
| Etuple (** (args) *)
| Efun of longname (** "Stateless" longname <<a_params>> (args) reset r *)
| Enode of longname (** "Stateful" longname <<a_params>> (args) reset r *)
| Eifthenelse (** if arg1 then arg2 else arg3 *)
| Efield of longname (** arg1.longname *)
| Efield_update of longname (** { arg1 with longname = arg2 } *)
| Earray (** [ args ] *)
| Earray_fill (** [arg1^arg2] *)
| Eselect (** arg1[a_params] *)
| Eselect_slice (** arg1[a_param1..a_param2] *)
| Eselect_dyn (** arg1.[arg3...] default arg2 *)
| Eupdate (** [ arg1 with a_params = arg2 ] *)
| Econcat (** arg1@@arg2 *)
and ct =
| Ck of ck
@ -105,8 +111,7 @@ type contract =
c_enforce : exp;
c_controllables : var_dec list;
c_local : var_dec list;
c_eq : eq list;
}
c_eq : eq list }
type node_dec =
{ n_name : name;
@ -123,14 +128,14 @@ type node_dec =
type const_dec =
{ c_name : name;
c_value : static_exp;
c_loc : location; }
c_loc : location }
type program =
{ p_pragmas: (name * string) list;
p_opened : name list;
p_types : type_dec list;
p_nodes : node_dec list;
p_consts : const_dec list; }
p_consts : const_dec list }