Commit 6487949d authored by Pascal Raymond's avatar Pascal Raymond
Browse files

Syntax "loop [n]" for exact loop's

parent 4342b156
......@@ -28,7 +28,7 @@ assert abs(T-T1) < 0.5 in
assert abs(T-T2) < 0.5 in
assert abs(T-T3) < 0.5 in
loop [1,1] -- R1: j'aimerais bien ecrire Loop 1 en fait...
loop [1] -- R1: j'aimerais bien ecrire Loop 1 en fait...
{
(6.0 < T) and (T < 9.0)
}
......
......@@ -126,10 +126,12 @@ printf "check_exp\n";
let tel = rec_list_call [e1] in
match_type_profile tel CkTypeEff.prof_t_t e.src
)
(*
| LOOPE_n (n, e1) -> (
let tel = rec_list_call [n;e1] in
match_type_profile tel CkTypeEff.prof_it_t e.src
)
*)
| LOOPI_n (min, max, e1) -> (
let tel = rec_list_call [min;max;e1] in
match_type_profile tel CkTypeEff.prof_iit_t e.src
......
......@@ -1422,6 +1422,7 @@ and
CoTraceExp.of_catch tgtstr r1 r2opt
)
(*
| LOOPE_n (en,ee) -> (
let nres = treat_exp env sstack en in
let eres = treat_trace env sstack ee in
......@@ -1431,6 +1432,7 @@ and
CoTraceExp.of_loope nres eres
)
)
*)
)
......
......@@ -571,21 +571,23 @@ lutDoPart :
lutLoopExp:
TK_LOOP lutTraceExp
{ make_val_exp (LOOP_n $2) $1 }
| TK_LOOP lutExact lutTraceExp
{ make_val_exp (LOOPE_n ($2, $3)) $1 }
/* | TK_LOOP lutExact lutTraceExp
{ make_val_exp (LOOPE_n ($2, $3)) $1 }
*/
| TK_LOOP lutAverage lutTraceExp
{ make_val_exp (LOOPI_n (fst $2, snd $2, $3)) $1 }
| TK_LOOP lutGaussian lutTraceExp
{ make_val_exp (LOOPA_n (fst $2, snd $2, $3)) $1 }
;
lutExact:
lutExp
{ ($1) }
;
/* lutExact:
lutExp { ($1) } ;
*/
lutAverage:
TK_OPEN_BRACKET lutExp TK_COMA lutExp TK_CLOSE_BRACKET
TK_OPEN_BRACKET lutExp TK_CLOSE_BRACKET
{ ($2, $2) }
| TK_OPEN_BRACKET lutExp TK_COMA lutExp TK_CLOSE_BRACKET
{ ($2, $4) }
;
......
......@@ -99,7 +99,7 @@ and val_exp_node =
| CHOICE_n of (val_exp * val_exp srcflaged option) list
| PRIO_n of val_exp list
| LOOP_n of val_exp
| LOOPE_n of val_exp * val_exp
(* | LOOPE_n of val_exp * val_exp *)
| LOOPI_n of val_exp * val_exp * val_exp
| LOOPA_n of val_exp * val_exp option * val_exp
| ASSERT_n of val_exp * val_exp
......
......@@ -267,11 +267,13 @@ let _ =
Format.fprintf !os "loop ";
dump_brace_exp e
)
(*
| LOOPE_n (nb,e) -> (
Format.fprintf !os "loop ";
dump_exp nb;
dump_brace_exp e
)
*)
| LOOPI_n (min,max,e) -> (
Format.fprintf !os "loop [";
dump_exp min;
......
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