Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Looking for full-fledged C++ Parser with OCAML interface

12 views
Skip to first unread message

Soonho Kong

unread,
Mar 7, 2008, 2:38:52 AM3/7/08
to caml...@yquem.inria.fr, Kwangkeun Yi, gr...@ropas.snu.ac.kr
Hello everyone. I'm a graduate student majoring in program analysis.

I'm looking for a full-fledged C++ parser with OCAML interface. Our team
researched some C++ parsers and found that
Olmar(http://www.cs.ru.nl/~tews/olmar/) was the best candidate among
them. I have two questions about it.

1. Is there a better candidate than Olmar? Please recommend one if
anyone knows about it.

2. If anyone have used Olmar before, I'd like to listen to your
experience with it. I'm curious of its tolerance with various C++
dialects, robustness, and efficiency on the code used in real world.

Thanks in advance for your help.


Best Regards

Soonho Kong

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

David Teller

unread,
Mar 7, 2008, 3:01:13 AM3/7/08
to Soonho Kong, Kwangkeun Yi, caml...@yquem.inria.fr, gr...@ropas.snu.ac.kr
Hi,

I personally haven't used it, but I'm pretty sure it's what Mozilla is
using to rewrite their code for automatic exception rewriting. Which is
a good sign.

Cheers,
David

On Fri, 2008-03-07 at 16:40 +0900, Soonho Kong wrote:
> Hello everyone. I'm a graduate student majoring in program analysis.

--
David Teller
Security of Distributed Systems
http://www.univ-orleans.fr/lifo/Members/David.Teller
Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.

Christopher L Conway

unread,
Mar 7, 2008, 8:54:21 AM3/7/08
to Soonho Kong, Kwangkeun Yi, caml...@yquem.inria.fr, gr...@ropas.snu.ac.kr
Have you looked at LLVM? It does have OCaml bindings, although they
were only partial when last I looked. I don't know "how fledged" their
C++ parser is.

Chris

Gordon Henriksen

unread,
Mar 7, 2008, 9:29:10 AM3/7/08
to caml...@yquem.inria.fr
On 2008-03-07, at 08:54, Christopher L Conway wrote:

> On Fri, Mar 7, 2008 at 2:40 AM, Soonho Kong <so...@ropas.snu.ac.kr>
> wrote:
>
>> Hello everyone. I'm a graduate student majoring in program
>> analysis. I'm looking for a full-fledged C++ parser with OCAML

>> interface. Is there a better candidate than Olmar? Please recommend

>> one if anyone knows about it.
>

> Have you looked at LLVM? It does have OCaml bindings, although they
> were only partial when last I looked.

LLVM's OCaml bindings are aimed at authoring front-ends (i.e., IR
generation), and are reasonably complete from that perspective.

> I don't know "how fledged" their C++ parser is.

The LLVM project includes two C front-ends (separate projects).

llvm-gcc is a gcc branch maintained by the LLVM project. It is stable
and complete, having successfully been used to compile very a large
volume of C, C++ and Objective-C code. Unfortunately, GCC does not
have a library-based design, so attaching to its parser would be very
difficult.
clang is an entirely new compiler under development in the LLVM
project. It only yet compiles C. Objective C is also parsed. clang has
a library-based design that should make it very attractive for tools
building. It is being designed to support such clients as refactoring
and IDEs. It supports serializing the AST to disk, source rewriting,
and incremental reparsing. Full C++ support has been estimated at 2
years out.

So, looking for a C++ parser now for a research project, you probably
won't find anything of value from the LLVM project. In the longer
term, clang may be significantly interesting, not only because it has
a library-based design, but also because it will be used in a first-
class capacity (compiler, IDE) by a large vendor (Apple).

— Gordon

Hendrik Tews

unread,
Mar 31, 2008, 5:51:24 AM3/31/08
to caml...@yquem.inria.fr
Hi,

Soonho Kong <so...@ropas.snu.ac.kr> writes:

Olmar(http://www.cs.ru.nl/~tews/olmar/) was the best candidate among
them. I have two questions about it.

If you try Olmar I would be interested in your experience!
Further, as the documentation is inexistent (there are almost no
Olmar users), if you hit a problem, don't hesitate to ask me.

For documenting the Olmar ast see the Elsa ast nodes pages in the
Mozilla wiki (http://wiki.mozilla.org/Elsa_ast_nodes). There is
not much additional information in there, but at least you can
click through the interfaces and add your own findings. We know a
bit more than what's in the wiki, so don't hesitate to ask on the
oink-devel mailing list.

If you try Olmar I would suggest that you use the cvs version,
there have been lots of changes/improvements since the last
release.

2. If anyone have used Olmar before, I'd like to listen to your
experience with it. I'm curious of its tolerance with various C++
dialects, robustness, and efficiency on the code used in real world.

Olmar relies on Elsa for parsing, so this is really a question
about the capabilities of Elsa. The current Elsa version can't
parse all new gcc headers, through I never run into this problem
and use whatever header are installed on my system. For Mozilla
this was a real problem, but Taras Glek's blog seems to indicate
that they fixed most of those in their Elsa branch in the pork
repository. A problem with Elsa is that the current maintainer
makes it really difficult to contribute something back. Therefore
everybody has there own (incompatible) Elsa branch. A problem
with Olmar is that you cannot simply use it with a different Elsa
branch. But I am working in that direction...

However, my current contract ends this April and I might not have
any time left for Olmar then. If you decide for Olmar you must be
prepared to take over maintenance.


David Teller <David....@univ-orleans.fr> writes:

I personally haven't used it, but I'm pretty sure it's what Mozilla is
using to rewrite their code for automatic exception rewriting. Which is
a good sign.

I am not completely sure, but I would be surprised, if Mozilla
already uses Olmar.

Sorry for the late reply, but I sometimes get overwhelmed by the
traffic on the ocaml-list and then I am suddenly 500 messages
behind...

Bye,

Hendrik Tews

0 new messages