Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
verimag
synchrone
lutin
Commits
39ba0d1b
Commit
39ba0d1b
authored
Apr 14, 2011
by
Erwan Jahier
Browse files
Fix pbs in the Alices<->Lurette interface.
parent
3e2e5006
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/Lucky/luc2c.ml
View file @
39ba0d1b
...
...
@@ -18,6 +18,7 @@ open LucProg
type
gen_mode
=
Lustre
|
Scade
|
Alices
|
Luciole
|
Nop
type
step_mode
=
Inside
|
Edges
|
Vertices
let
step_mode_to_str
=
function
Inside
->
"step_inside"
|
Edges
->
"step_edges"
...
...
@@ -520,7 +521,7 @@ launch the lutin interpreter and init socket stuff
dbg_printf(
\"
Binding %s:%d...
\\
n
\"
,sock_addr,portno);
sprintf(portno_str,
\"
%d
\"
, portno);
printf(
msg,
\"
Waiting for lurette to connect on %s:%s
\\
n
\"
, sock_addr, portno_str);
printf(
\"
Waiting for lurette to connect on %s:%s
\\
n
\"
, sock_addr, portno_str);
//raise_info(msg);
dbg_printf(
\"
Waiting for lurette to connect
\\
n
\"
);
...
...
@@ -542,7 +543,6 @@ Step procedure
void "
^
fn
^
"_step("
^
fn
^
"_ctx* ctx){
int rc;
int i;
"
^
let
cpt
=
ref
0
in
let
decl_char
acc
var
=
...
...
@@ -581,15 +581,30 @@ let all_vars = in_vars @ out_vars in
List
.
fold_left
(
fun
acc
var
->
acc
^
(
var_to_format_print
var
)
^
" "
)
""
all
_vars
)
^
"
\\
n
\"
, "
in
_vars
)
^
"
\\
n
\"
, "
^
(
List
.
fold_left
(
fun
acc
var
->
acc
^
", "
^
(
var_to_adress
var
))
(
var_to_adress
(
List
.
hd
all
_vars
))
((
List
.
tl
all
_vars
)))
(
var_to_adress
(
List
.
hd
in
_vars
))
((
List
.
tl
in
_vars
)))
^
");
dbg_printf(
\"\\
n
\\
n ---- Sending the 'cliché': '%s'
\\
n
\"
,ctx->buff);
dbg_printf(
\"\\
n
\\
n ---- Sending the 'cliché' (Alices output part): '%s'
\\
n
\"
,ctx->buff);
send(ctx->sock, ctx->buff, (int) strlen(ctx->buff),0);
sprintf(ctx->buff,
\"
"
^
(
List
.
fold_left
(
fun
acc
var
->
acc
^
(
var_to_format_print
var
)
^
" "
)
""
out_vars
)
^
"
\\
n
\"
, "
^
(
List
.
fold_left
(
fun
acc
var
->
acc
^
", "
^
(
var_to_adress
var
))
(
var_to_adress
(
List
.
hd
out_vars
))
((
List
.
tl
out_vars
)))
^
");
dbg_printf(
\"\\
n
\\
n ---- Sending the 'cliché' (Alices input part): '%s'
\\
n
\"
,ctx->buff);
send(ctx->sock, ctx->buff, (int) strlen(ctx->buff),0);
};
...
...
@@ -611,8 +626,6 @@ let all_vars = in_vars @ out_vars in
^
");
dbg_printf(
\"\\
n
\\
n ---- A new Step begins. Sending to sock: '%s'
\\
n
\"
,ctx->buff);
send(ctx->sock, ctx->buff, (int) strlen(ctx->buff),0);
"
)
^
(
if
option
.
boot
then
"} "
else
""
)
^
"
...
...
@@ -624,8 +637,13 @@ let all_vars = in_vars @ out_vars in
printf(
\"
Error: cannot read on socket
\\
n
\"
);
raise_error(
\"
"
^
fn
^
": cannot read on socket
\"
);
};
dbg_printf(
\"
reading '%s'
\\
n
\"
,ctx->buff);
sscanf(ctx->buff,
\"
"
^
if (strcmp(ctx->buff,
\"
#quit
\"
) == 0) {
sprintf(ctx->buff,
\"
quitting...
\\
n
\"
);
send(ctx->sock, ctx->buff, (int) strlen(ctx->buff), 0);
raise_error(ctx->buff);
};
dbg_printf(
\"
reading '%s'
\\
n
\"
,ctx->buff);
sscanf(ctx->buff,
\"
"
^
let
cpt
=
ref
0
in
let
var_to_adress
var
=
if
(
Var
.
typ
var
=
Type
.
BoolT
)
then
(
...
...
@@ -640,7 +658,7 @@ let all_vars = in_vars @ out_vars in
out_vars
)
in
scan_format
^
"
\"
,
&i,
"
^
"
\"
,"
^
(
List
.
fold_left
(
fun
acc
var
->
acc
^
", "
^
(
var_to_adress
var
))
...
...
Write
Preview
Markdown
is supported
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