[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %union problems
From: |
Philip Herron |
Subject: |
Re: %union problems |
Date: |
Fri, 15 May 2009 12:44:26 +0100 |
User-agent: |
Thunderbird 2.0.0.21 (Macintosh/20090302) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey
Varga-Háli Dániel wrote:
> I just started to get the grasp of bison and how to make it work with
> flex. I have defined a struct in the grammar file similar to this:
>
> typedef struct {
> char *mem1;
> char *mem2;
> } where_cls;
>
> The union includes it:
> %union{
> ...
> where_cls aswhere;
> }
What way are you trying to compile it i use automake, but if your
doing it manualy. I always found i have to compile it something like this:
gcc -o myparserprogramm y.tab.c lex.yy.c -ll
In the one line but its too hard to tell where to help unless you post
a little more of what your doing.
If your definiing a union that means in your flex you can use
yylval.<union element> and in your parser you need to use
%token <union element name>mytoken
Anyways i dont know if this helps but hey
- -Phil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkoNVZoACgkQAhcOgIaQQ2GBZQCfRoMuFcqM7nBOpQptI6UA/TcK
xo8An33acPCAurkdzRBjr5a923W3kokO
=FkwI
-----END PGP SIGNATURE-----