Skip to content

Commit

Permalink
First draft of integrating the mli generator into the executable; cur…
Browse files Browse the repository at this point in the history
…renlty, we output the mli on stdout - we can do better ...
  • Loading branch information
samoht committed Oct 29, 2010
1 parent 2bffd6e commit 767352f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -5,7 +5,7 @@ export ANNOTATE
LLVM ?= /Users/avsm/llvm

define PROJ_abnf
SOURCES=abnf_syntaxtree.ml abnf_rules.ml abnf_ops.ml abnf_location.ml abnf_parser.mli abnf_lexer.ml abnf_parser.ml abnf_recursive_descent.ml abnf_cmd.ml
SOURCES=abnf_syntaxtree.ml abnf_rules.ml abnf_ops.ml abnf_location.ml abnf_parser.mli abnf_lexer.ml abnf_parser.ml abnf_recursive_descent.ml abnf_signature.ml abnf_cmd.ml
RESULT=abnf_cmd
LIBS=str
TRASH=abnf_lexer.ml abnf_parser.ml abnf_lexer.mli abnf_parser.mli
Expand Down
3 changes: 3 additions & 0 deletions abnf_cmd.ml
Expand Up @@ -12,6 +12,7 @@ type mode =
|Edges
|Terminals
|RDParse
|Sig

let _ =
let files = ref [] in
Expand All @@ -20,6 +21,7 @@ let _ =
let file_to_parse = ref "" in
let starting_nonterminal = ref "" in
let parse = [
"-sig", Arg.Unit (fun () -> mode := Sig), "Output the mli file";
"-dot", Arg.Unit (fun () -> mode := Dot), "Output in DOT format";
"-tsort", Arg.Unit (fun () -> mode := Tsort), "Output topological sort of parse nodes";
"-edges", Arg.Unit (fun () -> mode := Edges), "Output edges of parse graph for tsort(1)";
Expand Down Expand Up @@ -52,6 +54,7 @@ let _ =
let all_rules = Abnf_rules.generate_rules rules in
Abnf_rules.check all_rules;
begin match !mode with
|Sig -> Abnf_signature.dump all_rules;
|Dot ->
Abnf_ops.Graph.dump_nodes all_rules;
|Tsort ->
Expand Down

0 comments on commit 767352f

Please sign in to comment.