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 28A1EBC69 for ; Wed, 2 May 2007 14:48:46 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l42Cmjh4011565 for ; Wed, 2 May 2007 14:48:45 +0200 Received: by ug-out-1314.google.com with SMTP id k3so194304ugf for ; Wed, 02 May 2007 05:48: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=QMcYwVSLHBSEId8JEpE3zsPLnJCNEqxB/VVQrZ4tQO/nXYN0/YrsstryBKGSQgECUUSNwPffcZNgeWc5hg5IqKN61hMI+KW60Vuhftm/2VhrX0/XG6QuhlZEV9yoQUp5ufXJUSXFai/KrvvRYwM6ZGJqfe1sJTJL4wsNUo0VPJ0= 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=bjDkMFxI4oafQdYZx7pxGzP0b4IEcLYNj6OpJj+HcxbnDKZ7URCVfB7PBZqc80OiRSkTs/Q1dlHAwW+cSnFGcD4TfIT41ROdLRPSv4JcyPUzM6aIVhDIkHqOrXkpmzD3uFp/QDI4U9AeSDt6ijZE7t49gPwya2JqmfBjH6PgAQQ= Received: by 10.67.89.6 with SMTP id r6mr953270ugl.1178110125539; Wed, 02 May 2007 05:48:45 -0700 (PDT) Received: from ?192.168.1.34? ( [83.52.237.136]) by mx.google.com with ESMTP id 55sm1214591ugq.2007.05.02.05.48.44; Wed, 02 May 2007 05:48:44 -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> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4652F73F-9CAA-4C47-AA11-0D5CFDCAE79B@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 13:48:44 +0100 To: Nicolas Pouillard X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 463888AD.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 463888AD.000 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 flags:01 byte:01 usr:01 usr:01 minor:01 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/