Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lutin
Commits
6487949d
Commit
6487949d
authored
Jan 13, 2011
by
Pascal Raymond
Browse files
Syntax "loop [n]" for exact loop's
parent
4342b156
Changes
6
Hide whitespace changes
Inline
Side-by-side
examples/lutin/luciole/env.lut
View file @
6487949d
...
...
@@ -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
)
}
...
...
source/Lutin/checkType.ml
View file @
6487949d
...
...
@@ -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
...
...
source/Lutin/expand.ml
View file @
6487949d
...
...
@@ -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
)
)
*)
)
...
...
source/Lutin/lutParser.mly
View file @
6487949d
...
...
@@ -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
)
}
;
...
...
source/Lutin/syntaxe.ml
View file @
6487949d
...
...
@@ -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
...
...
source/Lutin/syntaxeDump.ml
View file @
6487949d
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment