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 DAA10303; Wed, 7 Jul 2004 03:02:52 +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 DAA09363 for ; Wed, 7 Jul 2004 03:02:50 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from eposta.kablonet.com.tr ([62.248.102.66]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i6712lSH027566 for ; Wed, 7 Jul 2004 03:02:48 +0200 Received: (qmail 86668 invoked by uid 0); 7 Jul 2004 01:13:22 -0000 Received: from unknown (HELO orion) (exa@kablonet.com.tr@81.214.24.132) by 0 with SMTP; 7 Jul 2004 01:13:22 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: skaller@users.sourceforge.net Subject: Re: [Caml-list] Re: Efficient C++ Interfacing? Date: Wed, 7 Jul 2004 04:02:43 +0300 User-Agent: KMail/1.6.51 Cc: =?iso-8859-1?q?=A3ukasz_Dobrek?= , caml-list References: <3a4641a78693342be4a5f7172e068f53@remailer.frell.eu.org> <200406282258.24202.exa@kablonet.com.tr> <1088472936.18587.154.camel@pelican.wigram> In-Reply-To: <1088472936.18587.154.camel@pelican.wigram> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407070402.43790.exa@kablonet.com.tr> X-Miltered: at concorde with ID 40EB4BB7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 interfacing:01 2004:99 2004:99 eray:01 ozkural:01 typename:01 enums:01 antlr:01 predicates:01 antlr:01 crafty:01 erayo:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday 29 June 2004 04:35, skaller wrote: > 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). I'd studied Earley parsers in an NLP course. I've no idea if it would be so much easier than an ANTLR or OpenC++ parser, though. Is it because we wouldn't have to factor the grammar or some other improvement in specification? Would we be able to maintain semantic predicates a la ANTLR easily? (The lead developer of ANTLR seems to suggest writing a C++ parser is a crafty, difficult thing regardless of which parser technology you choose...) Regards, -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://malfunct.iuma.com GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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