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: Hans Aberg
Subject: Re: %union errors that shouldn't be there
Date: Mon, 21 Mar 2005 19:16:33 +0100

It looks as though the C++ compiler does not see the declaration of the types astNode, string (is it std::string?), nodeList, before it sees the union that the parser implements. So, you have to make sure that info is included somewhere, perhaps in the %{ ... %} segment before the %union in the .y file.

At 16:57 -0500 2005/03/20, DYP wrote:
Hello,

My %union is declared in the following way and does have the proper
header file included but I still get errors that should not be there.

%union{
             float fconst;
             int type;
             astNode* node;
             string* name;
             nodeList* list;
       }

Here are the errors that I get when trying to compile the bison
generated file

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

I just don't see what I am doing wrong.

Your help is appreciated.




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


--
  Hans Aberg




reply via email to

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