Thanks! That seems to have fixed the problem.

-Brad

Joel E. Denny wrote:
On Sat, 21 Nov 2009, brad wrote:

I have a Bison grammar that I've been working on for a while now, and I never
had this problem until I recently upgraded Ubuntu. Now when I try to run the
grammar through Bison I get loads of "$1 of 'whatever' has no declared type"
errors. Has something recently changed in Bison that breaks old grammars?

You can see my grammar here:
http://gk3tools.svn.sourceforge.net/viewvc/gk3tools/trunk/sheep/sheepParser.y?revision=232&view=markup

I haven't taken the time to try out your grammar, but I took a quick glance and spotted a problem that's been reported before.

You have this:

  #define YYSTYPE SheepCodeTreeNode*

When you set YYSTYPE to a single type as above, then it doesn't make sense to declare semantic types, which are fields of a union YYSTYPE. However, you have this:

%token <id> IDENTIFIER <id> LOCALIDENTIFIER <intVal> INTEGER <floatVal> FLOAT <stringVal> STRING

Bison 2.3 ignored this. Bison 2.3a and later logically assume you want a union when you use a <...> construct. Moreover, POSIX requires the corrected behavior as discussed in the NEWS entry for Bison 2.3a.

You should remove the redundant <...> constructs.




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to