[Qt-creator] ASTVisitor callback

Marek Jasovsky jasovsky.marek at gmail.com
Thu Jan 8 02:30:19 CET 2009


Hi Roberto

yesterday we discussed custom checkers, that work with the AST, and the
fact, they MUST be called before translation unit is released.

my first attempt to change this code with 3 more signals, emitted from
CppPreprocessor::sourceNeeded after calls m_currentDoc-> setSource, parse,
check failed, as signals were intercepted kind of asynchronously and in
reality well after TU has been released.

you might have a proposal in your head, I just wanted to suggest mine and
ask, if you could commit this mine, if you liked it.

1. have abstract class for custom visitors, as interface.
2. after getting instance of CppModelManagerInterface *m_modelManager from
plugin manager I would call
VisitorInterface *ptr = new MyVisitor()
m_modelManager->registerASTCallback(ptr)

after calling m_currentDoc->check() code would call

if (visitorInterfaces)
for each interface
 ptr->processAST(ast);

and this would call my class/method directly.

this is just an idea and I have not implemented it yet locally.

what do you say to this? could you consider commiting this change, or better
implement it yourself when you have time for this?

Grazie mile

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090108/76b0f759/attachment.html 


More information about the Qt-creator-old mailing list