From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 595BEBC69 for ; Wed, 2 May 2007 15:28:46 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l42DSj1x025024 for ; Wed, 2 May 2007 15:28:46 +0200 Received: by ug-out-1314.google.com with SMTP id k3so200631ugf for ; Wed, 02 May 2007 06:28:45 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=fI+ORgyVHqM2v9RPJZmTCSvSZK+vOKuV5Fn91j25AQPxXU8jzseYK/akQqvQjD+xNBzFI5/PGkWe0io42MO6AATrmU5EHBxtXGbtt5OP9Yqpk06s6HJKyhIlhPdtBAgKIgqBIA6P3q393iGOjZyu8WcPZLxlhn06XD921RQ/SIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Gk3iSpSC/yC217mi3co4r3D27cJsnoytIhQmZ5ES4ka8d/YhhA/VXN/E2U6N5am5urQC7tj+DIBYm6R+KO6DM8cKC8cZq2hYY0lHaojkgHVSPsf8MduES8cryZErp69x1gCI5nSwKl0AyHVKZMA2aswKIx3uiPgP2FaZ8CVxYbQ= Received: by 10.82.187.16 with SMTP id k16mr1445970buf.1178112525497; Wed, 02 May 2007 06:28:45 -0700 (PDT) Received: from ?192.168.1.34? ( [83.52.237.136]) by mx.google.com with ESMTP id b33sm101192ika.2007.05.02.06.28.36; Wed, 02 May 2007 06:28:41 -0700 (PDT) In-Reply-To: References: <301C13B2-671A-40CE-AB6C-E92E0ED454E6@gmail.com> <78040751-B95B-4620-A995-A4AB74F5E997@gmail.com> <2A1A8C74-50D5-4F0B-815B-B56CA506578E@gmail.com> <264A27CD-4310-4142-9BCB-2BF3DF5478C3@gmail.com> <4652F73F-9CAA-4C47-AA11-0D5CFDCAE79B@gmail.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <73737679-8F9A-48E4-9214-145A5DAA218B@gmail.com> Cc: "Caml List" Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: [Caml-list] Re: ocamlbuild, menhir and keeping tokens in a separate file Date: Wed, 2 May 2007 14:28:32 +0100 To: "Nicolas Pouillard" X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 4638920D.002 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 4638920D.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; tokens:01 parser:01 ocaml:01 ocamldep:01 parser:01 ocaml:01 tokens:01 dependencies:01 byte:01 usr:01 ocamlc:01 -package:01 dependencies:01 mll:01 mll:01 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/