yacc problem

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Xhargh

yacc problem

Post by Xhargh »

I had a problem while compiling cfdg in my gentoo linux environment.
The problem was giving the following error when I executed make:

Code: Select all

yacc -d -o objs/y.tab.c src-common/cfdg.y
usage: yacc [-dlrtv] [-b file_prefix] [-p symbol_prefix] filename
make: *** [objs/y.tab.c] Error 1
I solved the problem by running yacc manually:

Code: Select all

$ yacc -d src-common/cfdg.y
and then I moved the results to objs:

Code: Select all

$ mv y.tab.* objs/
When I restarted make, the compilation finished and cfdg worked fine :D

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

We are using bison, not yacc:

Code: Select all

$ yacc -V
bison (GNU Bison) 1.875b
Written by Robert Corbett and Richard Stallman.
That may be the source of the problem. Can you uninstall yacc and install bison?

Xhargh

Post by Xhargh »

Well, since I solved the problem, I do not need to install bison instead of yacc...

However, it is stated in the download page that:
Download the source code and build using make. You'll need a c++ compiler, flex (not lex), yacc (bison works too) and the libpng graphics library. Most of this should be installed or easily available on any modern operating system distribution. See the README.txt file in the source for build and run instructions.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

We should change that note. Yacc is a mess. There are many variants with different options and capabilities. The makefile works for Bison and may work for some versions of yacc, but it may not.

Post Reply