ASTVisitor

Sven Brauch svenbrauch at googlemail.com
Fri Oct 15 22:25:11 UTC 2010


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...)?

Best regards,
Sven

2010/10/15 Sven Brauch <svenbrauch at googlemail.com>

> Thanks for your answers.
> Hmm, actually that would definitely make sense, less code to maintain, and
> it'd probably be faster, too... I'll have a look at that before I try to fix
> the other problem (there's several others, too, and some of them would
> probably take much debugging work)...
>
> Best regards,
> Sven
>
> 2010/10/15 Aleix Pol <aleixpol at kde.org>
>
> On Fri, Oct 15, 2010 at 6:11 PM, Sven Brauch <svenbrauch at googlemail.com>wrote:
>>
>>> Hey!
>>>
>>> I'm using kdevelop-pg-qt to generate a parser for python. In
>>> astvisitor.cpp (
>>> http://github.com/scummos/kdevelop-python/blob/master/parser/astvisitor.cpp),
>>> although the type of the AST is definitely BooleanNotOperation, it steps
>>> into visitBooleanAndOperation for code like "if not foo: pass" and then
>>> segfaults. Can anyone tell me why it steps into visitBooleanAndOperation and
>>> not into visitBooleanNotOperation? I really can't figure that out...
>>>
>>> Thanks,
>>> Sven
>>>
>>> --
>>>
>>> KDevelop-devel mailing list
>>> KDevelop-devel at kdevelop.org
>>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>>>
>>>
>> Are you sure you can't use the parser provided by libpython?
>>
>> That would make sense...
>>
>> --
>> KDevelop-devel mailing list
>> KDevelop-devel at kdevelop.org
>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101016/05eb95e7/attachment.html>


More information about the KDevelop-devel mailing list