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 DAA12363; Tue, 29 Jun 2004 03:35:57 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA12354 for ; Tue, 29 Jun 2004 03:35:56 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i5T1ZrEV024036 for ; Tue, 29 Jun 2004 03:35:54 +0200 Received: from [192.168.1.200] (ppp217-185.lns1.syd3.internode.on.net [203.122.217.185]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i5T1ZbHY062407; Tue, 29 Jun 2004 11:05:40 +0930 (CST) Subject: Re: [Caml-list] Re: Efficient C++ Interfacing? From: skaller Reply-To: skaller@users.sourceforge.net To: erayo@cs.bilkent.edu.tr Cc: =?ISO-8859-1?Q?=A3ukasz?= Dobrek , caml-list In-Reply-To: <200406282258.24202.exa@kablonet.com.tr> References: <3a4641a78693342be4a5f7172e068f53@remailer.frell.eu.org> <200406082349.18131.exa@kablonet.com.tr> <20040608211914.GA13251@pld-linux.org> <200406282258.24202.exa@kablonet.com.tr> Content-Type: text/plain Message-Id: <1088472936.18587.154.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 29 Jun 2004 11:35:36 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 40E0C779.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 interfacing:01 sourceforge:01 2004:99 eray:01 ozkural:01 typename:01 enums:01 9660:01 glebe:01 ocaml:01 feasible:01 nsw:01 snail:02 parser:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 2004-06-29 at 05:58, Eray Ozkural wrote: > The only sad thing about these systems is that they are not > written in ocaml. :) An Earley parser is easy to make, RD even easier although it's a bit harder in that case to get the grammar right. The main problem is handling the silly identifier/typename distinction, which is easy to do .. and hard to *undo*: forgetting things is vital for a functional parser. Tying the lexer and parser together solves this problem. I assume performance isn't as vital to you as actually parsing the input. Earley seems quite feasible for C++, since in practice there are enough 'stopping symbols' to restrict the O(n^3) performance problem to small enough n to be practical. The bottom line here is that it is a lot of work to elaborate all the grammar productions, especially if you want to take MSC/gnu extensions into account and handle "C" as well (since C has distinct rules for some things like enums and nested classes). -- 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