From: Joel Reymont <joelr1@gmail.com>
To: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Cc: "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: ocamlbuild, menhir and keeping tokens in a separate file
Date: Wed, 2 May 2007 13:48:44 +0100 [thread overview]
Message-ID: <4652F73F-9CAA-4C47-AA11-0D5CFDCAE79B@gmail.com> (raw)
In-Reply-To: <cd67f63a0705020454o59f1cc3j42d40eefd9d76b00@mail.gmail.com>
Nicolas,
Thank you very much for your help and answers. I'm slowly learning!
I have the following in my plugin now...
> flag ["ocaml"; "parser"; "menhir" ] (A"--explain");
I always want to run Menhir with --explain in the parsing phase.
> flag ["ocaml"; "parser"; "menhir"; "only_tokens" ] (A"--only-
tokens");
> flag ["ocaml"; "menhir_ocamldep"; "only_tokens" ] (A"--only-tokens");
I wish the tail portion could be combined, i.e. "only_tokens" ] (A"--
only-tokens"); created once and then appended somehow. Just a minor
wish, though, although comments are always appreciated.
> flag ["ocaml"; "parser"; "menhir"; "ext_tokens" ] (S[A"--external-
tokens";
A"EasyToken";
A"EasyToken.mly";
]);
> flag ["ocaml"; "menhir_ocamldep"; "ext_tokens" ] (S[A"--external-
tokens";
A"EasyToken";
A"EasyToken.mly";
]);
Is there a way to create a "hole" for A"EasyToken" that can be filled
from the _tags file?
I may have different parsers in the project and not all of then would
use EasyToken as the external token module.
> flag ["ocaml"; "parser"; "menhir"; "token_base" ] (S[A"--base";
A"EasyParser";
]);
> flag ["ocaml"; "menhir_ocamldep"; "token_base" ] (S[A"--base";
A"EasyParser";
]);
Another tag for Menhir.
> dep ["ocaml"; "menhir_ocamldep"; "use_tokens"] ["EasyToken.mly"];
> dep ["ocaml"; "parser"; "menhir"; "use_tokens"] ["EasyToken.mly"];
The token file needs to be generated before the parser. Can a hole be
created here to be filled from _tags? My token file won't always be
EasyToken.mly.
Now in the _tags file I have...
> true: use_menhir
I want to always use Menhir.
> "EasyParser.mly": token_base, use_tokens, ext_tokens
I thought what I'm telling ocamlbuild is that to generate EasyParser
it needs to pass Menhir the --base ... and ext_tokens flags, and that
EasyParser.mly depends on EasyToken.mly.
I may have gotten the dependency wrong since EasyToken.mly is not a
generated file, it just needs to be processed before. In fact, I may
not even need the dependency since I'm force-feeding Menhir the file
on the command line.
> "EasyToken.mly": only_tokens
I want to compile the above with _just_ the --only-tokens option.
What happens when I run ocamlbuild?
ocamlbuild Test.byte
+ /usr/local/bin/menhir --external-tokens EasyToken EasyToken.mly --
base EasyParser --raw-depend --ocamldep '/usr/local/bin/ocamldep.opt -
modules' EasyParser.mly > EasyParser.mly.depends
Error: EasyToken.mly: No such file or directory
Why are the external tokens and base options used above???
And why is EasyToken.mly not found?
What did I get wrong in my plugin and tags file?
Thanks, Joel
--
http://wagerlabs.com/
next prev parent reply other threads:[~2007-05-02 12:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-27 23:38 Joel Reymont
2007-04-27 23:50 ` Joel Reymont
2007-04-28 0:05 ` Joel Reymont
2007-04-28 0:34 ` Joel Reymont
2007-04-28 15:14 ` [Caml-list] " Nicolas Pouillard
2007-04-28 15:12 ` Nicolas Pouillard
2007-05-02 8:51 ` Joel Reymont
2007-05-02 11:54 ` Nicolas Pouillard
2007-05-02 12:00 ` Joel Reymont
2007-05-02 12:48 ` Joel Reymont [this message]
2007-05-02 13:08 ` Nicolas Pouillard
2007-05-02 13:28 ` Joel Reymont
2007-05-02 13:47 ` Joel Reymont
2007-05-02 14:55 ` Joel Reymont
2007-05-03 7:26 ` Nicolas Pouillard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4652F73F-9CAA-4C47-AA11-0D5CFDCAE79B@gmail.com \
--to=joelr1@gmail.com \
--cc=caml-list@inria.fr \
--cc=nicolas.pouillard@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox