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

-kcg: OK for abstract types and functions and extern nodes

parent 5424466d
No related branches found
No related tags found
No related merge requests found
...@@ -615,7 +615,16 @@ and (string_of_node_def : Lic.node_def -> string list) = ...@@ -615,7 +615,16 @@ and (string_of_node_def : Lic.node_def -> string list) =
(* exported *) (* exported *)
and (type_decl: Lv6Id.long -> Lic.type_ -> string) = and (type_decl: Lv6Id.long -> Lic.type_ -> string) =
fun tname teff -> fun tname teff -> if global_opt.kcg then
match teff with
| Enum_type_eff (_) ->
"type " ^ (dump_long tname) ^ " = " ^ (string_def_of_type_eff teff) ^ ";\n"
| External_type_eff (_)
| Abstract_type_eff(_,External_type_eff (_)) -> "type imported " ^ (dump_long tname) ^ ";\n"
| _ -> "type " ^ (dump_long tname) ^ " = " ^ (string_def_of_type_eff teff) ^ ";\n"
else
"type " ^ (dump_long tname) ^ "type " ^ (dump_long tname) ^
(match teff with (match teff with
| Enum_type_eff (_) -> | Enum_type_eff (_) ->
...@@ -655,8 +664,8 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string = ...@@ -655,8 +664,8 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string =
( (
if neff.is_safe_eff then "" else "unsafe " if neff.is_safe_eff then "" else "unsafe "
)^( )^(
if neff.def_eff = ExternLic && not (global_opt.lv4) if neff.def_eff = ExternLic && not (global_opt.lv4) && not (global_opt.kcg)
(* no extern kwd in v4... *) (* no extern kwd in v4 and in "scade"... *)
then "extern " else "" then "extern " else ""
)^( )^(
if global_opt.lv4 || global_opt.kcg then ( if global_opt.lv4 || global_opt.kcg then (
...@@ -665,6 +674,11 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string = ...@@ -665,6 +674,11 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string =
) else ( ) else (
if neff.has_mem_eff then "node " else "function " if neff.has_mem_eff then "node " else "function "
) )
)^(if global_opt.kcg then
if neff.def_eff = ExternLic
then "imported " else ""
else ""
)^( )^(
if global_opt.kcg then if global_opt.kcg then
string_of_node_key_rec (not global_opt.no_prefix) neff.node_key_eff string_of_node_key_rec (not global_opt.no_prefix) neff.node_key_eff
...@@ -683,7 +697,7 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string = ...@@ -683,7 +697,7 @@ and node_of_node_exp_eff (neff: Lic.node_exp): string =
(string_of_node_key_def neff.node_key_eff)^ (string_of_node_key_def neff.node_key_eff)^
(";\n") (";\n")
) )
| AbstractLic _ -> ";\n" | AbstractLic _ -> "; \n"
| BodyLic _ -> ( | BodyLic _ -> (
(if global_opt.kcg then "\n" else ";\n") ^ (if global_opt.kcg then "\n" else ";\n") ^
(match neff.loclist_eff with (match neff.loclist_eff with
......
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