help-bison
[Top][All Lists]
Advanced

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

Re: %union errors that shouldn't be there


From: Laurence Finston
Subject: Re: %union errors that shouldn't be there
Date: Mon, 21 Mar 2005 11:55:23 +0100 (MET)

On Sun, 20 Mar 2005, DYP wrote:

> In file included from misery.ll:30:
> gram.yy:26: error: ISO C++ forbids declaration of `astNode' with no type
> gram.yy:26: error: expected `;' before '*' token
> gram.yy:27: error: ISO C++ forbids declaration of `string' with no type
> gram.yy:27: error: expected `;' before '*' token
> gram.yy:28: error: ISO C++ forbids declaration of `nodeList' with no
> type
> gram.yy:28: error: expected `;' before '*' token
>

Apparently, your types `astNode', `string', and `nodeList' are undefined
when your `%union' declaration is being compiled.  Assuming you're using
C, My guess is that you're not including the header file or files that
declare them in your parser input file.  On the other hand, if you're
using C++, it might be because these are types that can't be included in
`unions'.  I don't remember the rule off-hand --- it has something to do
with constructors and/or destructors.  I don't know whether this
programming error would cause this particular compiler error to be
signalled, though, and I don't have time to test this myself at the
moment.

Laurence Finston




reply via email to

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