caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: erayo@cs.bilkent.edu.tr
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Efficient C++ interfacing?
Date: 08 Jun 2004 01:46:59 +1000	[thread overview]
Message-ID: <1086623218.16811.731.camel@pelican.wigram> (raw)
In-Reply-To: <200406070604.39686.exa@kablonet.com.tr>

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


  parent reply	other threads:[~2004-06-07 15:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-30  7:41 Brandon J. Van Every
2004-05-30 11:47 ` ronniec95
2004-05-30 20:17   ` Brandon J. Van Every
2004-06-05 16:45   ` Eray Ozkural
2004-06-05 19:07     ` skaller
2004-06-06  0:31       ` Eray Ozkural
2004-06-06  3:33         ` John Goerzen
2004-06-06  7:00           ` skaller
2004-06-06 16:02             ` David Fox
2004-06-06 18:44             ` Eray Ozkural
2004-06-06 20:41               ` skaller
2004-06-07  3:04                 ` Eray Ozkural
2004-06-07  7:41                   ` Benjamin Geer
2004-06-07 13:38                     ` Eray Ozkural
2004-06-07 14:18                     ` Basile Starynkevitch local
2004-06-07 14:29                       ` Eray Ozkural
2004-06-07 16:29                         ` Eray Ozkural
2004-06-07 15:46                   ` skaller [this message]
2004-06-06 16:00       ` David Fox
2004-06-05 21:39     ` Brandon J. Van Every
2004-06-06 16:18       ` David Fox
2004-06-06 18:47         ` Eray Ozkural

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1086623218.16811.731.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=erayo@cs.bilkent.edu.tr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).