diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-11 16:41:43 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-11 16:41:43 +0200 |
commit | 36f98d819756ada119e696729e40d8e8e427b5f0 (patch) | |
tree | cacac900a6923e68911756c335f0dfaa61fcfba5 /main.ml | |
download | scade-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.ml | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 ... *) + + |