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.
They should be OK in C++, as pointers do not have non-trival con-/de-structors. The compiler needs to see a declaration of the name as a type, though, before it sees the pointer.
--
Hans Aberg
_______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison