[cfe-dev] Proposal: parsing Qt signals/slots with attributes

Konstantin Tokarev annulen at yandex.ru
Wed Sep 28 12:34:45 PDT 2011


28.09.2011, 21:50, "Douglas Gregor":
> Alright, since there haven't been enough crazy ideas today… I think we should consider defining 'signals'  and 'slots'  as context-sensitive keywords, rather than handling these as attributes on the access specifier. The grammar is fairly simple, and one need only look ahead a single token (to the ':') to determine whether we have the signals or slots keyword (vs. using it as an identifier). It shouldn't be much more work than threading attributes through the access specifiers like you've already done.
>
> IMO, the end result would be much cleaner than having to #define signals and slots (#define'ing Q_SIGNAL, Q_SLOT, etc. is fine by me), and has the added benefit of  helping resolve my longstanding grudge with Qt :)
>
>   http://www.boost.org/doc/libs/1_47_0/doc/html/signals/s04.html#id2861476

It seems to me as there is a danger of keyword misinterpretation in non-QObject contexts.

-- 
Regards,
Konstantin



More information about the cfe-dev mailing list