From: Robin Stocker Date: 2006-04-03T01:31:27+09:00 Subject: Re: [PATCH] parse.y: literal strings for tokens ts wrote: > Well, with a very, very old yacc (Sun) Ah, parse.y has to be compatible with Yacc implementations other than Bison, then I misunderstood Matz' question - I'm sorry. > nasun% cat a.y > %token DIGIT "digit" > %% > number : DIGIT > %% > nasun% > > nasun% yacc -V a.y > yacc: Software Generation Utilities (SGU) Solaris-ELF (4.0) > nasun% > > nasun% more y.tab.c > [...] > yytoktype yytoks[] = > { > "DIGIT", 257, > "digit", 258, > "-unknown-", -1 /* ends search */ > }; > > [...] > nasun% > > If i'm right this mean that it see 2 tokens I agree, it doesn't seem to work. Could you try this Yacc version on the non-patched parse.y and see if it works there? So, if it has to be compatible with old Yacc versions, would it be acceptable to surround the token descriptions with #ifndef OLD_YACC ? (Hm, I see OLD_YACC used in parse.y but I can't find its definition, is it defined automatically by autoconf or something like that?) Robin Stocker