From 5cc57cd3b06cc5b9c673f68006b4f0153bd899c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Mon, 5 Jul 2010 12:13:57 +0200 Subject: [PATCH] Static_exps should be in types. field name of ops is a param. --- compiler/global/static.ml | 10 ---------- compiler/global/types.ml | 19 +++++++++++++++---- compiler/minils/minils.ml | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/compiler/global/static.ml b/compiler/global/static.ml index 7ca3738..d038b14 100644 --- a/compiler/global/static.ml +++ b/compiler/global/static.ml @@ -17,16 +17,6 @@ open Names open Format -type static_exp = - | Svar of name - | Sint of int - | Sfloat of float - | Sbool of bool - | Sconstructor of longname - | Stuple of static_exp list - | Sarray_power of static_exp * static_exp (** power : 0^n : [0,0,0,0,0,..] *) - | Sarray of static_exp list (** [ e1, e2, e3 ] *) - | Sop of longname * static_exp list (** defined ops for now in pervasives *) (** Constraints on size expressions. *) type size_constraint = diff --git a/compiler/global/types.ml b/compiler/global/types.ml index 7637d63..53496a5 100644 --- a/compiler/global/types.ml +++ b/compiler/global/types.ml @@ -6,15 +6,26 @@ (* Organization : Demons, LRI, University of Paris-Sud, Orsay *) (* *) (**************************************************************************) -open Static + open Names -type ty = - | Tprod of ty list | Tid of longname | Tarray of ty * static_exp + +type ty = | Tprod of ty list | Tid of longname | Tarray of ty * static_exp + +type static_exp = { se_desc: static_exp_desc; se_typ: loc: location } + | Svar of name + | Sint of int + | Sfloat of float + | Sbool of bool + | Sconstructor of longname + | Stuple of static_exp list + | Sarray_power of static_exp * static_exp (** power : 0^n : [0,0,0,0,0,..] *) + | Sarray of static_exp list (** [ e1, e2, e3 ] *) + | Sop of longname * static_exp list (** defined ops for now in pervasives *) let invalid_type = Tprod [] -let const_array_of ty n = Tarray (ty, Sconst n) +let const_array_of ty n = Tarray (ty, SConst n) (* TODO ??? *) open Pp_tools open Format diff --git a/compiler/minils/minils.ml b/compiler/minils/minils.ml index 238fe08..8c788e1 100644 --- a/compiler/minils/minils.ml +++ b/compiler/minils/minils.ml @@ -62,8 +62,8 @@ and op = | Efun of longname (** "Stateless" longname <> (args) reset r *) | Enode of longname (** "Stateful" longname <> (args) reset r *) | Eifthenelse (** if arg1 then arg2 else arg3 *) - | Efield of longname (** arg1.longname *) - | Efield_update of longname (** { arg1 with longname = arg2 } *) + | Efield (** arg1.a_param1 *) + | Efield_update (** { arg1 with a_param1 = arg2 } *) | Earray (** [ args ] *) | Earray_fill (** [arg1^arg2] *) | Eselect (** arg1[a_params] *)