Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Dypgen C++ grammar
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-25 (21:26)
From: Taras Glek <tglek@s...>
Subject: Re: [Caml-list] Dypgen C++ grammar
Hi Scott,
Why write yet another incomplete C++ parser? You can already get a very 
nice OCaml representation of a C++ program through olmar( ).
If that doesn't suit your needs, why not point out the problems and 
maybe work together to solve them? Parsing C++ is hard enough that there 
isn't a single complete open source C++ parser other than g++. 
Olmar/elsa represent the second best C++ parser and everybody else isn't 
even close. Unlike g++, elsa is designed to support more than just 
compilers (ie has a much nicer API) and has a more liberal license.

My understanding is that there are Cil people interested in making elsa 
work better with OCaml.

If the above doesn't suit you, your best bet would be to convert the 
elsa grammar into OCaml (elkhound already has some ml support), but that 
will mean redoing a serious amount of type resolution work.


skaller wrote:
> Is anyone interested in developing a C++ parser, possibly using
> FrontC and/or CIL as the starting point, but using Dypgen
> as the parser engine?
> I have made some modification to FrontC/Cil to support
> some C++ constructions, but Ocamlyacc (LALR1) just can't cope
> with C++.
> OTOH, Scott McPeak has a C++ grammar for Elkhound which is
> a C++ based GLR engine, with BSD licence, so it may be possible
> to adapt that.