%type'd non-terminal produces a `has no declared type' error

2009-01-20 Thread Alexander Sorockin
Hi, Has anyone besides me noticed that $n with n zero or negative always triggers a "$n ... has no declared type" error when a %union is used? Cosider this grammar, which is a slightly modified example from the manual: %union { int val; } %token NUM %start foo %% foo :

Re: %type'd non-terminal produces a `has no declared type' error

2009-01-22 Thread Alexander Sorockin
Akim, Excuse me for reposting this - I just realized that I didn't sent this message to the mailing list. And it's normal: since you are looking deep in the stack, Bison cannot figure out (in the general case) what the kind of symbol is there. So it can't guess the field of the union i