Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 87afe5b2 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 0.85 Wed, 11 Sep 2002 11:29:44 +0200 by jahier

Parent-Version:      0.84
Version-Log:

source/gen_stubs.ml:
   Add a lurette_stub__ prefix to most function names to make sure
   that there is no name clashes. In particular, oracle can now be
   called oracle.lus ... (but not lurette_stub__oracle.lus, which is not
   so bad...).

Project-Description: Lurette
parent 86a22707
......@@ -13,7 +13,7 @@
(myrules 9937 1031732392 c/14_myrules 1.1)
(test/test_gen_stubs.h 1818 1020068208 b/45_test_gen_s 1.1)
(source/command_line.ml 4625 1031053030 b/20_command_li 1.8)
(source/lurette.ml 12371 1031053030 12_lurette.ml 1.49)
(source/lurette.ml 12417 1031736584 12_lurette.ml 1.50)
(source/solver.mli 1003 1027092697 38_solver.mli 1.13)
(source/env.mli 2028 1027349504 15_env.mli 1.15)
(test/heater_float.rif.exp 1456 1031732392 b/30_heater_flo 1.6)
......@@ -33,7 +33,7 @@
(doc/automata_format 0 1007379917 b/3_automata_f 1.1)
(source/control.ml 4416 1030975996 c/4_control.ml 1.3)
(source/eval.ml 7755 1027066799 49_eval.ml 1.13)
(source/gen_stubs.ml 33416 1031732392 24_generate_l 1.32)
(source/gen_stubs.ml 34183 1031736584 24_generate_l 1.33)
(source/parse_env.ml 22510 1031732392 41_parse_env. 1.23)
(doc/ocamldoc.hva 313 1008328137 b/13_ocamldoc.h 1.1)
(source/automata.mli 3397 1027349504 b/46_automata.m 1.2)
......@@ -58,11 +58,11 @@
(OcamlMakefile 21240 1031732392 17_OcamlMakef 1.38)
(source/command_line_ima_exe.ml 2792 1031732392 b/33_command_li 1.5)
(test/ControleurPorte.rif.exp 4756 1028297733 b/29_Controleur 1.8)
(Makefile.lurette 642 1031732392 b/38_Makefile.l 1.9)
(Makefile.lurette 678 1031736584 b/38_Makefile.l 1.10)
(source/show_env.ml 3603 1030532285 43_show_env.m 1.12)
(source/gne.mli 1079 1027066799 b/36_gne.mli 1.2)
(source/automata.ml 15814 1030975671 b/47_automata.m 1.3)
(ihm/xlurette/xlurette_glade_main.ml 5032 1031732392 c/12_xlurette_g 1.1)
(ihm/xlurette/xlurette_glade_main.ml 5077 1031736584 c/12_xlurette_g 1.2)
(doc/synthese 2556 1007379917 b/2_synthese 1.1)
(bin/Makefile.lurette_lib 1768 1031732392 c/2_Makefile.l 1.2)
(bin/Makefile.gen_stubs 472 1030532285 b/42_Makefile.g 1.2)
......
......@@ -15,8 +15,8 @@ INCDIRS = /home/jahier/include
LIBDIRS = /home/jahier/lib
SOURCES_C = $(SUT) sut_stub.c sut_idl_stub.idl \
$(ORACLE) oracle_stub.c oracle_idl_stub.idl
SOURCES_C = $(SUT) lurette_stub__sut.c lurette_stub__sut_idl.idl \
$(ORACLE) lurette_stub__oracle.c lurette_stub__oracle_idl.idl
SOURCES_OCAML = \
......
......@@ -17,6 +17,8 @@ class customized_callbacks = object(self)
inherit Xlurette_glade_callbacks.default_callbacks
method quit () =
output_string oc "quit\n";
flush oc;
prerr_endline "bye! " ;
Unix.kill !pid 9;
exit 0
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 84)
(Parent-Version lurette 0 83)
(Version-Log "")
(New-Version-Log "")
(Checkin-Time "Wed, 11 Sep 2002 10:19:52 +0200")
(Project-Version lurette 0 85)
(Parent-Version lurette 0 84)
(Version-Log "
source/gen_stubs.ml:
Add a lurette_stub__ prefix to most function names to make sure
that there is no name clashes. In particular, oracle can now be
called oracle.lus ... (but not lurette_stub__oracle.lus, which is not
so bad...).
")
(New-Version-Log ""
)
(Checkin-Time "Wed, 11 Sep 2002 11:29:44 +0200")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -24,7 +34,7 @@
;; Sources files for lurette only
(source/lurette.mli (lurette/11_lurette.ml 1.12 644))
(source/lurette.ml (lurette/12_lurette.ml 1.49 644))
(source/lurette.ml (lurette/12_lurette.ml 1.50 644))
(source/command_line.ml (lurette/b/20_command_li 1.8 644))
(source/command_line.mli (lurette/b/21_command_li 1.7 644))
......@@ -72,7 +82,7 @@
(source/gne.ml (lurette/b/37_gne.ml 1.2 644))
(source/lurettetop.ml (lurette/c/1_lurettetop 1.7 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.32 644))
(source/gen_stubs.ml (lurette/24_generate_l 1.33 644))
(source/control.mli (lurette/c/3_control.ml 1.2 644))
(source/control.ml (lurette/c/4_control.ml 1.3 644))
......@@ -82,7 +92,7 @@
;; Make files
(OcamlMakefile (lurette/17_OcamlMakef 1.38 644))
(Makefile.lurette (lurette/b/38_Makefile.l 1.9 644))
(Makefile.lurette (lurette/b/38_Makefile.l 1.10 644))
(bin/Makefile.show_ima (lurette/b/40_Makefile.s 1.4 644))
(bin/Makefile.ima_exe (lurette/b/41_Makefile.i 1.3 644))
......@@ -151,7 +161,7 @@
;; Files added by populate at Wed, 04 Sep 2002 09:48:05 +0200,
;; to version 0.83(w), by jahier:
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.1 644))
(ihm/xlurette/xlurette_glade_main.ml (lurette/c/12_xlurette_g 1.2 644))
(ihm/xlurette/xlurette.glade (lurette/c/13_xlurette.g 1.1 644))
;; Files added by populate at Wed, 04 Sep 2002 17:24:47 +0200,
......
......@@ -270,7 +270,7 @@ let _ = assert ((check_var_type
*)
let (generate_stub_c: module_name -> string -> vn_ct list -> vn_ct list -> unit) =
fun mod_name str vi vo ->
let oc = open_out (str ^ "_stub.c.new") in
let oc = open_out (str ^ ".c.new") in
let put s = output_string oc s in
let ov = List.rev vo in
let (lo_v, lo_t) = List.hd ov in
......@@ -372,7 +372,7 @@ type sut_or_oracle = string
let (generate_idl : module_name -> sut_or_oracle -> vn_ct list -> vn_ct list
-> unit) =
fun mod_name str vi vo ->
let oc = open_out (str ^ "_idl_stub.idl.new") in
let oc = open_out (str ^ "_idl.idl.new") in
let put s = output_string oc s in
let ov = List.rev vo in
let (lo_v, lo_t) = List.hd ov in
......@@ -623,7 +623,7 @@ let (generate_lurette_stub_file: vn_ct_mlt_fvn list * vn_ct_mlt_fvn list -> unit
** e.g., if mltl_in = [int, bool], then fvnl_in = ["N(I(x1))"; "B(x2)"]
*)
put "(* Automatically generated from sut_idl_stub.ml by bin/gen_stubs. *)\n" ;
put "(* Automatically generated from lurette_stub__sut_idl.ml by bin/gen_stubs. *)\n" ;
put "open Format\n";
put "open Hashtbl\n";
put "open Formula\n\n";
......@@ -712,7 +712,7 @@ let (generate_lurette_stub_file: vn_ct_mlt_fvn list * vn_ct_mlt_fvn list -> unit
put " fun input_sl ->\n let (" ;
put (format_string_list ", \n\t" fvnl_in) ;
put ") = subst_list_to_sut_in input_sl in \n" ;
put " let output_tuple = Sut_idl_stub.sut_try " ;
put " let output_tuple = Lurette_stub__sut_idl.lurette_stub__sut_try " ;
put (format_string_list " \n\t" fvnl_in) ;
put " in \n" ;
put " sut_out_to_env_in output_tuple \n\n" ;
......@@ -725,7 +725,7 @@ let (generate_lurette_stub_file: vn_ct_mlt_fvn list * vn_ct_mlt_fvn list -> unit
put " fun input_sl ->\n let (" ;
put (format_string_list ", \n\t" fvnl_in) ;
put ") = subst_list_to_sut_in input_sl in \n" ;
put " let output_tuple = Sut_idl_stub.sut_step " ;
put " let output_tuple = Lurette_stub__sut_idl.lurette_stub__sut_step " ;
put (format_string_list " \n\t" fvnl_in) ;
put " in \n" ;
put " sut_out_to_env_in output_tuple \n\n" ;
......@@ -742,7 +742,7 @@ let (generate_lurette_stub_file: vn_ct_mlt_fvn list * vn_ct_mlt_fvn list -> unit
put " let (";
put (format_string_list ", \n\t " fvnl_out) ;
put ") = env_in_to_sut_out sut_output in \n" ;
put " Oracle_idl_stub.oracle_try " ;
put " Lurette_stub__oracle_idl.lurette_stub__oracle_try " ;
put (format_string_list " \n\t" fvnl_in) ;
put " " ;
put (format_string_list " \n\t" fvnl_out) ;
......@@ -759,7 +759,7 @@ let (generate_lurette_stub_file: vn_ct_mlt_fvn list * vn_ct_mlt_fvn list -> unit
put " let (";
put (format_string_list ", \n\t " fvnl_out) ;
put ") = env_in_to_sut_out sut_output in \n" ;
put " Oracle_idl_stub.oracle_step " ;
put " Lurette_stub__oracle_idl.lurette_stub__oracle_step " ;
put (format_string_list " \n\t" fvnl_in) ;
put " " ;
put (format_string_list " \n\t" fvnl_out) ;
......@@ -819,8 +819,11 @@ let update_file new_file old_file =
not ((Sys.file_exists old_file)) ||
((Util.readfile old_file) <> (Util.readfile new_file))
then
Unix.rename new_file old_file
try Unix.rename new_file old_file
with _ ->
prerr_endline ("*** Error: " ^ new_file ^ " does not exist.\n");
exit 2
let main2 sut oracle =
let sut_h = (sut ^ ".h") in
let oracle_h = (oracle ^ ".h") in
......@@ -861,20 +864,21 @@ let main2 sut oracle =
(match check_var_type oracle_vi_ord oracle_vi_ord_decl oracle_vo with
Ok -> () | Error(err_msg) -> failwith err_msg );
generate_stub_c sut_m "sut" sut_vi_ord sut_vo_ord ;
generate_idl sut_m "sut" sut_vi_ord sut_vo_ord ;
generate_stub_c sut_m "lurette_stub__sut" sut_vi_ord sut_vo_ord ;
generate_idl sut_m "lurette_stub__sut" sut_vi_ord sut_vo_ord ;
generate_stub_c oracle_m "oracle" oracle_vi_ord oracle_vo ;
generate_idl oracle_m "oracle" oracle_vi_ord oracle_vo ;
generate_stub_c oracle_m "lurette_stub__oracle" oracle_vi_ord oracle_vo ;
generate_idl oracle_m "lurette_stub__oracle" oracle_vi_ord oracle_vo ;
generate_lurette_stub_file (get_ml_type sut_vi_ord sut_vo_ord) ;
(* Update the stubs iff they have changed to avoid unnecessary re-compilations *)
update_file "sut_idl_stub.idl.new" "sut_idl_stub.idl" ;
update_file "sut_stub.c.new" "sut_stub.c" ;
(* Update the stubs iff they have changed to avoid unnecessary
re-compilations *)
update_file "lurette_stub__sut_idl.idl.new" "lurette_stub__sut_idl.idl" ;
update_file "lurette_stub__sut.c.new" "lurette_stub__sut.c" ;
update_file "oracle_idl_stub.idl.new" "oracle_idl_stub.idl" ;
update_file "oracle_stub.c.new" "oracle_stub.c" ;
update_file "lurette_stub__oracle_idl.idl.new" "lurette_stub__oracle_idl.idl" ;
update_file "lurette_stub__oracle.c.new" "lurette_stub__oracle.c" ;
update_file "lurette_stub.ml.new" "lurette_stub.ml"
......@@ -980,6 +984,9 @@ let (main : unit -> 'a) =
try Util.readfile "always_true.lus"
with _ -> ""
in
if sut = "lurette_stub__sut" then
prerr ("You can call your file lurette_stub__sut.lus, sorry ;" ^
"please rename it.\n");
compile_lustre_program_if_needed sut;
gen_a_fake_oracle sut;
( if
......@@ -1004,6 +1011,12 @@ let (main : unit -> 'a) =
let sut = Sys.argv.(1) in
let oracle = Sys.argv.(2) in
let _ =
if sut = "lurette_stub__sut" then
prerr ("You can call your file lurette_stub__sut.lus, sorry ;" ^
"please rename it.\n");
if oracle = "lurette_stub__oracle" then
prerr ("You can call your file lurette_stub__oracle.lus, sorry ;" ^
"please rename it.\n");
compile_lustre_program_if_needed sut;
compile_lustre_program_if_needed oracle
in
......
......@@ -204,8 +204,8 @@ and
flush stdout ;
(* Initialisation of the sut and the oracle *)
Sut_idl_stub.sut_init ();
Oracle_idl_stub.oracle_init ();
Lurette_stub__sut_idl.lurette_stub__sut_init ();
Lurette_stub__oracle_idl.lurette_stub__oracle_init ();
check_var_decl_consistency Lurette_stub.sut_input_var_name_and_type_list
Lurette_stub.sut_output_var_name_and_type_list;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment