C++ dont allow unions containing c++ classes
On May 22, 2009, at 8:11 PM, Paritosh Aggarwal wrote:
/*JIT PARSER BISON FILE*/
%{
#include
#include "heading.h"
using namespace std;
int yyerror(char *s);
int yylex(void);
%}
%union
{
pair* it;
int val;
}
compiling this
Tommy Nordgren ha scritto:
C++ dont allow unions containing c++ classes
I think you're wrong. The size of a pointer is always known at compile
time, pair* it; is a pointer and not an object. The
size is 4 bytes using a 32 bit OS. Bison union is a standard union, you
can put any type inside.
OOPS! I did not notice that the declaration was a pointer.
On May 24, 2009, at 4:13 PM, Luca wrote:
Tommy Nordgren ha scritto:
C++ dont allow unions containing c++ classes
I think you're wrong. The size of a pointer is always known at
compile time, pair* it; is a pointer and not an
object
On 24 May 2009, at 16:13, Luca wrote:
C++ dont allow unions containing c++ classes
I think you're wrong. The size of a pointer is always known at
compile time, pair* it; is a pointer and not an
object. The size is 4 bytes using a 32 bit OS.
The problem is what the C++ standard really def
On 22 May 2009, at 20:11, Paritosh Aggarwal wrote:
/*JIT PARSER BISON FILE*/
%{
#include
#include "heading.h"
using namespace std;
int yyerror(char *s);
int yylex(void);
%}
%union
{
pair* it;
int val;
}
compiling this gives the following error: jitparser.y:15: error: