[Top][All Lists]

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

Bison, G++, and M4

From: pendell
Subject: Bison, G++, and M4
Date: 3 Oct 2007 15:53:13 -0700
User-agent: G2/1.0

Hullo. I was re-directed here from comp.lang.c++

So I've just installed Fedora core 7 fresh from my machine. It comes
with G++, and bison installed directly.
So I try to make a program that uses bison. C++ chokes with the
error: error: expected constructor, destructor, or type
conversion before '(' token
Looking at the first line of, I find the following:
b4_copyright(Skeleton parser CASA Grammar Parsing with Bison,
1984, 1989, 1990, 2000, 2001, 2002)
Commenting this line out, the error goes away.
So just comment it out and go merrily on my way, right? Nope! There
are several uses of macros very like this one, in very hard-to-reach
places in the code. Far better just to get the macros working in the
first place.
Macros -- right. Looking around, I found that these are m4 macros
(used with the m4 preprocessor) define in /usr/share/bison/c.m4 .
I think what is *supposed* to happen is that somehow, somewhere, the
m4 processor is  supposed to run,
replacing these macros with
standard code, which is then properly compiled.  I already know it is
not being
called by g++.  Where, then?

For some reason m4 is not replacing the macro calls. Either
it doesn't know where the macros are, or the macros are mis-defined
and being rejected, or m4 is not being called at all.  Since these are
standard Bison definitions which
I have not touched, I find that second prospect highly unlikely.

Suggestions? Insight? If you don't know, where would I ask to find
Brian P.

reply via email to

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