Re: looking for a c++ -> c++ parser

David Chase <>
24 Nov 1998 22:19:16 -0500

          From comp.compilers

Related articles
looking for a c++ -> c++ parser (1998-11-15)
Re: looking for a c++ -> c++ parser (1998-11-19)
Re: looking for a c++ -> c++ parser (Eric Marsden) (1998-11-19)
Re: looking for a c++ -> c++ parser (David Chase) (1998-11-24)
| List of all articles for this month |

From: David Chase <>
Newsgroups: comp.compilers
Date: 24 Nov 1998 22:19:16 -0500
Organization: NaturalBridge LLC
References: 98-11-088 98-11-097
Keywords: C++, tools

Greg Lindahl wrote:

> ... the EDG parser source
> is available free for non-commercial use, and I heard (a while ago)
> about a project by Kathy Lindlan <> to build
> some stuff with the EDG parser which allows tool builders to do
> interesting things to parsed C++ programs. Details are at:
> I'm not sure if there is a tool which takes her IL and outputs C++,
> but that part doesn't look hard.

It is true that the EDG parser can be used for these purposes; a
couple of years ago I worked for a company that used it in just that
way (inserting instrumentation into the intermediate tree, emitting
C++ source, then compiling that).

Solving the "emit valid C++ from an intermediate IL" can be a good
deal harder than you seem to think. Several bright people with years
of experience fiddling with the EDG tools did get it to apparently
work; there was some back-and-forth with the guys at EDG, and it is
probably easier now than it was when the project began. It is not
100% possible to add arbitrary instrumentation to C++; in some cases,
"there's no there there" to insert your instrumentation into (this
depends somewhat upon whether you wish to retain compatibility with
uninstrumented code; if you relax that restriction, life gets a good
deal easier). Lack of a well-defined evaluation order for C++
expressions (as in, ONE legal evaluation order) makes life tough, as
does different back-end compilers' ideas about temporary lifetimes (it
helps when they get it right). Buggy, and varying (that should go
away soon now that there's a standard, right?) C++ compilers were a
substantial headache.

The result of this experience building C++ debugging tools was a
substantial enthusiasm for Java :-).

David Chase
NaturalBridge LLC
(former employee of CenterLine Software)

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.