caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
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 14:28:32 +0100	[thread overview]
Message-ID: <73737679-8F9A-48E4-9214-145A5DAA218B@gmail.com> (raw)
In-Reply-To: <cd67f63a0705020608n392a6036ybc2e04d4166f09c6@mail.gmail.com>


On May 2, 2007, at 2:08 PM, Nicolas Pouillard wrote:

> You can generate these rules:
>
> let mk_ext_token parser token =
>  flag ["ocaml"; "menhir_ocamldep"; "file:"^parser^".mly"]
>    (S[A"--external-tokens"; A token; A(token^".mly")]);
>  flag ["ocaml"; "parser"; "menhir"; "file:"^parser^".mly"]
>    (S[A"--base"; A parser]);

What would I need to put in my _tags file to use the above? I just  
have this for now:

"EasyToken.mly": only_tokens
"EasyParser.mly": token_base, ext_tokens

>> Error: EasyToken.mly: No such file or directory
>>
> From here I don't know why it fails...

It fails because EasyToken.mly has not been copied to _build. How do  
I force a copy?

For now I have to use "../EasyToken.mly" below

flag ["ocaml"; "parser"; "menhir"; "ext_tokens" ] (S[A"--external- 
tokens";
                                                      A"EasyToken";
                                                      A"../ 
EasyToken.mly";
                                                     ]);

Still, there's something wrong with dependencies

ocamlbuild Test.byte
+ /usr/local/bin/menhir --ocamlc 'ocamlfind ocamlc -package ounit' -- 
explain --external-tokens EasyToken ../EasyToken.mly --base  
EasyParser --infer EasyParser.mly
File "EasyParser.mly", line 54, characters 27-44:
Unbound type constructor EasySymtab.symbol

The problem is that EasySymtab has not been compiled yet. _build/ 
EasyParser.mly.depends is size 0 which is wrong since EasyParser.mly  
opens a bunch of modules. I tried this a couple of times from scratch  
and it's always size 0.

The tail of the log file below shows that ocamlbuild runs  
dependencies on EasyLexer but proceeds to compile EasyParser without  
figuring out its dependencies.

# Target: EasyLexer.mll, tags: { extension:mll, file:EasyLexer.mll,  
lexer, ocaml, ocamllex, quiet, traverse, use_menhir }
/usr/local/bin/ocamllex.opt -q EasyLexer.mll # cached

# Target: EasyLexer.ml.depends, tags: { extension:ml,  
file:EasyLexer.ml, ocaml, ocamldep, quiet, traverse, use_menhir }
/usr/local/bin/ocamldep.opt -modules EasyLexer.ml >  
EasyLexer.ml.depends # cached

# Target: EasyParser.mly, tags: { ext_tokens, extension:mly,  
file:EasyParser.mly, menhir, ocaml, parser, quiet, token_base,  
traverse, use_menhir }
/usr/local/bin/menhir --ocamlc 'ocamlfind ocamlc -package ounit' -- 
explain --external-tokens EasyToken ../EasyToken.mly --base  
EasyParser --infer EasyParser.mly


--
http://wagerlabs.com/






  reply	other threads:[~2007-05-02 13:28 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
2007-05-02 13:08             ` Nicolas Pouillard
2007-05-02 13:28               ` Joel Reymont [this message]
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=73737679-8F9A-48E4-9214-145A5DAA218B@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;
as well as URLs for NNTP newsgroup(s).