caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild and menhir options
@ 2007-04-27 13:52 Joel Reymont
  2007-04-27 14:12 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-27 13:52 UTC (permalink / raw)
  To: Caml List

How can I pass additional options such as --infer or --explain to  
ocamlbuild -use-menhir?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] ocamlbuild and menhir options
  2007-04-27 13:52 ocamlbuild and menhir options Joel Reymont
@ 2007-04-27 14:12 ` Nicolas Pouillard
  2007-04-27 14:19   ` Joel Reymont
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-27 14:12 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/27/07, Joel Reymont <joelr1@gmail.com> wrote:
> How can I pass additional options such as --infer or --explain to
> ocamlbuild -use-menhir?
>

With ocamlbuild --infer is always used. You can give it more flags
using -yaccflags, or through a plugin filling Options.ocaml_yaccflags,
or using some flag declaration using tags such as ("ocaml, "parser",
"menhir").

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] ocamlbuild and menhir options
  2007-04-27 14:12 ` [Caml-list] " Nicolas Pouillard
@ 2007-04-27 14:19   ` Joel Reymont
  2007-04-27 14:27     ` Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-27 14:19 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Caml List


On Apr 27, 2007, at 3:12 PM, Nicolas Pouillard wrote:

> With ocamlbuild --infer is always used. You can give it more flags
> using -yaccflags, or through a plugin filling Options.ocaml_yaccflags,
> or using some flag declaration using tags such as ("ocaml, "parser",
> "menhir").

I tried this but it did not use --explain.

Does the command line look correct?

ocamlbuild -classic-display -yaccflags --explain -use-menhir  
easy_parser.byte

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] ocamlbuild and menhir options
  2007-04-27 14:19   ` Joel Reymont
@ 2007-04-27 14:27     ` Nicolas Pouillard
  2007-04-27 20:15       ` Joel Reymont
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-27 14:27 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/27/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> On Apr 27, 2007, at 3:12 PM, Nicolas Pouillard wrote:
>
> > With ocamlbuild --infer is always used. You can give it more flags
> > using -yaccflags, or through a plugin filling Options.ocaml_yaccflags,
> > or using some flag declaration using tags such as ("ocaml, "parser",
> > "menhir").
>
> I tried this but it did not use --explain.
>
> Does the command line look correct?
>
> ocamlbuild -classic-display -yaccflags --explain -use-menhir
> easy_parser.byte
>

Oops, you're right yaccflags is just for ocamlyacc (I will fix it).

Another solution can be: -ocamlyacc "menhir --explain"

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] ocamlbuild and menhir options
  2007-04-27 14:27     ` Nicolas Pouillard
@ 2007-04-27 20:15       ` Joel Reymont
  2007-04-28  7:55         ` Nicolas Pouillard
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Reymont @ 2007-04-27 20:15 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: Caml List

Nicolas,

> Oops, you're right yaccflags is just for ocamlyacc (I will fix it).
>
> Another solution can be: -ocamlyacc "menhir --explain"

I actually need to run Menhir like this:

menhir --base easy_parser easy_parser.mly easy_tokens.mly

I already have flags like these in myocamlbuild.ml

flag ["ocaml"; "link"] (A"-linkpkg");;
flag ["ocaml"; "link"; "output_obj"] (A"-output-obj");

How would I add the flags for Menhir?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] ocamlbuild and menhir options
  2007-04-27 20:15       ` Joel Reymont
@ 2007-04-28  7:55         ` Nicolas Pouillard
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Pouillard @ 2007-04-28  7:55 UTC (permalink / raw)
  To: Joel Reymont; +Cc: Caml List

On 4/27/07, Joel Reymont <joelr1@gmail.com> wrote:
> Nicolas,
>
> > Oops, you're right yaccflags is just for ocamlyacc (I will fix it).
> >
> > Another solution can be: -ocamlyacc "menhir --explain"
>
> I actually need to run Menhir like this:
>
> menhir --base easy_parser easy_parser.mly easy_tokens.mly
>
> I already have flags like these in myocamlbuild.ml
>
> flag ["ocaml"; "link"] (A"-linkpkg");;
> flag ["ocaml"; "link"; "output_obj"] (A"-output-obj");
>
> How would I add the flags for Menhir?

Instead of giving you the fish, there is a fishing advice!

You should look at the _log file produced by ocamlbuild, there is lines like:
# Target: <filename>, tags: { <tags> }

If you search for the menhir command you will find the tag list
associated (something like ocaml, parser, menhir), then you can add a
flag declaration to inject things a this particular point of the
build.

Regards,

-- 
Nicolas Pouillard


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-04-28  7:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-27 13:52 ocamlbuild and menhir options Joel Reymont
2007-04-27 14:12 ` [Caml-list] " Nicolas Pouillard
2007-04-27 14:19   ` Joel Reymont
2007-04-27 14:27     ` Nicolas Pouillard
2007-04-27 20:15       ` Joel Reymont
2007-04-28  7:55         ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).