From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA14340; Thu, 17 Jun 2004 11:42:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA13336 for ; Thu, 17 Jun 2004 11:42:15 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5H9gBSH003520 for ; Thu, 17 Jun 2004 11:42:13 +0200 Received: from [192.168.1.200] (ppp219-142.lns2.syd3.internode.on.net [203.122.219.142]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i5H9g84Y031606; Thu, 17 Jun 2004 19:12:09 +0930 (CST) Subject: Re: [Caml-list] ocamllex/yacc and camlp4 From: skaller Reply-To: skaller@users.sourceforge.net To: William Lovas Cc: caml-list In-Reply-To: <20040617020421.GA11723@force.stwing.upenn.edu> References: <20040616085616.B26623@beaune.inria.fr> <200406162248.AAA11976@pauillac.inria.fr> <20040617020421.GA11723@force.stwing.upenn.edu> Content-Type: text/plain Message-Id: <1087465326.16811.1482.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 17 Jun 2004 19:42:08 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40D16773.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 camlp:01 sourceforge:01 2004:99 lovas:01 2004:99 pierre:01 weis:01 camlp:01 examples'':01 lalr:01 'inline':01 9660:01 glebe:01 semantics:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2004-06-17 at 12:04, William Lovas wrote: > On Thu, Jun 17, 2004 at 12:48:01AM +0200, Pierre Weis wrote: > > In conclusion: pure Camlp4 implementation of ocamllex/ocamlyacc is > > still an interesting and challenging progamming task for the next few > > years, if you (or someone else) had the will and time to provide two > > ``great camlp4 examples'' to the rest of us... > > Is such a thing even possible? I thought ocamllex/ocamlyacc produced > parsers for LALR(1) languages while camlp4 produced parsers for LL(k) > languages. These two sets do not bear a subset relation in either > direction, so i would think it impossible to completely implement either > tool in terms of the other. Have i misunderstood something? Yes: there is no need for camlp4 to generate lexers and parsers replacing those you'd build with ocamllex/ocamlyacc, the need is to replace the ocamllex/ocamlyacc parsers used to scan your lexer/grammar specifications -- and that can easily be done by camlp4 (and for lexers certainly has been done several times eg ulex). Having read such specifications 'inline' in Ocaml code, actually generating the parsers/lexers to implement the semantics can easily be done by camlp4 by simply calling an external function. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners