languages/cpp/parser: lexer error

Marek Jasovsky jasovsky.marek at gmail.com
Tue Aug 26 07:09:05 UTC 2008


2008/8/26, Hamish Rodda <rodda at kde.org>:
> Hi Marek,
>
> On Tuesday 26 August 2008 02:40:22 Marek Jasovsky wrote:
>> Hi
>>
>> I found this weird behavior in cpp lexer in kdev4 while struggling to
>> learn something about  duchain.
>>
>> in kdevplatform/plugins/duchainviewer/duchainmodel.cpp
>>
>> QModelIndex DUChainModel::index(int row, int column, const QModelIndex
>> & parent) const // line 147
>> { //line 148
>>                                                            #
>>
>> # if (row < 0 || column < 0 || column > 0 || !m_chain) //line 149
>>     return QModelIndex(); //line 150
>>
>> kdev4 problems view gives me  2 errors marked with # above the line...
>> (3rd zero and last closing brace, but code gets compiled without
>> errors.
>>
>> first: Expected token ')' after '>' found 'number_literal' (Lexer)
>> 2nd: Unexpected token ')'
>
> This is a known issue, it's because there is an ambiguity in c++, that there
> _could_ be a template class called "column" with the arguments inside the
> <>.
>
> I emailed Roberto about it a while back but his suggestions are technically
> difficult at the moment, it will need more thinking about before we can
> properly fix it.

is your mail to roberto in the mailing list, or it was just personal?
I am also very interested in parsers so I am curious, what was
Roberto's solution

> Cheers,
> Hamish.
>
> _______________________________________________
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>




More information about the KDevelop-devel mailing list