48418
|
1 |
(* Title: Pure/System/build.ML
|
|
2 |
Author: Makarius
|
|
3 |
|
|
4 |
Build Isabelle sessions.
|
|
5 |
*)
|
|
6 |
|
|
7 |
signature BUILD =
|
|
8 |
sig
|
|
9 |
val build: string -> unit
|
|
10 |
end;
|
|
11 |
|
|
12 |
structure Build: BUILD =
|
|
13 |
struct
|
|
14 |
|
|
15 |
fun build args_file =
|
|
16 |
let
|
48419
|
17 |
val (save, (parent, (name, theories))) =
|
48418
|
18 |
File.read (Path.explode args_file) |> YXML.parse_body |>
|
|
19 |
let open XML.Decode in pair bool (pair string (pair string (list string))) end;
|
|
20 |
|
|
21 |
val _ = Session.init false parent name; (* FIXME reset!? *)
|
|
22 |
val _ = Thy_Info.use_thys theories;
|
|
23 |
val _ = Session.finish ();
|
|
24 |
|
48419
|
25 |
val _ = if save then () else quit ();
|
48418
|
26 |
in () end
|
|
27 |
handle exn => (Output.error_msg (ML_Compiler.exn_message exn); exit 1);
|
|
28 |
|
|
29 |
end;
|