Error reporting bug in kdev-pg?

Andreas Pakulat apaku at gmx.de
Fri Jul 13 16:42:53 UTC 2007


On 13.07.07 17:35:26, Roberto Raggi wrote:
> 
> Il giorno 13/lug/07, alle ore 17:14, Andreas Pakulat ha scritto:
> > 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.
> 
> oops! I see. The problem is the token_stream's next_token()
> 
>    inline int kdev_pg_token_stream::next_token() {
>      return _M_token_buffer[_M_index++].kind;
>    }
> 
> see? _M_index points to the next token and not to the look-ahead.  
> This is so unintuitive! I hate myself ;-)

At least its easy to spot with simple grammars :)

> well, add a function (e.g.  yytoken_index() or something like that) to
> kdev_pg_token_stream. The  function should return `0' if _M_index is
> `0'  and _M_index - 1 when  _M_index is valid.

Ok, will do so.

Andreas

-- 
You have a reputation for being thoroughly reliable and trustworthy.
A pity that it's totally undeserved.




More information about the KDevelop-devel mailing list