Skip to content
Snippets Groups Projects
Commit eb744c68 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

When no node is specified in the -ec mode, compiles the first node

with a non-empty body (instead of just the first node).
parent 1765d8a8
No related branches found
No related tags found
No related merge requests found
...@@ -413,7 +413,7 @@ and (type_check_do: t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool -> ...@@ -413,7 +413,7 @@ and (type_check_do: t -> Ident.long -> Lxm.t -> SymbolTab.t -> bool ->
let is_struct = match type_def.it with StructType _ -> true | _ -> false in let is_struct = match type_def.it with StructType _ -> true | _ -> false in
if if
(not provide_flag) (not provide_flag)
& (not (!Global.expand_structs & is_struct)) && (not (!Global.expand_structs & is_struct))
&& not !Global.ec (* ec does not need type decl *) && not !Global.ec (* ec does not need type decl *)
then then
output_string !Global.oc (LicDump.type_decl type_name type_eff); output_string !Global.oc (LicDump.type_decl type_name type_eff);
...@@ -819,9 +819,13 @@ and (node_check_do: t -> Eff.node_key -> Lxm.t -> SymbolTab.t -> ...@@ -819,9 +819,13 @@ and (node_check_do: t -> Eff.node_key -> Lxm.t -> SymbolTab.t ->
in in
let is_main_node = let is_main_node =
if !Global.main_node = "" then ( if !Global.main_node = "" then (
(* if no main node is provided, we take the first we find *) (* if no main node is provided, we take the first node we find,
Global.main_node := Ident.string_of_long (fst nk); that has a non-empty body. *)
true match res.def_eff with
| ExternEff | AbstractEff -> false
| BodyEff _ ->
Global.main_node := Ident.string_of_long (fst nk);
true
) )
else else
(nk = (Ident.long_of_string !Global.main_node, [])) (nk = (Ident.long_of_string !Global.main_node, []))
......
(** Time-stamp: <modified the 05/02/2009 (at 16:42) by Erwan Jahier> *) (** Time-stamp: <modified the 05/02/2009 (at 16:45) by Erwan Jahier> *)
open Printf open Printf
open Lxm open Lxm
...@@ -503,7 +503,7 @@ and (node_of_node_exp_eff: Eff.node_exp -> string) = ...@@ -503,7 +503,7 @@ and (node_of_node_exp_eff: Eff.node_exp -> string) =
then "extern " then "extern "
else "") ^ else "") ^
(if !Global.lv4 then (if !Global.lv4 then
(* nodeand function does not have the same meaning in v4... *) (* node and function does not have the same meaning in v4... *)
(if neff.def_eff = ExternEff then "function " else "node ") (if neff.def_eff = ExternEff then "function " else "node ")
else else
(if neff.has_mem_eff then "node " else "function ") (if neff.has_mem_eff then "node " else "function ")
......
...@@ -205,7 +205,8 @@ let (get_source_list : string list -> SyntaxTree.pack_or_model list) = ...@@ -205,7 +205,8 @@ let (get_source_list : string list -> SyntaxTree.pack_or_model list) =
| PRPackBody(incl_files, pbdy) -> | PRPackBody(incl_files, pbdy) ->
let nme = let nme =
try Filename.chop_extension (Filename.basename infile) try Filename.chop_extension (Filename.basename infile)
with _ -> print_string ("*** '"^infile^"': bad file name.\n"); exit 1 with _ ->
print_string ("*** '"^infile^"': bad file name.\n"); exit 1
in in
let pi = let pi =
SyntaxTree.give_pack_this_name (Ident.pack_name_of_string nme) pbdy SyntaxTree.give_pack_this_name (Ident.pack_name_of_string nme) pbdy
......
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