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 05A7ABC69 for ; Wed, 2 May 2007 15:09:00 +0200 (CEST) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l42D8wMK017882 for ; Wed, 2 May 2007 15:08:59 +0200 Received: by wr-out-0506.google.com with SMTP id l58so123339wrl for ; Wed, 02 May 2007 06:08:57 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EsfngVvOIfhzWB69GFTd4AepE2KJA6LFEgAVGs44GeM+EbUcRKOoeGy9oYStmXPXez5jR1/NlIbocWrW5t4wgo+yE5f602/Lp1jQm43aEBk5Jz+UkC4GqFwy8Bx3KyQbfnxSPzYiW3RHQGFIUhQzFPpQoMNeTojb35Y4xTQMxxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OaUv1cEj3eBRV0FbSv1aokmstVz0IhaHFgCt6P1kKs+wyJ1hxvCdROCD1WuAzFXLI3vA55Jhq9oaLyMW8qIoJZ+rbw/LtMEIWohNUBR5SC8ZK7/AsNAt1g2wQkiDtHUHp2jfLCsMLAnCMRwMxew+Asrxy2WVp1jtmwgF+/NqLd4= Received: by 10.114.112.1 with SMTP id k1mr223537wac.1178111336337; Wed, 02 May 2007 06:08:56 -0700 (PDT) Received: by 10.114.183.15 with HTTP; Wed, 2 May 2007 06:08:56 -0700 (PDT) Message-ID: Date: Wed, 2 May 2007 15:08:56 +0200 From: "Nicolas Pouillard" To: "Joel Reymont" Subject: Re: [Caml-list] Re: ocamlbuild, menhir and keeping tokens in a separate file Cc: "Caml List" In-Reply-To: <4652F73F-9CAA-4C47-AA11-0D5CFDCAE79B@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> X-j-chkmail-Score: MSGID : 46388D6A.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46388D6A.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; tokens:01 ocaml:01 parser:01 parsing:01 ocaml:01 parser:01 tokens:01 ocamldep:01 ocamldep:01 parsers:01 byte:01 usr:01 usr:01 wrote:01 minor:01 On 5/2/07, Joel Reymont wrote: > 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. > Ok > > 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. That kind of factorisation is not yet available. > > 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. No but you can have some rules for each parser. 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 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? >>From here I don't know why it fails... -- Nicolas Pouillard