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 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id BD285BC6B for ; Fri, 22 Jun 2007 06:03:21 +0200 (CEST) Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5M43J0B018857 for ; Fri, 22 Jun 2007 06:03:20 +0200 X-IronPort-AV: E=Sophos;i="4.16,449,1175437800"; d="scan'208";a="106258914" Received: from ppp59-167-2-129.lns1.syd7.internode.on.net (HELO [192.168.1.201]) ([59.167.2.129]) by ipmail03.adl2.internode.on.net with ESMTP; 22 Jun 2007 13:33:17 +0930 Subject: Re: [Caml-list] Parsing From: skaller To: Jon Harrop Cc: caml-list@yquem.inria.fr, Emmanuel Onzon In-Reply-To: <200706220014.39510.jon@ffconsultancy.com> References: <200706220014.39510.jon@ffconsultancy.com> Content-Type: text/plain Date: Fri, 22 Jun 2007 14:03:14 +1000 Message-Id: <1182484994.7140.26.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 467B4A07.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parsing:01 0100,:01 parser:01 camlp:01 parsing:01 syntax:01 parsers:01 grammars:01 parser:01 grammars:01 camlp:01 sourceforge:01 wrote:01 extensible:01 caml-list:01 On Fri, 2007-06-22 at 00:14 +0100, Jon Harrop wrote: > I'm not a parser junkie, so please bear with me if this is silly... > > The camlp4 stream parsing syntax extension is a very cool way to write > efficient parsers for simple grammars: [] > However, you must factor heads in the pattern matches. > Why is this? Is it because the streams are destructive? Yes. > Are there other parser tools that integrate into the language and do a better > job? Yes. Dypgen. I'm cc'ing to emmanuel, because a Dypgen parser using a stream as an input would be very cool! Dypgen is GLR, so all the cases get considered simultaneously. The current build uses an LR0 kernel I think, so there's no lookahead. Also, dypgen is extensible, so you can build grammars at run time and then parse with them. Doing that requires a bit more code, some of which could be 'libraried' and the rest probably supported with camlp4 macros if you're into that. -- John Skaller Felix, successor to C++: http://felix.sf.net