From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 831FBBB81 for ; Thu, 22 Sep 2005 19:08:38 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8MH8blP000563 for ; Thu, 22 Sep 2005 19:08:38 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA06172 for ; Thu, 22 Sep 2005 19:08:37 +0200 (MET DST) Received: from mail21.sea5.speakeasy.net (mail21.sea5.speakeasy.net [69.17.117.23]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8MH8Zke000560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Sep 2005 19:08:36 +0200 Received: (qmail 15669 invoked from network); 22 Sep 2005 17:08:31 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail21.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 22 Sep 2005 17:08:31 -0000 Date: Thu, 22 Sep 2005 10:08:31 -0700 (PDT) From: brogoff To: yoann padioleau Cc: Alex Baretta , Ocaml Subject: Re: [Caml-list] Yacc limitations In-Reply-To: <27582143.1127407593127.JavaMail.www@wwinf1503> Message-ID: References: <27582143.1127407593127.JavaMail.www@wwinf1503> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 4332E515.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4332E513.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 parser:01 ocamlyacc:01 parser:01 ocaml:01 ocaml:01 ocamllex:01 ocamlyacc:01 lazy:01 parsing:01 grammars:01 recursive:01 parsers:01 recursive:01 parsers:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Thu, 22 Sep 2005, yoann padioleau wrote: > > I am getting very much annoyed with the obtusity of the LALR-yacc parser > > generators. I have unsurmountable difficulties at teaching ocamlyacc how > > to parse SQL decently. > > > > What is the "way to go" in terms of parser generators for Ocaml? I'd > > like to see if there is some level of agreement in the community on this > > issue. It would be great to see an all OCaml parser generator, something really fancy, like an Earley parser. I say "all OCaml", as opposed to, say an OCaml backend for some existing tool like ANTLR, because code cannibalization is good. Anyways, if you're looking to do something like this, an ocamllex compatible, mostly yacc like earley style parser generator would be interesting. Or one that generates the scanner too. To get people to move beyond yacc you need to offer something that's both better and (mostly) compatible. All IMO of course. > I personnaly use ocamlyacc and even if there is some difficulties, I like it. I use it because I know yacc, and lots of people I work with know yacc, it comes with OCaml, and there's a lot of available documentation. I wouldn't say I like it, but I don't hate it and it's good enough and I'm too lazy to learn anything else right now. > All the ocaml project that I know that need some complex parsing use ocamlyacc. > Some people also use streams but are limited to write LL(1) grammars. No, they make it easy to write recursive descent parsers "inline", and it's pretty easy (too easy) to hack recursive descent parsers to handle greater lookaheads. Neat stuff, but not widely used as far as I can see. -- Brian