Commit dc7ea4b5 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 0.44 Wed, 13 Mar 2002 13:53:40 +0100 by jahier

Parent-Version:      0.43
Version-Log:

Add the possibility to specify the min lower and upper bounds
in the env automata for output and local vars.

Project-Description: Lurette
parent 189430ac
......@@ -14,7 +14,7 @@
(source/env.mli 2389 1015250295 15_env.mli 1.9)
(test/heater_float.rif.exp 1461 1015514807 b/30_heater_flo 1.2)
(lurette.depfull.dot 49 1007651448 b/5_lurette.de 1.2)
(source/env.ml 9792 1016011748 16_env.ml 1.18)
(source/env.ml 9771 1016013431 16_env.ml 1.19)
(make_lurette 812 1013517738 27_make_luret 1.7)
(test/vrai_tram.lus 453 1007379917 b/6_vrai_tram. 1.1)
(lurette.dep.dot 49 1007651448 b/4_lurette.de 1.2)
......@@ -27,7 +27,7 @@
(doc/automata_format 0 1007379917 b/3_automata_f 1.1)
(source/eval.ml 8050 1016011748 49_eval.ml 1.11)
(source/gen_stubs.ml 33424 1015408234 24_generate_l 1.19)
(source/parse_env.ml 9415 1015605037 41_parse_env. 1.8)
(source/parse_env.ml 11322 1016024020 41_parse_env. 1.9)
(interface/TAGS 1956 1007380262 26_TAGS 1.3)
(source/sim2chro.ml 2669 1015408234 b/24_sim2chro.m 1.4)
(doc/Interface_draft 5232 1003928781 19_Interface_ 1.1)
......@@ -43,7 +43,7 @@
(README 74 1011881677 10_README 1.2)
(test/ControleurPorte.c 9407 1012914629 b/19_Controleur 1.1)
(OcamlMakefile 19189 1016011748 17_OcamlMakef 1.21)
(test/ControleurPorte.rif.exp 4746 1016011748 b/29_Controleur 1.2)
(test/ControleurPorte.rif.exp 4746 1016013431 b/29_Controleur 1.3)
(test/tram.env 905 1015605037 b/15_tram.env 1.3)
(source/show_env.ml 2961 1014048376 43_show_env.m 1.3)
(doc/synthese 2556 1007379917 b/2_synthese 1.1)
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 43)
(Parent-Version lurette 0 42)
(Project-Version lurette 0 44)
(Parent-Version lurette 0 43)
(Version-Log "
Checks that nodes in .env files are contiguous as the code suppose they are.
Also cleanup a little bit the code in env.ml as (I was reinventing map ...)
Add the possibility to specify the min lower and upper bounds
in the env automata for output and local vars.
")
(New-Version-Log "")
(Checkin-Time "Wed, 13 Mar 2002 10:57:11 +0100")
(Checkin-Time "Wed, 13 Mar 2002 13:53:40 +0100")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -38,7 +37,7 @@ Also cleanup a little bit the code in env.ml as (I was reinventing map ...)
(source/rnumsolver.ml (lurette/b/27_rnumsolver 1.3 644))
(source/parse_env.mli (lurette/40_parse_env. 1.5 644))
(source/parse_env.ml (lurette/41_parse_env. 1.8 644))
(source/parse_env.ml (lurette/41_parse_env. 1.9 644))
(source/show_env.mli (lurette/42_show_env.m 1.5 644))
(source/show_env.ml (lurette/43_show_env.m 1.3 644))
......
......@@ -99,11 +99,11 @@ let rec (parse_automata: aut_token -> read_automata) =
'Genlex.Kwd "," ;
'Genlex.Ident "output"; 'Genlex.Ident "vars"; 'Genlex.Kwd "=";
'Genlex.Kwd "[" ; lo = parse_list_var ; 'Genlex.Kwd "]" ;
'Genlex.Kwd "[" ; lo = parse_list_genvar ; 'Genlex.Kwd "]" ;
'Genlex.Kwd "," ;
'Genlex.Ident "local"; 'Genlex.Ident "vars"; 'Genlex.Kwd "=";
'Genlex.Kwd "[" ; ll = parse_list_var ; 'Genlex.Kwd "]" ;
'Genlex.Kwd "[" ; ll = parse_list_genvar ; 'Genlex.Kwd "]" ;
'Genlex.Kwd "," ;
'Genlex.Ident "pre"; 'Genlex.Ident "vars"; 'Genlex.Kwd "=";
......@@ -119,6 +119,66 @@ let rec (parse_automata: aut_token -> read_automata) =
raise e
and (parse_list_genvar: aut_token -> vnt list) =
fun tok ->
let tok_list = Stream.npeek 10 tok in
try
parse_list (parse_genvar) tok
with e ->
print_err_msg tok_list "parse_list_genvar" ;
raise e
and (parse_genvar: aut_token -> vnt) =
fun tok ->
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "("; 'Genlex.Ident var; 'Genlex.Kwd ","; 'Genlex.Ident typ ;
vnt = parse_type var typ >]
-> vnt
with e ->
print_err_msg tok_list "parse_genvar" ;
raise e
and (parse_type: string -> string -> aut_token -> vnt) =
fun var typ tok ->
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd ")" >] ->
( match typ with
"bool" -> (var, BoolT)
| "float" -> (var, FloatT(-.max_float, max_float))
| "int" -> (var, IntT(min_int, max_int))
| str -> failwith ("*** Bad type in .env: " ^ str )
)
| [< 'Genlex.Kwd ","; vnt = parse_type_more var typ >] -> vnt
with e ->
print_err_msg tok_list "parse_type" ;
raise e
and (parse_type_more: string -> string -> aut_token -> vnt) =
fun var typ tok ->
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Int min; 'Genlex.Kwd ","; 'Genlex.Int max; 'Genlex.Kwd ")" >] ->
( match typ with
"bool" -> failwith ("*** int expected in .env" )
| "float" -> failwith ("*** int expected in .env " )
| "int" -> (var, IntT(min, max))
| str -> failwith ("*** Bad type in .env: " ^ str )
)
| [< 'Genlex.Float min; 'Genlex.Kwd ","; 'Genlex.Float max; 'Genlex.Kwd ")" >] ->
( match typ with
"bool" -> failwith ("*** float expected in .env " )
| "float" -> (var, FloatT(min, max))
| "int" -> failwith ("*** float expected in .env " )
| str -> failwith ("*** Bad type in .env: " ^ str )
)
with e ->
print_err_msg tok_list "parse_type_more" ;
raise e
and (parse_list_var: aut_token -> vnt list) =
fun tok ->
let tok_list = Stream.npeek 10 tok in
......@@ -137,7 +197,6 @@ and (parse_var: aut_token -> vnt) =
->
( match typ with
"bool" -> (var, BoolT)
(* XXX Rajouter dans le format un moyen de prciser ces bornes *)
| "float" -> (var, FloatT(-.max_float, max_float))
| "int" -> (var, IntT(min_int, max_int))
| str -> failwith ("*** Bad type in .env: " ^ str )
......
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