diff --git a/src/lic.ml b/src/lic.ml index 29b432812f4ad3bb75e2888cadf0fcbcadf328a0..99ca2cca9ed1d1750f2706f5f672b3e3d2a63c82 100644 --- a/src/lic.ml +++ b/src/lic.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/02/2013 (at 17:55) by Erwan Jahier> *) +(* Time-stamp: <modified the 07/02/2013 (at 09:48) by Erwan Jahier> *) (** Define the Data Structure representing Compiled programs. *) @@ -645,17 +645,7 @@ let (clock_of_left: left -> clock) = snd (var_info_of_left left).var_clock_eff -(* utils N.B peut etre different de LicDump ! *) -let string_of_ident x = - if !Global.no_prefix -(* XXX Ce genre de test n'a VRAIMENT rien a faire ici. Dans licDump, ok, mais - pas ici. - - Bon, ca oblige à dupliquer un peu le code, mais tant pis ! - *) - then Ident.no_pack_string_of_long x - - else Ident.string_of_long2 x +let string_of_ident = Ident.string_of_long2 let rec string_of_type = function | Bool_type_eff -> "bool" diff --git a/src/licDump.ml b/src/licDump.ml index 4d69271f3591333535bd30478a4015f1e891be33..f746982dca4200a5374d4de913bf6b7cf6cfb3bd 100644 --- a/src/licDump.ml +++ b/src/licDump.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 06/02/2013 (at 17:56) by Erwan Jahier> *) +(* Time-stamp: <modified the 07/02/2013 (at 09:57) by Erwan Jahier> *) open Errors open Printf @@ -39,6 +39,10 @@ let rec is_a_tuple (e:Lic.val_exp) : bool = | _ -> false (******************************************************************************) +let string_of_ident x = + if !Global.no_prefix + then Ident.no_pack_string_of_long x + else Ident.string_of_long2 x let rec string_of_const_eff = function @@ -151,7 +155,77 @@ and string_def_of_type_eff = function (* exported *) (* On prend le meme que Lic *) -and string_of_type_eff = Lic.string_of_type +and string_of_type_eff = function + | Bool_type_eff -> "bool" + | Int_type_eff -> "int" + | Real_type_eff -> "real" + | External_type_eff (name) -> (string_of_ident name) + | Abstract_type_eff (name, t) -> (string_of_ident name) + | Enum_type_eff (name, _) -> (string_of_ident name) + | Array_type_eff (ty, sz) -> + Printf.sprintf "%s^%d" (string_of_type_eff ty) sz + | Struct_type_eff (name, _) -> (string_of_ident name) + | TypeVar Any -> "any" + | (TypeVar AnyNum) -> "anynum" + +and string_of_type_list = function + | [] -> "" + | [x] -> string_of_type_eff x + | l -> String.concat " * " (List.map string_of_type_eff l) + +and string_of_type_profile (i, o) = + (string_of_type_list i)^" -> "^(string_of_type_list o) + +and string_of_const = function + | Bool_const_eff true -> "true" + | Bool_const_eff false -> "false" + | Int_const_eff i -> (sprintf "%d" i) + | Real_const_eff r -> r + | Extern_const_eff (s,_) -> (string_of_ident s) + | Abstract_const_eff (s,t,v,_) -> (string_of_ident s) + | Enum_const_eff (s,_) -> (string_of_ident s) + | Struct_const_eff (fl, t) -> + let string_of_field (id, veff) = + (Ident.to_string id)^" = "^ (string_of_const veff) + in + Printf.sprintf "%s{%s}" + (string_of_type_eff t) + (String.concat "; " (List.map string_of_field fl)) + | Array_const_eff (ctab, t) -> + Printf.sprintf "[%s]" + (String.concat ", " (List.map string_of_const ctab)) + | Tuple_const_eff cl -> + Printf.sprintf "(%s)" + (String.concat ", " (List.map string_of_const cl)) + +and string_of_var_info x = + (AstCore.string_of_var_nature x.var_nature_eff) ^ " " ^ + (Ident.to_string x.var_name_eff) ^ ":"^(string_of_type_eff x.var_type_eff)^ + (string_of_clock (snd x.var_clock_eff)^"("^ (Ident.to_string (fst x.var_clock_eff)) ^","^ + (string_of_int x.var_number_eff)^")") + +and string_of_var_list vl = String.concat " ; " (List.map string_of_var_info vl) + +and string_of_node_key = function + | (ik, []) -> + (string_of_ident ik) + | (ik, sargs) -> Printf.sprintf "%s<<%s>>" + (string_of_ident ik) + (String.concat ", " (List.map string_of_static_arg sargs)) + +and string_of_static_arg = function + | ConstStaticArgLic(id, ceff) -> Printf.sprintf "const %s = %s" id (string_of_const ceff) + | TypeStaticArgLic (id, teff) -> Printf.sprintf "type %s = %s" id (string_of_type_eff teff) + (* | NodeStaticArgLic (id, ((long,sargs), _, _), _) -> *) + | NodeStaticArgLic (id, nk) -> + Printf.sprintf "node %s = %s" id (string_of_node_key nk) + +and string_of_type_var tv = string_of_type_eff (TypeVar tv) +and string_of_type_matches pm = + let sotm (tv,t) = Printf.sprintf "%s <- %s" + (string_of_type_var tv) (string_of_type_eff t) + in + String.concat ", " (List.map sotm pm) (* for printing recursive node *) and string_of_node_key_rec (nkey: node_key) = @@ -177,11 +251,6 @@ and string_of_node_key_def (nkey: node_key) = | (ik, salst) -> let astrings = List.map (string_of_static_arg) salst in sprintf "%s<<%s>>" (Ident.string_of_long ik) (String.concat ", " astrings) -and string_of_static_arg (sa : Lic.static_arg) = - match sa with - | ConstStaticArgLic (id, ceff) -> sprintf "%s" (string_of_const_eff ceff) - | TypeStaticArgLic (id, teff) -> sprintf "%s" (string_of_type_eff teff) - | NodeStaticArgLic (id, nk) -> string_of_node_key_rec nk (* for inventing a name to parametrized nodes *) and static_arg2string_bis (sa : Lic.static_arg) = diff --git a/src/unifyClock.mli b/src/unifyClock.mli index 07afd0b4b418f20a490dfce3051bef8dea6d8166..44794cac3a37990ff418c2c9161b542304bcb6b9 100644 --- a/src/unifyClock.mli +++ b/src/unifyClock.mli @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 18/01/2013 (at 08:32) by Erwan Jahier> *) +(* Time-stamp: <modified the 07/02/2013 (at 09:41) by Erwan Jahier> *) (** Sub module of EvalClock that defines clock-checking utilities. diff --git a/test/lus2lic.sum b/test/lus2lic.sum index 1ee9be6f1a7fdcba43515a75889c7cc1a61e78e3..48e6204b486b83863155f87c8c54b7126fa4c804 100644 --- a/test/lus2lic.sum +++ b/test/lus2lic.sum @@ -1,4 +1,4 @@ -Test Run By jahier on Wed Feb 6 18:01:32 2013 +Test Run By jahier on Thu Feb 7 09:53:07 2013 Native configuration is i686-pc-linux-gnu === lus2lic tests === diff --git a/test/lus2lic.time b/test/lus2lic.time index 4ac89b10a875b7fdbdd807f103b329fbf36ac663..76997001418c69fdba5c738b15d75c03a8b0ec06 100644 --- a/test/lus2lic.time +++ b/test/lus2lic.time @@ -1,2 +1,2 @@ -testcase ./lus2lic.tests/non-reg.exp completed in 23 seconds -testcase ./lus2lic.tests/progression.exp completed in 1 seconds +testcase ./lus2lic.tests/non-reg.exp completed in 24 seconds +testcase ./lus2lic.tests/progression.exp completed in 0 seconds diff --git a/todo.org b/todo.org index c5ecf9b92ad3f5c5e8f679ba5e9b52050a608c3d..a7816e26f897f6d4bd883df64f71cdd651df1a8b 100644 --- a/todo.org +++ b/todo.org @@ -75,15 +75,6 @@ du with ? comment fait caml ? - State "TODO" from "" [2012-10-26 Fri 14:59] -** TODO const_to_val_eff n'a vraiment rien à faire dans UnifyClock !!! - - - State "TODO" from "" [2013-01-29 Tue 14:26] -file:src/unifyClock.ml::271 - -** TODO aucune fonction dans Lic.*_to_string ne devrait dependre des options de compil - - State "TODO" from "" [2013-02-01 Fri 17:54] -cf le XXX file:src/lic.ml::655 - * Languages issues ** TODO Verifier les boucles combinatoires meme quand on ne genere pas de ec diff --git a/todo.org_archive b/todo.org_archive index d014b851248ff0d7334caa329c1b4e25dbd003c8..d2b53f84ab609db361ae1c61558a68dd7501e762 100644 --- a/todo.org_archive +++ b/todo.org_archive @@ -404,6 +404,33 @@ cf file:./src/lic.ml::206 y virer !! - State "TODO" from "" [2012-10-26 Fri 14:59] +* TODO const_to_val_eff n'a vraiment rien à faire dans UnifyClock !!! + + - State "TODO" from "" [2013-01-29 Tue 14:26] + :PROPERTIES: + :ARCHIVE_TIME: 2013-02-07 Thu 09:42 + :ARCHIVE_FILE: ~/lus2lic/todo.org + :ARCHIVE_OLPATH: Aesthetes issues + :ARCHIVE_CATEGORY: lv6 + :ARCHIVE_TODO: TODO + :END: +file:src/unifyClock.ml::271 + +mouarf, pourquoi pas en fait. + +* TODO aucune fonction dans Lic.*_to_string ne devrait dependre des options de compil + - State "TODO" from "" [2013-02-01 Fri 17:54] + :PROPERTIES: + :ARCHIVE_TIME: 2013-02-07 Thu 09:54 + :ARCHIVE_FILE: ~/lus2lic/todo.org + :ARCHIVE_OLPATH: Aesthetes issues + :ARCHIVE_CATEGORY: lv6 + :ARCHIVE_TODO: TODO + :END: +cf le XXX file:src/lic.ml::655 + + +