This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
2 Projects with gcc
- From: Salman Khilji <skhilji at tampabay dot rr dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 8 Oct 2003 20:07:03 -0700
- Subject: 2 Projects with gcc
- Organization: NA
I am thinking about starting an open-source project that requires parsing C++.
Right now, I am not sure which project I am going to choose. I am thinking
about
a) A C++ interpreter
b) A C++ code browser that plugs into eclipse.org
After my research on parsing C++, I came to the conclusion that C++ is pretty
much "impossible" to parse using conventional techniques. ( I have never
written a lex/yacc based parser before ).
So I am thinking about how hard it would be to reuse parsing available in g++.
Here is my wishlist at this time:
I would like g++ to come with a static library---call it libcppparse.a. This
library would come with a complete API to parse a given compilation unit and
generate a tree. Some basic type of tree-walkers should also be available.
g++ itself should be linked against this library for all of its parsing
needs.
If I want to develop either of the above 2 projects, all I should have to do
is link against this library and call a few functions here and there to
perform all of my C++ parsing.
I really do not want to redo whats out there. Besides using gcc frontend is
perhaps the only way that can result in a complete robust parsing engine.
Can someone drop me a few pointers as to where one should start. Right now, I
am more interested in project a) above. I have looked into the source code
of UnderC. I am thinking about start one from scratch that would utilize gcc
frontend and a few ideas "stolen" from underC.
Are there any diehards who have already started something similar? If I could
find some examples of someone trying to do something with the g++ internal
data structures to accomplish what I am trying to do that would be great.
Salman