Skip to content

Commit

Permalink
Add structure for command line interface and sh file
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaschett committed Jun 19, 2019
1 parent bd26707 commit 1eba358
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
24 changes: 23 additions & 1 deletion main.ml
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
let () = print_endline "Hello sorg"
open Core
open Ebso

let () =
let open Command.Let_syntax in
Command.basic ~summary:"sorg: A SuperOptimization based Rule Generator"
[%map_open
let i_s = flag "s" (required string)
~doc:"program to optimize"
and
i_t = flag "t" (required string)
~doc:"optimized program"
and
_ = flag "out" (optional string)
~doc:"filename write output to csv file"
in
fun () ->
let lex = Sedlexing.Latin1.from_string in
let (b_s, b_t) = (lex i_s, lex i_t) in
let (s, t) = (Parser.parse b_s, Parser.parse b_t) in
Out_channel.printf "%s" (([%show: Program.t] s) ^ "optimizes to \n" ^ ([%show: Program.t] t))
]
|> Command.run ~version:"1.0"
5 changes: 5 additions & 0 deletions sorg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
Z3DIR=$(ocamlfind query z3)

SORGDIR=$(dirname "$(realpath "$0")")
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$Z3DIR "$SORGDIR"/_build/default/main.exe "$@"

0 comments on commit 1eba358

Please sign in to comment.