Working Menhir parser with --table
This commit is contained in:
parent
562c0ab602
commit
d0b222b003
|
@ -1,5 +1,6 @@
|
||||||
<global> or <utilities> or <minils> or <heptagon> or <main>:include
|
<global> or <utilities> or <minils> or <heptagon> or <main>:include
|
||||||
<**/*.ml>: debug, dtypes
|
<**/*.ml>: debug, dtypes
|
||||||
<preproc.ml>: camlp4of, use_camlp4
|
<preproc.ml>: camlp4of, use_camlp4
|
||||||
<**/*.{byte,native}>: use_unix, use_str, debug
|
<**/hept_parser.ml>: use_menhirLib
|
||||||
|
<**/*.{byte,native}>: use_unix, use_str, link_menhirLib, debug
|
||||||
true: use_menhir
|
true: use_menhir
|
||||||
|
|
|
@ -6,8 +6,18 @@ let df = function
|
||||||
(* Tell ocamlbuild about the camlp4 library. *)
|
(* Tell ocamlbuild about the camlp4 library. *)
|
||||||
ocaml_lib ~extern:true ~dir:"+camlp4" "camlp4";
|
ocaml_lib ~extern:true ~dir:"+camlp4" "camlp4";
|
||||||
|
|
||||||
|
(* Tell ocamlbuild about Menhir library (needed by --table). *)
|
||||||
|
ocaml_lib ~extern:true ~dir:"+menhirLib" "menhirLib";
|
||||||
|
|
||||||
|
(* Menhir does not come with menhirLib.cmxa so we have to manually by-pass
|
||||||
|
OCamlbuild's built-in logic and add the needed menhirLib.cmxa. *)
|
||||||
|
flag ["link"; "link_menhirLib"] (S [A "-I"; A "+menhirLib";
|
||||||
|
A "menhirLib.cmx"]);
|
||||||
|
|
||||||
|
|
||||||
(* Add preproc.cmo to the ocaml pre-processor when use_preproc is set *)
|
(* Add preproc.cmo to the ocaml pre-processor when use_preproc is set *)
|
||||||
flag ["ocaml"; "pp"; "use_preproc"] (A "preproc.cmo");
|
flag ["ocaml"; "pp"; "use_preproc"] (A "preproc.cmo");
|
||||||
|
|
||||||
(* Running ocamldep on ocaml code that is tagged with use_preproc will
|
(* Running ocamldep on ocaml code that is tagged with use_preproc will
|
||||||
require the cmo. Note that you only need this declaration when the
|
require the cmo. Note that you only need this declaration when the
|
||||||
syntax extension is part of the sources to be compiled with
|
syntax extension is part of the sources to be compiled with
|
||||||
|
@ -17,7 +27,8 @@ let df = function
|
||||||
(* LablGTK use for graphical simulator *)
|
(* LablGTK use for graphical simulator *)
|
||||||
ocaml_lib ~extern:true ~dir:"+lablgtk2" "lablgtk";
|
ocaml_lib ~extern:true ~dir:"+lablgtk2" "lablgtk";
|
||||||
|
|
||||||
flag ["ocaml"; "parser" ; "menhir" ; "use_menhir"] (S[A"--explain"]);
|
flag ["ocaml"; "parser" ; "menhir" ; "use_menhir"] (S[A"--explain";
|
||||||
|
A"--table"]);
|
||||||
|
|
||||||
| _ -> ()
|
| _ -> ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue