summaryrefslogtreecommitdiff
path: root/main.ml
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ansys.com>2014-06-11 16:41:43 +0200
committerAlex Auvolat <alex.auvolat@ansys.com>2014-06-11 16:41:43 +0200
commit36f98d819756ada119e696729e40d8e8e427b5f0 (patch)
treecacac900a6923e68911756c335f0dfaa61fcfba5 /main.ml
downloadscade-analyzer-36f98d819756ada119e696729e40d8e8e427b5f0.tar.gz
scade-analyzer-36f98d819756ada119e696729e40d8e8e427b5f0.zip
Initial commit: parser for tiny subset of SCADE language...
Diffstat (limited to 'main.ml')
-rw-r--r--main.ml25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.ml b/main.ml
new file mode 100644
index 0000000..4f70229
--- /dev/null
+++ b/main.ml
@@ -0,0 +1,25 @@
+open Ast
+
+(* command line options *)
+let dump = ref false
+let ifile = ref ""
+
+let usage = "usage: analyzer [options] file.scade"
+
+let options = [
+ "--dump", Arg.Set dump, "Dump program source.";
+]
+
+let () =
+ Arg.parse options (fun f -> ifile := f) usage;
+
+ if !ifile = "" then begin
+ Format.eprintf "No input file...@.";
+ exit 1
+ end;
+
+ let prog = File_parser.parse_file !ifile in
+ if !dump then Ast_printer.print_prog Format.std_formatter prog;
+ () (* nothing to do yet ... *)
+
+