help-bison
[Top][All Lists]
Advanced

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

Re: $1 of 'whatever' has no declared type


From: brad
Subject: Re: $1 of 'whatever' has no declared type
Date: Sat, 21 Nov 2009 15:52:46 -0600
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

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.






reply via email to

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