-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add structure for command line interface and sh file
- Loading branch information
1 parent
bd26707
commit 1eba358
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |