help-bison
[Top][All Lists]
Advanced

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

Re: %union with STL


From: Tommy Nordgren
Subject: Re: %union with STL
Date: Sun, 24 May 2009 14:28:03 +0200

C++ dont allow unions containing c++ classes
On May 22, 2009, at 8:11 PM, Paritosh Aggarwal wrote:

/*JIT PARSER BISON FILE*/

%{
#include<map>
#include "heading.h"

using namespace std;

int yyerror(char *s);
int yylex(void);
%}

%union
{
   pair<const string,int>* it;
   int val;
}

................


compiling this gives the following error: jitparser.y:15: error: ISO C++
forbids declaration of ‘pair’ with no type
jitparser.y:15: error: expected ‘;’ before ‘<’ token
I want to include a pointer to an STL map entry, and
map<parameters>::iterator gives a similar error. Is there any way to
accomplish this.

BTW - removing the "const" before string removes this error, but iterator is
pointer to a pair<const string, int> type.
_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison

----------------------------------
The three things an undertaker should never say to a client:
-Nice doing business with you.
-Welcome back.
-Have a nice day. (The King of ID)
----------------------------------
Tommy Nordgren
address@hidden







reply via email to

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