07.07.2011, 17:57, [email protected]: > On Jul 7, 2011, at 15:22, ext Konstantin Tokarev wrote: > >> 07.07.2011, 17:16, [email protected]: >>> My current implementation idea is to redefine Q_SLOT, slots, signals, and >>> Q_SIGNAL to expand to an __attribute__, pick that up in the parser, and >>> annotate the AST. >> How do you redefine slots and signals? They apply to several methods so >> simple macro substitution won't work. > > Yes, that why those two are the most "exciting" macros. So the quick > description is to use a custom qobjectdefs.h containing: > > #define signals protected __attribute__((q_signal)) > #define slots __attribute__((q_slot)) > > Then in lib/Parse/ParseDeclCXX.cpp (in Clang (!)) store the trailing > attributes in the AST node, and during code-completion, check for those > attributes.
There are some problems with this approach. 1. I don't know if any compiler allows __attribute__ on access specifier . 2. Clang assumes that anything in AST has its representation in source code. You are creating "phantom" attributes which don't exist in actual code. BTW, haven't you considered creation of custom AST nodes (i.e., subclass CXXRecordDecl) with additional fields? -- Regards, Konstantin _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-creator
