-
Notifications
You must be signed in to change notification settings - Fork 0
/
toplevel.ml
31 lines (27 loc) · 1.11 KB
/
toplevel.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module BS = BNstats
module SM = Ast.Symbol.SMap
module Co = Constants
module C = FixConstraint
module F = Format
open Misc.Ops
(*****************************************************************)
(********************* Command line options **********************)
(*****************************************************************)
let parse f =
let _ = Errorline.startFile f in
let ic = open_in f in
let rv = Lexing.from_channel ic |> FixParse.defs FixLex.token in
let _ = close_in ic in
rv
let read_inputs usage =
print_now "\n \n \n \n \n";
print_now "========================================================\n";
print_now "© Copyright 2009 Regents of the University of California.\n";
print_now "All Rights Reserved.\n";
print_now "========================================================\n";
print_now (Sys.argv |> Array.to_list |> String.concat " ");
print_now "\n========================================================\n";
let fs = ref [] in
let _ = Arg.parse Co.arg_spec (fun s -> fs := s::!fs) usage in
let fq = !fs |> BS.time "parse" (Misc.flap parse) |> FixConfig.create in
(!fs, fq)