LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-19-2002, 08:35 AM   #1
Config
Member
 
Registered: Jan 2001
Location: Switzerland
Distribution: Gentoo
Posts: 376

Rep: Reputation: 30
yacc, Bison


I wanted to compile some Software (doesn't really matter what it was). Then, the make reported: yacc: command not found. I figured that this is some sort of a language and i figured that I had to download Bison. But now what all are all these programs? If the make reports, that it is looking for yacc, why shouldn't I install it rather than Bison?
Some sites told me, if I am using Linux, I have yacc. But on my machine (Mandrake 8.1), i don't seem to have it.
Thank you for helping
 
Old 02-19-2002, 09:59 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Well it used to be lex and yacc but they kinda got outdated so now they have been replaced be flex and bison. Some programs still look for the older versions though. The easiest ways around it is to create two scripts which call the newer programs.

Create yacc by typing the following as root in a terminal:

cat > /usr/bin/yacc << "EOF"
#!/bin/sh
# Begin /usr/bin/yacc

exec /usr/bin/bison -y "$@"

# End /usr/bin/yacc
EOF
chmod 755 /usr/bin/yacc


Do the same for lex:

cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Begin /usr/bin/lex

exec /usr/bin/flex -l "$@"

# End /usr/bin/lex
EOF
chmod 755 /usr/bin/lex
 
Old 02-19-2002, 10:18 AM   #3
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
There is a version of both lex and yacc for Linux. Most GNU based software use flex and Bison. Be careful trying to use one for the other because the program options are not the same. In SuSE, these programs are in the development section.
 
Old 02-19-2002, 10:35 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I thought passing the -y to bison solved all the problems of things not being the same. It says in the helpfiles that a shell script with bison -y $* can substitute yacc. Would there be any other reasons why that would not be enough. I have those scripts on several machines and never had any problems. But maybe that's because most of them all use bison instead of yacc anyways.
 
Old 02-19-2002, 10:42 AM   #5
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
The -y does work for the switches. Senior moment; forgot that guy.
 
Old 02-21-2002, 01:50 PM   #6
Config
Member
 
Registered: Jan 2001
Location: Switzerland
Distribution: Gentoo
Posts: 376

Original Poster
Rep: Reputation: 30
Great, this script worked.
Just one point... The lines with the # at the beginning are comments? If so, they wouldn't be required.
 
Old 02-21-2002, 03:18 PM   #7
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Yes the # symbol is for comments.
They are not required if you want all you'd have to put in the script is the exec line.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bison and Yacc Compatibility Problem oulevon Programming 1 10-23-2005 11:56 PM
bison / flex zaman Programming 1 08-16-2005 11:19 AM
thunderbird and bison? bkz81 Linux - Newbie 3 08-11-2005 01:41 PM
Having problems with BISON dogbird Linux - Software 0 05-26-2005 12:17 AM
need to find bison bicjoe Linux - Newbie 3 07-11-2003 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration