Error reporting bug in kdev-pg?

Andreas Pakulat apaku at gmx.de
Fri Jul 13 15:14:33 UTC 2007


On 13.07.07 17:03:14, Roberto Raggi wrote:
> Hi
> 
> Il giorno 13/lug/07, alle ore 13:32, Andreas Pakulat ha scritto:
> > So can I just do
> >
> > size_t index = token_stream->index()-1;
> > token_type& token = token_stream->token(index);
> >
> > to get "expected" error reporting? Or does that have possible bad
> > side-effects? (I personally can't see why it should, except if  
> > there's a
> > bug and it seems to work fine here)
> 
> As I said before it is not a bug. btw I don't see why you want to do  
> that. In general the standard error message (when using LL) is  
> something like
>    *** Unexpected token `foo' at (line, col).
> 
> and `foo' is the look-ahead token, so I really don't understand why  
> you want to use the last recognized token (the one at position  
> token_stream->index() - 1).

Uhm, then somethings wrong with the parser. As I said currently the
qmake parser only recognizes NEWLINE tokens, but the example file
contains no newline in the first 3 tokens. 

All I'm asking is to get an error message telling me on which token the
error occurs, not the one after that and the error occurs when the
parser expects NEWLINE but gets something different (IDENTIFIER in this
case, while it reports PLUSEQ).

I hope its clear I'm not asking for the last recognized token, I'm
asking to get the last unexpected token. 

Andreas

-- 
Beware the one behind you.




More information about the KDevelop-devel mailing list