help-bison
[Top][All Lists]
Advanced

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

Problem in using bison where the files are for legacy yacc


From: Hai-Lian Yang
Subject: Problem in using bison where the files are for legacy yacc
Date: Tue, 27 May 2008 09:53:43 -0700


On Leopard, yacc is a wrapper for bison. In our product source, we need to
run yacc on the grammar file, and use m4 on the y.tab.c generated by yacc.
This works on Tiger, but fails on Leopard.

Our build steps are
1. yacc -d -t -v gram.y
   It created y.tab.h and y.tab.c.

2. Run macro processor m4 on y.tab.c as:

   m4 -s yygram.m4 y.tab.c > gram.c

   m4 gives error "m4:y.tab.c:4607: ERROR: end of file in string".
   There is no error on Tiger.

File yygram.m4 contains one line:
define(`printf',`do_trace(DBG_HEAVY|COMP_PARSER, $*)')

ADC support suggested to add the following line to yydebug.m4:

changecom(`/*', `*/')

Adding this line resolves the error on Leopard. However, our product source
files are used across many Unix platforms. When I try the suggestion on
Solaris, I found that it doesn't generate a correct gram.c file. For an
example, the word "include" is removed from the header include code, like:

# <stdio.h>
# <stdlib.h>

Is this an incompatibility issue in bison with yacc? If I need to use yacc
where can I get it?

Thanks,
Hai-Lian Yang
address@hidden

reply via email to

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