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: -- (:)
From: Christopher L Conway <cconway@c...>
Subject: Re: [Caml-list] Dypgen C++ grammar
I would be extremely interested in a C++ parser for OCaml, especially
if it was largely compatible with CIL. The conventional wisdom is that
this is a lost cause, it's just too much work. E.g., in order to
handle real code, you'd need to support almost 30 years' worth of
language variants and historical compiler bugs that have become de
facto "features", etc.

Another approach would be to modify GCC so that it's intermediate
representation can be fed to outside tools. As a bonus, this would
provide support for Java, Fortran, and all the other languages
front-endsd in the GCC suite. Unfortunately, unless the GCC
maintainers have changed their position, this would require forking
the front end, though I suspect the changes required to implement this
are fairly minor. (See, e.g., this old discussion from the GCC list:


On 6/22/07, 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.
> --
> John Skaller <skaller at users dot sf dot net>
> Felix, successor to C++:
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports: