Skip to content
Snippets Groups Projects
Commit 9603460e authored by THIRIOUX Xavier's avatar THIRIOUX Xavier
Browse files

- corrected bug with destination directory (-d option)

 - corrected several bugs in inlining
 - STILL, BUGS REMAINING in inlined code !!??!!


git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@328 041b043f-8d7c-46b2-b46e-ef0dd855326e
parent ef34b4ae
No related branches found
No related tags found
No related merge requests found
# OASIS_START
# DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb)
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)
SETUP = ocaml setup.ml
......@@ -12,7 +12,7 @@ doc: setup.data build
test: setup.data build
$(SETUP) -test $(TESTFLAGS)
all:
all:
$(SETUP) -all $(ALLFLAGS)
install: setup.data
......@@ -24,15 +24,18 @@ uninstall: setup.data
reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)
clean:
clean:
$(SETUP) -clean $(CLEANFLAGS)
distclean:
distclean:
$(SETUP) -distclean $(DISTCLEANFLAGS)
setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)
configure:
$(SETUP) -configure $(CONFIGUREFLAGS)
.PHONY: build doc test all install uninstall reinstall clean distclean configure
# OASIS_STOP
#!/bin/sh
# OASIS_START
# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7)
# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499)
set -e
FST=true
for i in "$@"; do
for i in "$@"; do
if $FST; then
set --
FST=false
......
(* OASIS_START *)
(* DO NOT EDIT (digest: 00359f2e15a7ed8f31f1d7ce086345f9) *)
(* DO NOT EDIT (digest: 5a9a2168dcb86db37476d58b8c0e25b3) *)
module OASISGettext = struct
(* # 21 "/build/buildd/oasis-0.3.0/src/oasis/OASISGettext.ml" *)
(* # 22 "src/oasis/OASISGettext.ml" *)
let ns_ str =
str
let s_ str =
str
let f_ (str : ('a, 'b, 'c, 'd) format4) =
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
fmt2^^""
let init =
[]
end
module OASISExpr = struct
(* # 21 "/build/buildd/oasis-0.3.0/src/oasis/OASISExpr.ml" *)
(* # 22 "src/oasis/OASISExpr.ml" *)
open OASISGettext
type test = string
type flag = string
type test = string
type flag = string
type t =
| EBool of bool
......@@ -41,9 +52,11 @@ module OASISExpr = struct
| EOr of t * t
| EFlag of flag
| ETest of test * string
type 'a choices = (t * 'a) list
type 'a choices = (t * 'a) list
let eval var_get t =
let rec eval' =
......@@ -75,6 +88,7 @@ module OASISExpr = struct
in
eval' t
let choose ?printer ?name var_get lst =
let rec choose_aux =
function
......@@ -111,22 +125,27 @@ module OASISExpr = struct
in
choose_aux (List.rev lst)
end
# 117 "myocamlbuild.ml"
# 132 "myocamlbuild.ml"
module BaseEnvLight = struct
(* # 21 "/build/buildd/oasis-0.3.0/src/base/BaseEnvLight.ml" *)
(* # 22 "src/base/BaseEnvLight.ml" *)
module MapString = Map.Make(String)
type t = string MapString.t
let default_filename =
Filename.concat
(Sys.getcwd ())
"setup.data"
let load ?(allow_empty=false) ?(filename=default_filename) () =
if Sys.file_exists filename then
begin
......@@ -184,26 +203,29 @@ module BaseEnvLight = struct
filename)
end
let var_get name env =
let rec var_expand str =
let buff =
Buffer.create ((String.length str) * 2)
in
Buffer.add_substitute
buff
(fun var ->
try
var_expand (MapString.find var env)
with Not_found ->
failwith
(Printf.sprintf
"No variable %s defined when trying to expand %S."
var
str))
str;
Buffer.contents buff
let rec var_expand str env =
let buff =
Buffer.create ((String.length str) * 2)
in
var_expand (MapString.find name env)
Buffer.add_substitute
buff
(fun var ->
try
var_expand (MapString.find var env) env
with Not_found ->
failwith
(Printf.sprintf
"No variable %s defined when trying to expand %S."
var
str))
str;
Buffer.contents buff
let var_get name env =
var_expand (MapString.find name env) env
let var_choose lst env =
OASISExpr.choose
......@@ -212,87 +234,153 @@ module BaseEnvLight = struct
end
# 215 "myocamlbuild.ml"
# 237 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
(* # 21 "/build/buildd/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
(** OCamlbuild extension, copied from
(** OCamlbuild extension, copied from
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
* by N. Pouillard and others
*
* Updated on 2009/02/28
*
* Modified by Sylvain Le Gall
* Modified by Sylvain Le Gall
*)
open Ocamlbuild_plugin
(* these functions are not really officially exported *)
let run_and_read =
let run_and_read =
Ocamlbuild_pack.My_unix.run_and_read
let blank_sep_strings =
let blank_sep_strings =
Ocamlbuild_pack.Lexers.blank_sep_strings
let split s ch =
let x =
ref []
let exec_from_conf exec =
let exec =
let env_filename = Pathname.basename BaseEnvLight.default_filename in
let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in
try
BaseEnvLight.var_get exec env
with Not_found ->
Printf.eprintf "W: Cannot get variable %s\n" exec;
exec
in
let fix_win32 str =
if Sys.os_type = "Win32" then begin
let buff = Buffer.create (String.length str) in
(* Adapt for windowsi, ocamlbuild + win32 has a hard time to handle '\\'.
*)
String.iter
(fun c -> Buffer.add_char buff (if c = '\\' then '/' else c))
str;
Buffer.contents buff
end else begin
str
end
in
let rec go s =
let pos =
String.index s ch
in
x := (String.before s pos)::!x;
go (String.after s (pos + 1))
fix_win32 exec
let split s ch =
let buf = Buffer.create 13 in
let x = ref [] in
let flush () =
x := (Buffer.contents buf) :: !x;
Buffer.clear buf
in
try
go s
with Not_found -> !x
String.iter
(fun c ->
if c = ch then
flush ()
else
Buffer.add_char buf c)
s;
flush ();
List.rev !x
let split_nl s = split s '\n'
let before_space s =
try
String.before s (String.index s ' ')
with Not_found -> s
(* this lists all supported packages *)
(* ocamlfind command *)
let ocamlfind x = S[Sh (exec_from_conf "ocamlfind"); x]
(* This lists all supported packages. *)
let find_packages () =
List.map before_space (split_nl & run_and_read "ocamlfind list")
(* this is supposed to list available syntaxes, but I don't know how to do it. *)
(* Mock to list available syntaxes. *)
let find_syntaxes () = ["camlp4o"; "camlp4r"]
(* ocamlfind command *)
let ocamlfind x = S[A"ocamlfind"; x]
let well_known_syntax = [
"camlp4.quotations.o";
"camlp4.quotations.r";
"camlp4.exceptiontracer";
"camlp4.extend";
"camlp4.foldgenerator";
"camlp4.listcomprehension";
"camlp4.locationstripper";
"camlp4.macro";
"camlp4.mapgenerator";
"camlp4.metagenerator";
"camlp4.profiler";
"camlp4.tracer"
]
let dispatch =
function
| Before_options ->
(* by using Before_options one let command line options have an higher priority *)
(* on the contrary using After_options will guarantee to have the higher priority *)
(* override default commands by ocamlfind ones *)
| After_options ->
(* By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher priority override default commands by ocamlfind ones *)
Options.ocamlc := ocamlfind & A"ocamlc";
Options.ocamlopt := ocamlfind & A"ocamlopt";
Options.ocamldep := ocamlfind & A"ocamldep";
Options.ocamldoc := ocamlfind & A"ocamldoc";
Options.ocamlmktop := ocamlfind & A"ocamlmktop"
Options.ocamlmktop := ocamlfind & A"ocamlmktop";
Options.ocamlmklib := ocamlfind & A"ocamlmklib"
| After_rules ->
(* When one link an OCaml library/binary/package, one should use -linkpkg *)
(* When one link an OCaml library/binary/package, one should use
* -linkpkg *)
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
(* For each ocamlfind package one inject the -package option when
* compiling, computing dependencies, generating documentation and
* linking. *)
List.iter
List.iter
begin fun pkg ->
flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg];
end
let base_args = [A"-package"; A pkg] in
(* TODO: consider how to really choose camlp4o or camlp4r. *)
let syn_args = [A"-syntax"; A "camlp4o"] in
let args =
(* Heuristic to identify syntax extensions: whether they end in
".syntax"; some might not.
*)
if Filename.check_suffix pkg "syntax" ||
List.mem pkg well_known_syntax then
syn_args @ base_args
else
base_args
in
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
end
(find_packages ());
(* Like -package but for extensions syntax. Morover -syntax is useless
......@@ -301,29 +389,34 @@ module MyOCamlbuildFindlib = struct
flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax];
flag ["ocaml"; "infer_interface"; "syntax_"^syntax] &
S[A"-syntax"; A syntax];
end (find_syntaxes ());
(* The default "thread" tag is not compatible with ocamlfind.
* Indeed, the default rules add the "threads.cma" or "threads.cmxa"
* options when using this tag. When using the "-linkpkg" option with
* ocamlfind, this module will then be added twice on the command line.
*
*
* To solve this, one approach is to add the "-thread" option when using
* the "threads" package using the previous plugin.
*)
flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]);
flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]);
flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]);
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"])
flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]);
flag ["ocaml"; "package(threads)"; "compile"] (S[A "-thread"]);
flag ["ocaml"; "package(threads)"; "doc"] (S[A "-I"; A "+threads"]);
flag ["ocaml"; "package(threads)"; "link"] (S[A "-thread"]);
flag ["ocaml"; "package(threads)"; "infer_interface"] (S[A "-thread"]);
| _ ->
| _ ->
()
end
module MyOCamlbuildBase = struct
(* # 21 "/build/buildd/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
(** Base functions for writing myocamlbuild.ml
@author Sylvain Le Gall
......@@ -331,51 +424,61 @@ module MyOCamlbuildBase = struct
open Ocamlbuild_plugin
module OC = Ocamlbuild_pack.Ocaml_compiler
type dir = string
type file = string
type name = string
type tag = string
(* # 56 "/build/buildd/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
type dir = string
type file = string
type name = string
type tag = string
(* # 62 "src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)
type t =
{
lib_ocaml: (name * dir list) list;
lib_c: (name * dir * file list) list;
lib_ocaml: (name * dir list * string list) list;
lib_c: (name * dir * file list) list;
flags: (tag list * (spec OASISExpr.choices)) list;
(* Replace the 'dir: include' from _tags by a precise interdepends in
* directory.
*)
includes: (dir * dir list) list;
}
includes: (dir * dir list) list;
}
let env_filename =
Pathname.basename
Pathname.basename
BaseEnvLight.default_filename
let dispatch_combine lst =
fun e ->
List.iter
List.iter
(fun dispatch -> dispatch e)
lst
lst
let tag_libstubs nm =
"use_lib"^nm^"_stubs"
let nm_libstubs nm =
nm^"_stubs"
let dispatch t e =
let env =
BaseEnvLight.load
~filename:env_filename
let dispatch t e =
let env =
BaseEnvLight.load
~filename:env_filename
~allow_empty:true
()
in
match e with
match e with
| Before_options ->
let no_trailing_dot s =
if String.length s >= 1 && s.[0] = '.' then
......@@ -385,35 +488,44 @@ module MyOCamlbuildBase = struct
in
List.iter
(fun (opt, var) ->
try
try
opt := no_trailing_dot (BaseEnvLight.var_get var env)
with Not_found ->
Printf.eprintf "W: Cannot get variable %s" var)
Printf.eprintf "W: Cannot get variable %s\n" var)
[
Options.ext_obj, "ext_obj";
Options.ext_lib, "ext_lib";
Options.ext_dll, "ext_dll";
]
| After_rules ->
| After_rules ->
(* Declare OCaml libraries *)
List.iter
List.iter
(function
| nm, [] ->
ocaml_lib nm
| nm, dir :: tl ->
| nm, [], intf_modules ->
ocaml_lib nm;
let cmis =
List.map (fun m -> (String.uncapitalize m) ^ ".cmi")
intf_modules in
dep ["ocaml"; "link"; "library"; "file:"^nm^".cma"] cmis
| nm, dir :: tl, intf_modules ->
ocaml_lib ~dir:dir (dir^"/"^nm);
List.iter
(fun dir ->
List.iter
(fun dir ->
List.iter
(fun str ->
flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir]))
["compile"; "infer_interface"; "doc"])
tl)
tl;
let cmis =
List.map (fun m -> dir^"/"^(String.uncapitalize m)^".cmi")
intf_modules in
dep ["ocaml"; "link"; "library"; "file:"^dir^"/"^nm^".cma"]
cmis)
t.lib_ocaml;
(* Declare directories dependencies, replace "include" in _tags. *)
List.iter
List.iter
(fun (dir, include_dirs) ->
Pathname.define_context dir include_dirs)
t.includes;
......@@ -428,7 +540,7 @@ module MyOCamlbuildBase = struct
flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib]
(S[A"-cclib"; A("-l"^(nm_libstubs lib))]);
flag ["link"; "program"; "ocaml"; "byte"; tag_libstubs lib]
(S[A"-dllib"; A("dll"^(nm_libstubs lib))]);
......@@ -443,11 +555,11 @@ module MyOCamlbuildBase = struct
(* TODO: be more specific about what depends on headers *)
(* Depends on .h files *)
dep ["compile"; "c"]
dep ["compile"; "c"]
headers;
(* Setup search path for lib *)
flag ["link"; "ocaml"; "use_"^lib]
flag ["link"; "ocaml"; "use_"^lib]
(S[A"-I"; P(dir)]);
)
t.lib_c;
......@@ -455,32 +567,38 @@ module MyOCamlbuildBase = struct
(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
let spec =
BaseEnvLight.var_choose cond_specs env
let spec = BaseEnvLight.var_choose cond_specs env in
let rec eval_specs =
function
| S lst -> S (List.map eval_specs lst)
| A str -> A (BaseEnvLight.var_expand str env)
| spec -> spec
in
flag tags & spec)
flag tags & (eval_specs spec))
t.flags
| _ ->
| _ ->
()
let dispatch_default t =
dispatch_combine
dispatch_combine
[
dispatch t;
MyOCamlbuildFindlib.dispatch;
]
end
# 476 "myocamlbuild.ml"
# 594 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []; }
{MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []}
;;
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
# 485 "myocamlbuild.ml"
# 603 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
This diff is collapsed.
......@@ -663,21 +663,27 @@ let rename_node f_node f_var f_const nd =
let rename_const f_const c =
{ c with const_id = f_const c.const_id }
let rename_typedef f_var t =
match t.tydef_desc with
| Tydec_enum tags -> { t with tydef_desc = Tydec_enum (List.map f_var tags) }
| _ -> t
let rename_prog f_node f_var f_const prog =
List.rev (
List.fold_left (fun accu top ->
(match top.top_decl_desc with
| Node nd ->
{ top with top_decl_desc = Node (rename_node f_node f_var f_const nd) }
{ top with top_decl_desc = Node (rename_node f_node f_var f_const nd) }
| Const c ->
{ top with top_decl_desc = Const (rename_const f_const c) }
{ top with top_decl_desc = Const (rename_const f_const c) }
| TypeDef tdef ->
{ top with top_decl_desc = TypeDef (rename_typedef f_var tdef) }
| ImportedNode _
| Open _
| TypeDef _ -> top)
| Open _ -> top)
::accu
) [] prog
)
)
(**********************************************************************)
(* Pretty printers *)
......
......@@ -40,10 +40,11 @@ TODO: deal with reset
let inline_call orig_expr args reset locals node =
let loc = orig_expr.expr_loc in
let uid = orig_expr.expr_tag in
let rename v =
Format.fprintf Format.str_formatter "%s_%i_%s"
let rename v =
if v = tag_true || v = tag_false then v else
(Format.fprintf Format.str_formatter "%s_%i_%s"
node.node_id uid v;
Format.flush_str_formatter ()
Format.flush_str_formatter ())
in
let eqs' = List.map (rename_eq rename) node.node_eqs
in
......@@ -247,7 +248,7 @@ let witness filename main_name orig inlined type_env clock_env =
node_clock = Clocks.new_var true;
node_inputs = main_orig_node.node_inputs;
node_outputs = [ok_output];
node_locals = [];
node_locals = ok_i;
node_gencalls = [];
node_checks = [];
node_asserts = [];
......
......@@ -41,8 +41,7 @@ let extract_header own prog =
(* encode and write a header in a file *)
let write_lusic lusi (header : top_decl list) basename extension =
let basename' = !Options.dest_dir ^ "/" ^ basename in
let target_name = basename' ^ extension in
let target_name = basename ^ extension in
let outchan = open_out_bin target_name in
begin
Marshal.to_channel outchan {from_lusi = lusi; contents = header} [];
......@@ -51,8 +50,7 @@ let write_lusic lusi (header : top_decl list) basename extension =
(* read and decode a header from a file *)
let read_lusic basename extension =
let basename' = !Options.dest_dir ^ "/" ^ basename in
let source_name = basename' ^ extension in
let source_name = basename ^ extension in
let inchan = open_in_bin source_name in
let lusic = (Marshal.from_channel inchan : lusic) in
begin
......@@ -61,15 +59,14 @@ let read_lusic basename extension =
end
let print_lusic_to_h basename extension =
let basename' = !Options.dest_dir ^ "/" ^ basename in
let lusic = read_lusic basename extension in
let header_name = basename' ^ ".h" in
let header_name = basename ^ ".h" in
let h_out = open_out header_name in
let h_fmt = formatter_of_out_channel h_out in
begin
Typing.uneval_prog_generics lusic.contents;
Clock_calculus.uneval_prog_generics lusic.contents;
Header.print_header_from_header h_fmt basename lusic.contents;
Header.print_header_from_header h_fmt (Filename.basename basename) lusic.contents;
close_out h_out
end
......
......@@ -32,40 +32,41 @@ let print_lusi prog basename extension =
(* compile a .lusi header file *)
let compile_header basename extension =
let header_name = basename ^ extension in
let lusic_ext = extension ^ "c" in
begin
Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v>");
let header = parse_header true header_name in
ignore (check_top_decls header);
create_dest_dir ();
Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %sc@," header_name);
Lusic.write_lusic true header basename lusic_ext;
Lusic.print_lusic_to_h basename lusic_ext;
Log.report ~level:1 (fun fmt -> fprintf fmt ".. done !@ @]@.")
end
let destname = !Options.dest_dir ^ "/" ^ basename in
let header_name = basename ^ extension in
let lusic_ext = extension ^ "c" in
begin
Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v>");
let header = parse_header true header_name in
ignore (check_top_decls header);
create_dest_dir ();
Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %sc@," header_name);
Lusic.write_lusic true header destname lusic_ext;
Lusic.print_lusic_to_h destname lusic_ext;
Log.report ~level:1 (fun fmt -> fprintf fmt ".. done !@ @]@.")
end
(* check whether a source file has a compiled header,
if not, generate the compiled header *)
let compile_source_to_header prog computed_types_env computed_clocks_env basename extension =
let basename' = !Options.dest_dir ^ "/" ^ basename in
let destname = !Options.dest_dir ^ "/" ^ basename in
let lusic_ext = extension ^ "c" in
let header_name = basename' ^ lusic_ext in
let header_name = destname ^ lusic_ext in
begin
if not (Sys.file_exists header_name) then
begin
Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %s@," header_name);
Lusic.write_lusic false (Lusic.extract_header basename prog) basename lusic_ext;
Lusic.print_lusic_to_h basename lusic_ext
Lusic.write_lusic false (Lusic.extract_header basename prog) destname lusic_ext;
Lusic.print_lusic_to_h destname lusic_ext
end
else
let lusic = Lusic.read_lusic basename lusic_ext in
let lusic = Lusic.read_lusic destname lusic_ext in
if not lusic.Lusic.from_lusi then
begin
Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %s@," header_name);
Lusic.write_lusic false (Lusic.extract_header basename prog) basename lusic_ext;
Lusic.write_lusic false (Lusic.extract_header basename prog) destname lusic_ext;
(*List.iter (fun top_decl -> Format.eprintf "lusic: %a@." Printers.pp_decl top_decl) lusic.Lusic.contents;*)
Lusic.print_lusic_to_h basename lusic_ext
Lusic.print_lusic_to_h destname lusic_ext
end
else
begin
......@@ -290,7 +291,7 @@ let compile basename extension =
let anonymous filename =
let ok_ext, ext = List.fold_left (fun (ok, ext) ext' -> if not ok && Filename.check_suffix filename ext' then true, ext' else ok, ext) (false, "") extensions in
if ok_ext then
let basename = Filename.chop_suffix filename ext in
let basename = Filename.chop_suffix (Filename.basename filename) ext in
compile basename ext
else
raise (Arg.Bad ("Can only compile *.lusi, *.lus or *.ec files"))
......
This diff is collapsed.
......@@ -33,7 +33,7 @@ let horn_queries = ref false
let options =
[ "-d", Arg.Set_string dest_dir,
"produces code in the specified directory (default: .)";
"uses the specified directory as root for generated/imported object and C files (default: .)";
"-node", Arg.Set_string main_node, "specifies the main node";
"-init", Arg.Set delay_calculus, "performs an initialisation analysis for Lustre nodes <default: no analysis>";
"-dynamic", Arg.Clear static_mem, "specifies a dynamic allocation scheme for main Lustre node <default: static>";
......
This diff is collapsed.
This diff is collapsed.
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