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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id CAB03BC69; Wed, 2 May 2007 01:42:39 +0200 (CEST) Received: from ipmail01.adl2.internode.on.net (ipmail01.adl2.internode.on.net [203.16.214.140]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l41Ngalg003210; Wed, 2 May 2007 01:42:38 +0200 X-IronPort-AV: E=Sophos;i="4.14,475,1170595800"; d="scan'208";a="122074090" Received: from ppp8-148.lns1.syd7.internode.on.net (HELO [192.168.1.201]) ([59.167.8.148]) by ipmail01.adl2.internode.on.net with ESMTP; 02 May 2007 09:12:33 +0930 Subject: Re: [Caml-list] menhir From: skaller To: Francois.Pottier@inria.fr Cc: caml-list@inria.fr In-Reply-To: <20070501173409.GB7308@yquem.inria.fr> References: <1177756336.11923.18.camel@rosella.wigram> <20070428165058.GA31584@yquem.inria.fr> <1177821783.25394.37.camel@rosella.wigram> <20070501155705.GA29617@yquem.inria.fr> <1178039464.8967.10.camel@rosella.wigram> <20070501173409.GB7308@yquem.inria.fr> Content-Type: text/plain Date: Wed, 02 May 2007 09:42:30 +1000 Message-Id: <1178062950.8967.39.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4637D06C.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 lexer:01 tokens:01 tokens:01 syntax:01 sourceforge:01 wrote:01 token:01 token:01 imho:01 caml-list:01 pottier:01 conflicts:01 conflicts:01 precisely:01 On Tue, 2007-05-01 at 19:34 +0200, Francois Pottier wrote: > > So basically, menhir is saying "what happens if you hit > > end of stream here? What should be done?" and the answer > > is "it can't happen". > > What I am trying to say is, Menhir doesn't ask this question. It asks: > "what happens if I reach that state? should I request a lookahead token > from the lexer, or shouldn't I?" Perhaps I do not fully understand but: I do not use 'eof' (end-of-stream pseudo token). I get this for an unused token: "Warning: the token WHENCE is unused." and I should get the same for eof IMHO (but possibly suppressed message since it's not a user defined token). What i actually get is 145 end-of-stream conflicts .. but i get no conflicts on WHENCE. That is, instead of treating the token set precisely as the set of user tokens + eof, menhir is treating eof specially and not consistently with other tokens. There's no conflict: in every one of these states if 'eof' turns up its a syntax error, exactly the same as if WHENCE turns up. I'm not sure i fully understand the 'do we need lookahead' issue: I would have thought: you need a fetch if your action is shift, and not if it is a reduce. -- John Skaller Felix, successor to C++: http://felix.sf.net