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

Douglas Gregor dgregor at apple.com
Wed Sep 28 16:06:17 PDT 2011


On Sep 28, 2011, at 12:34 PM, Konstantin Tokarev wrote:

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

I don't see any ambiguity. Can you provide an example?

	- Doug



More information about the cfe-dev mailing list