kdev-pg: Token definitions

Roberto Raggi roberto at kdevelop.org
Wed Feb 8 17:20:11 UTC 2006


Hi Jakob!

On Tuesday 07 February 2006 23:14, Jakob Petsovits wrote:
> On Friday, 28. October 2005 21:05, Roberto Raggi wrote (on IRC):
> <roberto__> jpetso: the token is declared when it is used the first time
> <roberto__> jpetso: i see it's a problem if you already have a lexer
> <roberto__> jpetso: i can probably improve it
;-)

> Is the patch clean enough to commit?
I like the patch. please commit it. I have a tiny suggestion. Sometimes is 
very useful to associate some description to the token. For instance you may 
want to associate the string ';' to the token SEMICOLON. This is very useful 
when reporting errors. In general you want to use the token description and 
not the token id in the error message (e.g. ';' not SEMICOLON).

so how about you change a bit the patch so we can write things like
%token SEMICOLON = ";"
%token ID "identifier"
...

ciao robe




More information about the KDevelop-devel mailing list