Re: [Ctool-develop] using ctool as a library
Brought to you by:
flisakow
From: Shaun F. <fli...@so...> - 2003-07-31 19:25:51
|
Stefan, The best example to look at is probably the code that prints out the AST. This starts at: operator<<(std::ostream& out, const TransUnit& tu) in project.cpp Each translation unit is composed of a list of statements, an hierarchy of C++ classes for each type (for, while, expression, etc). Each of the statements has members in it that give pointers to the expressions it uses, or in some cases, the statement required. Most of the members of the AST are public, you can just reach in and grab what you need. Thanks, Shaun On Thursday, July 31, 2003, at 10:06 AM, Stefan Seefeld wrote: > hi there, > > I'm looking into ctool in an attempt to figure out whether > I could use it as a C parser backend for another introspection > tool I'm working on (http://synopsis.sf.net). Synopsis uses > an abstract syntax tree (AST) internally, which is generated > from parser modules. Right now we have parser modules for C++, > python, and IDL. Adding C to the list would be quite a win. > > I couldn't figure out yet how to traverse the syntax tree > the ctool internally generates. I'd be grateful for any > hints. Thanks, > Stefan > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/ > direct;at.aspnet_072303_01/01 > _______________________________________________ > Ctool-develop mailing list > Cto...@li... > https://lists.sourceforge.net/lists/listinfo/ctool-develop > |