Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: guillaume.yziquel@citycable.ch
Cc: Kihong Heo <khheo@ropas.snu.ac.kr>, caml-list@inria.fr
Subject: Re: [Caml-list] C++ parser
Date: Sun, 17 Jan 2010 20:15:40 +0100	[thread overview]
Message-ID: <4B5361DC.9040402@starynkevitch.net> (raw)
In-Reply-To: <4B5337D5.7010003@citycable.ch>

Guillaume Yziquel wrote:
> 
> For a new project, I'd use GCC XML.

[[sorry for this reply, which is barely related to Ocaml, but may be of interest to several Ocaml fans interested in C++ 
analysis]]

There is however a small caveat. AFAIK, GCC XML is not much maintained, and depends upon an old GCC version (but I might 
be wrong on both points). Latest release of GCC XML seems to be 0.6 from february 2004.

Next (4.5.0) release of GCC will provide two major new features: link time optimization [=LTO] & plugins.

Both features are useful for any kind of C++ static analysis programs; a plugin can define new passes, and the LTO 
feature enable them to be run at "link" time, that is to merge information from several compilation units. And indeed 
GCC have powerful & common internal representations of the compiled source code, which is the same for C, C++, Fortran, 
Ada, Java .. source inputs to GCC.

So one could consider coding a plugin for GCC which extracts the exact information required by your (Ocaml) static 
analyser. In addition (sorry for the shameless self-promotion), if you like functional programming, you might even code 
your plugin as a MELT module. MELT is a plugin (written by me) which enables you to express your GCC pass in a 
higher-level Lisp-like mostly dynamic language (with closures, powerful pattern matching [in particular pattern matching 
on GCC internal representations like Gimple], objects - but unfortunately no static typing with type inference).

Feel free to ask me more (preferably off list, or preferably on the gcc@gcc.gnu.org list) about MELT.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


  reply	other threads:[~2010-01-17 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-14 11:36 Kihong Heo
2010-01-14 19:58 ` [Caml-list] " Yoann Padioleau
2010-01-17 16:16 ` Guillaume Yziquel
2010-01-17 19:15   ` Basile STARYNKEVITCH [this message]
2010-01-17 19:16   ` Yoann Padioleau

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=4B5361DC.9040402@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    --cc=guillaume.yziquel@citycable.ch \
    --cc=khheo@ropas.snu.ac.kr \
    /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