help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upgrading from 1.35 to 1.875 breaks things...?


From: Akim Demaille
Subject: Re: Upgrading from 1.35 to 1.875 breaks things...?
Date: Sat, 01 Mar 2003 13:47:56 +0100
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2

| Hello bison users,

Hi,
 
| I just upgraded bison to 1.875 from 1.35 (cygwin/Win2k).  I had a project
| that compiled just fine, but now I get these errors in VC++:
| 
| xpath.tab.c(1286) : warning C4065: switch statement contains
|                    'default' but no 'case' labels
| 
| xpath.tab.c(1313) : warning C4065: switch statement contains
|                    'default' but no 'case' labels
| 
| xpath.tab.c(1981) : warning C4102: 'yyerrlab1' : unreferenced label
| 
| xpath.l(105) : error C2065: 'yytoknum' : undeclared identifier

Huh???

Please, first of all, use
ftp://alpha.gnu.org/gnu/bison/bison-1.875a.tar.gz.


| This is really strange to me.  I read in the Bison manual online that you
| can lookup values in the token table here:
| 
| http://www.gnu.org/manual/bison-1.35/html_node/Calling-Convention.html#Calli
| ng%20Convention
| 
|   (tiny version: http://tinyurl.com/6kpf)
| 
| 
| 
| I used this code in a function to get the token number of multicharacter
| tokens from within some of my lexer rules:
| 
| int check_token_table(char *token_buffer, int token_length)
| {
|     int i;
|     for (i = 0; i < YYNTOKENS; i++)
|     {
|         if (yytname[i] != 0
|             && yytname[i][0] == '"'
|             && (strncmp (yytname[i] + 1, token_buffer, token_length) == 0)
|             && yytname[i][token_length + 1] == '"'
|             && yytname[i][token_length + 2] == 0)
|             break;
|    }
|    return (i < YYNTOKENS) ? yytoknum[i] : -1;
| }

This code has not been checked, indeed :(


| Now it doesn't work... Can anyone suggest a workaround?  I can't just return
| i, since i != yytoknum[i], and it's the token number that I need to return
| from the lexical rules.

Could be more specific?  Like giving a simple test case, the type of
error etc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]