How do I grab a branch of a tree?

Steven T. Hatton hattons at globalsymmetry.com
Sun Sep 5 01:56:10 UTC 2004


I have looked at various files in KDevelop several times in an effort to 
determine how the user's code is being parsed, and what components are 
involved in tasks such as code completion. I understand just about everything 
except how it works. :-/  

Well, it's not quite that bad, but I am having a hard time getting a grasp of 
the big picture.  Right now what I want to know is how I could get ahold of 
the AST representing a complete class loaded in KDevelop.  IOW, I want all 
the tokens that are part of a class specifier.

For my purposes, I am assuming the class and all of its members are declared 
and defined in a header, and an associated source file.  How would I obtain 
such an object?  For example, suppose I simply wanted to dump it to 
std::cerr.  It seems to me, this will actually end up being two objects. one 
from the header file, and one from the source file.

I'm also interested in knowing how the class browser for C++ is implemented.  
I will look at the  code more closely before I ask any specific questions 
about that topic.

Any suggestions as to how I might get an understanding of what it takes to 
access and manipulate the parsed representation of the code will be 
appreciated. 
-- 
Regards,
Steven




More information about the KDevelop-devel mailing list