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 RAA07142; Mon, 7 Jun 2004 17:47:20 +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 RAA06867 for ; Mon, 7 Jun 2004 17:47:17 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i57FlBEV006248 for ; Mon, 7 Jun 2004 17:47:15 +0200 Received: from [192.168.1.200] (ppp114-11.lns1.syd3.internode.on.net [150.101.114.11]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i57Fkx4Y001579; Tue, 8 Jun 2004 01:17:02 +0930 (CST) Subject: Re: [Caml-list] Efficient C++ interfacing? From: skaller Reply-To: skaller@users.sourceforge.net To: erayo@cs.bilkent.edu.tr Cc: caml-list In-Reply-To: <200406070604.39686.exa@kablonet.com.tr> References: <40800C10000A6ABC@mk-cpfrontend-4.mail.uk.tiscali.com> <200406062144.55004.exa@kablonet.com.tr> <1086554511.16811.651.camel@pelican.wigram> <200406070604.39686.exa@kablonet.com.tr> Content-Type: text/plain Message-Id: <1086623218.16811.731.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 08 Jun 2004 01:46:59 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 40C48DFF.001 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 namespaces:01 swig:01 real-world:01 libs:01 shortcomings:01 swig:01 dynamically:01 9660:01 glebe:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, 2004-06-07 at 13:04, Eray Ozkural wrote: > You can skip code blocks, assignment statements, etc., but that means you have > to parse them. :) Indeed, but it is enough to do stuff like track matching brackets to do that. The other tokens don't affect the parse and just get dropped. > My idea was that you first needed a complete C++ syntax > analyzer, and then you can build whatever minimal semantic analyzer you want > to. Here, we need just a (possibly) full C++ static type analyzer. I was > venturing in that direction and saw it was so much harder than C, naturally. > The C++ type system and *syntax* is a mess, especially with templates. The syntactic problem itself isn't quite so bad. The real difficulty is that you need to know, as in C, if a name is a type. In both C and C++, this means keeping track of typenames. The difference is that in C this is a simple dictionary lookup. In C++, with overloading and namespaces and templates etc, the lookup rules are quite nasty .. so the real problem is that you can't parse without a structured symbol table and complex lookup rules. > Are there any decent combinatorial parser packages > for ocaml? (Or is ocaml not abstract enough to do that? *grin*) Good question. Be nice to have some alternative parsers around. > A parser generator that can cope with C++ adequately is most definitely a > great boost. As I said, I lack experience with the new features of SWIG, but > you seem to think it is inadequate. Have you tried it out with any real-world > C++ libs, does it have serious shortcomings? The problem with SWIG for me isn't that it can't parse C++: there are two problems: (1) it isn't built for automation (wrapping many libraries all at once). (2) It can't dynamically load the SWIG felix module and the developers won't put it in CVS, so it becomes a nightmare to build. -- 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