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

lurette 0.50 Wed, 27 Mar 2002 13:36:39 +0100 by jahier

Parent-Version:      0.49
Version-Log:

Add the possibility to put pragmas in the .env files.

Project-Description: Lurette
parent 94d83c01
;; This file is automatically generated, editing may cause PRCS to do
;; REALLY bad things.
(Created-By-Prcs-Version 1 3 3)
(test/usager.env 424 1015605037 b/14_usager.env 1.4)
(test/usager.env 446 1017156165 b/14_usager.env 1.5)
(source/command_line_ima_exe.mli 989 1016127950 b/34_command_li 1.1)
(doc/ocamldoc.sty 1380 1008328137 b/12_ocamldoc.s 1.1)
(source/env_state.ml 2978 1016803757 51_env_state. 1.15)
......@@ -19,7 +19,7 @@
(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)
(test/passerelle.env 821 1015605037 b/17_passerelle 1.3)
(test/passerelle.env 925 1017156165 b/17_passerelle 1.4)
(doc/archi.fig 3693 1003928781 20_archi.fig 1.1)
(source/rnumsolver.ml 10788 1016803757 b/27_rnumsolver 1.4)
(source/parse_env.mli 907 1016127950 40_parse_env. 1.6)
......@@ -29,7 +29,7 @@
(doc/automata_format 0 1007379917 b/3_automata_f 1.1)
(source/eval.ml 7749 1016803757 49_eval.ml 1.12)
(source/gen_stubs.ml 33406 1016803757 24_generate_l 1.20)
(source/parse_env.ml 12471 1016803757 41_parse_env. 1.10)
(source/parse_env.ml 13888 1017232599 41_parse_env. 1.12)
(interface/TAGS 1956 1007380262 26_TAGS 1.3)
(source/sim2chro.ml 2663 1016803757 b/24_sim2chro.m 1.6)
(doc/Interface_draft 5232 1003928781 19_Interface_ 1.1)
......@@ -39,7 +39,7 @@
(test/Makefile_ima_exe 1622 1016803757 b/35_Makefile_i 1.2)
(source/command_line.mli 1317 1016024341 b/21_command_li 1.4)
(source/wtree.mli 2340 1016011748 b/0_wtree.mli 1.7)
(test/porte.env 834 1015605037 b/16_porte.env 1.3)
(test/porte.env 950 1017156165 b/16_porte.env 1.4)
(source/env_state.mli 3851 1016803757 50_env_state. 1.13)
(source/rnumsolver.mli 1758 1016803757 b/26_rnumsolver 1.2)
(source/ima_exe.mli 447 1016127950 b/31_ima_exe.ml 1.1)
......@@ -49,7 +49,7 @@
(OcamlMakefile 19280 1016127950 17_OcamlMakef 1.22)
(source/command_line_ima_exe.ml 2400 1016803757 b/33_command_li 1.2)
(test/ControleurPorte.rif.exp 4746 1016803757 b/29_Controleur 1.4)
(test/tram.env 905 1015605037 b/15_tram.env 1.3)
(test/tram.env 990 1017156165 b/15_tram.env 1.4)
(source/show_env.ml 2961 1014048376 43_show_env.m 1.3)
(source/gne.mli 1107 1016803757 b/36_gne.mli 1.1)
(doc/synthese 2556 1007379917 b/2_synthese 1.1)
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette 0 49)
(Parent-Version lurette 0 48)
(Project-Version lurette 0 50)
(Parent-Version lurette 0 49)
(Version-Log "
Clean up a little bit the ima format to make it sipler to parse
and to avoid reducing the naming space as much as possible.
Add the possibility to put pragmas in the .env files.
")
(New-Version-Log "")
(Checkin-Time "Tue, 26 Mar 2002 16:22:45 +0100")
(Checkin-Time "Wed, 27 Mar 2002 13:36:39 +0100")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -49,7 +47,7 @@ and to avoid reducing the naming space as much as possible.
(source/rnumsolver.ml (lurette/b/27_rnumsolver 1.4 644))
(source/parse_env.mli (lurette/40_parse_env. 1.6 644))
(source/parse_env.ml (lurette/41_parse_env. 1.11 644))
(source/parse_env.ml (lurette/41_parse_env. 1.12 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))
......
......@@ -57,6 +57,8 @@ let print_err_msg tok_list func =
end
else ()
(** Parsing lists *)
let rec
......@@ -67,6 +69,7 @@ let rec
match tok with parser
| [< 'Genlex.Kwd "," >] -> [] (* empty list *)
| [< 'Genlex.Kwd "." >] -> [] (* empty list *)
| [< 'Genlex.Kwd "%" >] -> [] (* empty list *)
| [< vnt = parse ; tail = (parse_list_var_tail (parse)) >]
-> vnt :: tail
with e ->
......@@ -77,8 +80,9 @@ and (parse_list_var_tail: (aut_token -> 'a) -> aut_token -> 'a list) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
| [< 'Genlex.Kwd ",">] -> [] (* end of the list *)
| [< 'Genlex.Kwd ".">] -> [] (* end of the list *)
| [< 'Genlex.Kwd "," >] -> [] (* end of the list *)
| [< 'Genlex.Kwd "." >] -> [] (* end of the list *)
| [< 'Genlex.Kwd "%" >] -> [] (* end of the list *)
| [< 'Genlex.Kwd ";" ; a = parse ;
tail = (parse_list_var_tail (parse)) >]
-> a :: tail
......@@ -87,6 +91,35 @@ and (parse_list_var_tail: (aut_token -> 'a) -> aut_token -> 'a list) =
raise e
(** Parsing pragmas *)
type pragma = string * string
let rec (parse_pragma: aut_token -> pragma) =
fun tok ->
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.String label ; 'Genlex.Ident ":";
'Genlex.String pragma >] -> (label, pragma)
with e ->
print_err_msg tok_list "parse_pragma" ;
raise e
and
(parse_pragma_list: aut_token -> pragma list) =
fun tok ->
let tok_list = Stream.npeek 10 tok in
try
( match (Stream.npeek 1 tok) with
[Genlex.Kwd "%"] ->
( match tok with parser
[< 'Genlex.Kwd "%" ; pl = (parse_list (parse_pragma)) >] -> pl
)
| _ -> []
)
with e ->
print_err_msg tok_list "parse_pragma_list" ;
raise e
let rec (parse_automata: aut_token -> read_automata) =
fun tok ->
......@@ -121,7 +154,8 @@ and (parse_genvar: aut_token -> vnt) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "("; 'Genlex.Ident var; 'Genlex.Kwd ","; 'Genlex.Ident typ ;
[< 'Genlex.Kwd "("; 'Genlex.Ident var; pl = parse_pragma_list ;
'Genlex.Kwd ","; 'Genlex.Ident typ ;
vnt = parse_type var typ >]
-> vnt
with e ->
......@@ -181,8 +215,9 @@ and (parse_var: aut_token -> vnt) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "("; 'Genlex.Ident var; 'Genlex.Kwd ",";
'Genlex.Ident typ ; 'Genlex.Kwd ")" >]
[< 'Genlex.Kwd "("; 'Genlex.Ident var;
prag_var = parse_pragma_list ;
'Genlex.Kwd ","; 'Genlex.Ident typ ; 'Genlex.Kwd ")" >]
->
( match typ with
"bool" -> (var, BoolT)
......@@ -242,18 +277,26 @@ and (parse_formula: vnt list -> aut_token -> formula) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "!"; f1 = parse_formula vars;
f = parse_more_formula (Not(f1)) vars >] -> f
| [< 'Genlex.Kwd "IfThenElse"; f1 = parse_formula vars; f2 = parse_formula vars;
f3 = parse_formula vars >] -> IteB(f1, f2, f3)
| [< 'Genlex.Kwd "("; f1 = parse_formula vars ; 'Genlex.Kwd ")" ;
f = parse_more_formula f1 vars >] -> f
| [< 'Genlex.Kwd "true" ; f = parse_more_formula True vars>] -> f
| [< 'Genlex.Kwd "false" ; f = parse_more_formula False vars>] -> f
| [< 'Genlex.Ident id ; f1 = parse_expr_or_bool_ident id vars;
f = parse_more_formula f1 vars>] -> f
[< 'Genlex.Kwd "!"; pl = parse_pragma_list ;
f1 = parse_formula vars;
f = parse_more_formula (Not(f1)) vars
>] -> f
| [< 'Genlex.Kwd "IfThenElse"; pl = parse_pragma_list ;
f1 = parse_formula vars;
f2 = parse_formula vars;
f3 = parse_formula vars >] -> IteB(f1, f2, f3)
| [< 'Genlex.Kwd "(";
f1 = parse_formula vars ; 'Genlex.Kwd ")" ;
f = parse_more_formula f1 vars >] -> f
| [< 'Genlex.Kwd "true" ; pl = parse_pragma_list ;
f = parse_more_formula True vars >] -> f
| [< 'Genlex.Kwd "false" ; pl = parse_pragma_list ;
f = parse_more_formula False vars >] -> f
| [< 'Genlex.Ident id ; pl = parse_pragma_list ;
f1 = parse_expr_or_bool_ident id vars;
f = parse_more_formula f1 vars >] -> f
| [< e1 = parse_expr vars ; f1 = parse_expr_right e1 vars ;
f = parse_more_formula f1 vars >] -> f
f = parse_more_formula f1 vars >] -> f
with e ->
print_err_msg tok_list "parse_formula" ;
raise e
......@@ -270,11 +313,11 @@ and (parse_expr_or_bool_ident: string -> vnt list -> aut_token -> formula) =
in
try
match tok with parser
[< 'Genlex.Kwd "="; e2 = parse_expr vars >] -> Eq(var, e2)
| [< 'Genlex.Kwd ">"; e2 = parse_expr vars >] -> Sup(var, e2)
| [< 'Genlex.Kwd ">="; e2 = parse_expr vars >] -> SupEq(var, e2)
| [< 'Genlex.Kwd "<"; e2 = parse_expr vars >] -> Inf(var, e2)
| [< 'Genlex.Kwd "<="; e2 = parse_expr vars >] -> InfEq(var, e2)
[< 'Genlex.Kwd "="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Eq(var, e2)
| [< 'Genlex.Kwd ">"; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Sup(var, e2)
| [< 'Genlex.Kwd ">="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> SupEq(var, e2)
| [< 'Genlex.Kwd "<"; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Inf(var, e2)
| [< 'Genlex.Kwd "<="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> InfEq(var, e2)
| [< f = parse_more_formula (Bvar(id)) vars >] -> f
with e ->
print_err_msg tok_list "parse_expr_or_bool_ident" ;
......@@ -285,8 +328,8 @@ and (parse_more_formula: formula -> vnt list -> aut_token -> formula) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "||"; f2 = parse_formula vars >] -> Or(f1, f2)
| [< 'Genlex.Kwd "&&"; f2 = parse_formula vars >] -> And(f1, f2)
[< 'Genlex.Kwd "||"; pl = parse_pragma_list ; f2 = parse_formula vars >] -> Or(f1, f2)
| [< 'Genlex.Kwd "&&"; pl = parse_pragma_list ; f2 = parse_formula vars >] -> And(f1, f2)
| [< >] -> f1
with e ->
print_err_msg tok_list "parse_more_formula" ;
......@@ -296,11 +339,11 @@ and (parse_expr_right : expr -> vnt list -> aut_token -> formula) =
let tok_list = Stream.npeek 10 tok in
try
match tok with parser
[< 'Genlex.Kwd "="; e2 = parse_expr vars >] -> Eq(e1, e2)
| [< 'Genlex.Kwd ">"; e2 = parse_expr vars >] -> Sup(e1, e2)
| [< 'Genlex.Kwd ">="; e2 = parse_expr vars >] -> SupEq(e1, e2)
| [< 'Genlex.Kwd "<"; e2 = parse_expr vars >] -> Inf(e1, e2)
| [< 'Genlex.Kwd "<="; e2 = parse_expr vars >] -> InfEq(e1, e2)
[< 'Genlex.Kwd "="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Eq(e1, e2)
| [< 'Genlex.Kwd ">"; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Sup(e1, e2)
| [< 'Genlex.Kwd ">="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> SupEq(e1, e2)
| [< 'Genlex.Kwd "<"; pl = parse_pragma_list ; e2 = parse_expr vars >] -> Inf(e1, e2)
| [< 'Genlex.Kwd "<="; pl = parse_pragma_list ; e2 = parse_expr vars >] -> InfEq(e1, e2)
with e ->
print_err_msg tok_list "parse_expr_rigth" ;
raise e
......@@ -317,9 +360,11 @@ and (parse_expr: vnt list -> aut_token -> expr) =
and (parse_more_adds: expr -> vnt list -> aut_token -> expr) =
fun e1 vars tok ->
match tok with parser
[< 'Genlex.Kwd "+"; e2 = parse_mult vars;
[< 'Genlex.Kwd "+"; pl = parse_pragma_list ;
e2 = parse_mult vars;
e = parse_more_adds (Sum(e1, e2)) vars >] -> e
| [< 'Genlex.Kwd "-"; e2 = parse_mult vars;
| [< 'Genlex.Kwd "-"; pl = parse_pragma_list ;
e2 = parse_mult vars;
e = parse_more_adds (Diff(e1, e2)) vars >] -> e
| [< >] -> e1
and (parse_mult: vnt list -> aut_token -> expr) =
......@@ -329,28 +374,33 @@ and (parse_mult: vnt list -> aut_token -> expr) =
and (parse_more_mults: expr -> vnt list -> aut_token -> expr) =
fun e1 vars tok ->
match tok with parser
[< 'Genlex.Kwd "*"; e2 = parse_simple vars;
[< 'Genlex.Kwd "*"; pl = parse_pragma_list ;
e2 = parse_simple vars;
e = parse_more_mults (Prod(e1, e2)) vars >] -> e
| [< 'Genlex.Kwd "/"; e2 = parse_simple vars;
| [< 'Genlex.Kwd "/"; pl = parse_pragma_list ;
e2 = parse_simple vars;
e = parse_more_mults (Quot(e1, e2)) vars >] -> e
| [< 'Genlex.Kwd "mod"; e2 = parse_simple vars;
| [< 'Genlex.Kwd "mod"; pl = parse_pragma_list ;
e2 = parse_simple vars;
e = parse_more_mults (Mod(e1, e2)) vars >] -> e
| [< >] -> e1
and (parse_simple: vnt list -> aut_token -> expr) =
fun vars tok ->
match tok with parser
[< 'Genlex.Ident s >] ->
[< 'Genlex.Ident s ; pl = parse_pragma_list >] ->
let (_, vt) = List.find (fun (vn,vt) -> vn = s) vars in
let var =
match vt with
BoolT -> assert false
BoolT -> assert false
| IntT(_,_) -> Ivar(s)
| FloatT(_,_) -> Fvar(s)
in
var
| [< 'Genlex.Int i >] -> Ival(i)
| [< 'Genlex.Float f >] -> Fval(f)
| [< 'Genlex.Kwd "IfThenElseExpr"; f1 = parse_formula vars; e2 = parse_expr vars;
| [< 'Genlex.Int i; pl = parse_pragma_list >] -> Ival(i)
| [< 'Genlex.Float f; pl = parse_pragma_list >] -> Fval(f)
| [< 'Genlex.Kwd "IfThenElseExpr"; pl = parse_pragma_list ;
f1 = parse_formula vars;
e2 = parse_expr vars;
e3 = parse_expr vars >] -> Ite(f1, e2, e3)
| [< 'Genlex.Kwd "("; e = parse_expr vars; 'Genlex.Kwd ")" >] -> e
Supports Markdown
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