This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

2 Projects with gcc

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 

a)  A C++ interpreter

b)  A C++ code browser that plugs into

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 

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]