ASTVisitor

Andreas Pakulat apaku at gmx.de
Sat Oct 16 06:59:11 UTC 2010


On 16.10.10 00:25:11, Sven Brauch wrote:
> That indeed looks like a good idea.
> I read the parser documentation and generated an XML file out of the AST the
> parser provides; for this script http://pastie.org/1224459 , it looks like
> this: http://pastie.org/1224456
> I'd now read that into the C++ AST (this will require quite some changes in
> class structures, as the AST this parser provides is much more clear and
> detailed; for example, instead of "Identifier", it explicitly gives things
> like "FunctionDef", "Attribute" and "Name", and even tells wether the
> attribute is being written or read. Nice!). Do you think that's a bearable
> plan (PovAddict already disliked the idea of using XML for this...)?

Back when I looked at the python parser api available from inside python
scripts it didn't look like it provided sufficient information. But
maybe I didn't look deep enough. 

Also this means that you depend on a python version being installed and
hence the plugin needs to be provided for each python. Thats rather bad
IMHO, especially given that many people work on Python 2 and 3 at the
same time. One could make the python lib a pure runtime dep by
dynamically resolving the necessary API and hence allowing to easily
switch between Python versions. 

As Milian said creating an xml file from the AST and then reading that
back in is quite unecessary. Simply use the AST itself directly and
either transform it into another AST if its not directly sufficient or
just create the duchain from it.

Andreas

-- 
People are beginning to notice you.  Try dressing before you leave the house.




More information about the KDevelop-devel mailing list