diff options
author | Chimrod <> | 2023-09-22 14:12:14 +0200 |
---|---|---|
committer | Chimrod <> | 2023-09-22 14:12:14 +0200 |
commit | bd9d82035b21c8b0695c18208827c184785398af (patch) | |
tree | 5c6b03d6a82155b867e5ec2ceecd260b8868579a /bin |
first commit
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dune | 6 | ||||
-rw-r--r-- | bin/main.ml | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..36f9b41 --- /dev/null +++ b/bin/dune @@ -0,0 +1,6 @@ +(executable + (public_name qsp_parser) + (name main) + (libraries + qsp_syntax + qsp_parser)) diff --git a/bin/main.ml b/bin/main.ml new file mode 100644 index 0000000..1e8ff45 --- /dev/null +++ b/bin/main.ml @@ -0,0 +1,11 @@ +let () = + let file_name = Sys.argv.(1) in + let ic = Stdlib.open_in file_name in + let lexer = Lexing.from_channel ~with_positions:true ic in + let result = Qsp_parser.Analyzer.parse (module Qsp_syntax.Tree) lexer in + match result with + | Ok _ -> exit 0 + | Error e -> + Format.fprintf Format.std_formatter "\nError in location %s\n%a" file_name + Qsp_parser.Analyzer.format_error e; + exit 1 |