Skip to content
Snippets Groups Projects
Commit e544d7e5 authored by Mamadou Ndiaye's avatar Mamadou Ndiaye
Browse files

-kcg: forces the -esa(expand_arrays) option so that arrays walk with diese.We...

-kcg: forces the -esa(expand_arrays) option so that arrays walk with diese.We will see later how to treat properly the arrays.
parent a4fc5376
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,12 @@ let rec is_a_tuple (e:Lic.val_exp) : bool = ...@@ -47,9 +47,12 @@ let rec is_a_tuple (e:Lic.val_exp) : bool =
(******************************************************************************) (******************************************************************************)
let string_of_ident x = let string_of_ident x =
if global_opt.no_prefix if global_opt.kcg then
Lv6Id.no_pack_string_of_long x
else
if global_opt.no_prefix
then Lv6Id.no_pack_string_of_long x then Lv6Id.no_pack_string_of_long x
else Lv6Id.string_of_long2 x else Lv6Id.string_of_long2 x
...@@ -359,7 +362,7 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st ...@@ -359,7 +362,7 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st
let tuple_square vel = let tuple_square vel =
"[" ^ (String.concat ", " (List.map string_of_val_exp_eff vel)) ^ "]" "[" ^ (String.concat ", " (List.map string_of_val_exp_eff vel)) ^ "]"
in in
let str = let str =
match posop.it,vel with match posop.it,vel with
| CONST c,_ -> string_of_const_eff c | CONST c,_ -> string_of_const_eff c
| CALL ({it=("Lustre","not"),[]}), [ve1] | CALL ({it=("Lustre","not"),[]}), [ve1]
...@@ -369,10 +372,13 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st ...@@ -369,10 +372,13 @@ and (string_of_by_pos_op_eff: Lic.by_pos_op srcflagged -> Lic.val_exp list -> st
| CALL ({it=("Lustre","diese"),[]}), [ve1] | CALL ({it=("Lustre","diese"),[]}), [ve1]
| PREDEF_CALL ({it=("Lustre","diese"),[]}), [ve1] -> | PREDEF_CALL ({it=("Lustre","diese"),[]}), [ve1] ->
if global_opt.lv4 && array_of_size_one ve1 if (global_opt.lv4) && array_of_size_one ve1
then sov ve1 (* lv4 does no accept to apply # on One var only! *) then sov ve1 (* lv4 does no accept to apply # on One var only! *)
else (*else if global_opt.kcg then
(("#") ^ (tuple_par [ve1])) ("#" ^ (dump_array_no_square ve1)) *)
(* do later *)
else
("#" ^ (tuple_par [ve1]))
| CALL ({it=("Lustre","nor"),[]}), [ve1] | CALL ({it=("Lustre","nor"),[]}), [ve1]
| PREDEF_CALL ({it=("Lustre","nor"),[]}), [ve1] -> | PREDEF_CALL ({it=("Lustre","nor"),[]}), [ve1] ->
......
...@@ -337,7 +337,10 @@ let mkoptab (opt:t) : unit = ( ...@@ -337,7 +337,10 @@ let mkoptab (opt:t) : unit = (
; ;
mkopt opt ~doc_level:Dev mkopt opt ~doc_level:Dev
["-kcg"; "--generate-scade-lustre"] ["-kcg"; "--generate-scade-lustre"]
(Arg.Unit (fun _ -> global_opt.kcg <- true)) (Arg.Unit (fun _ ->
opt.expand_arrays <- true; (* XXX remove me ! *)
global_opt.kcg <- true
))
[" Generate lustre code that is compatible with the lustre of scade"] [" Generate lustre code that is compatible with the lustre of scade"]
; ;
mkopt opt mkopt opt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment