Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-09-2012, 12:04 PM   #1
LQ Newbie
Registered: Sep 2012
Location: india
Posts: 11

Rep: Reputation: Disabled
Lex and YACC on fedora 17

Im trying to execute a lex program.But, when i compiled it using the code below:
lex filename.l
It is not accepting yylex().For that line it is showing error as 'unrecognised rule'.Help me please....
Old 10-09-2012, 09:30 PM   #2
Registered: Sep 2012
Location: Hoffman Estates, IL
Distribution: Fedora 20
Posts: 167

Rep: Reputation: Disabled
I haven't tried this but here is an answer.

step 1: For installing lex and yacc
yum install flex bison
yum install flex
yum install byacc
[if  "yacc -d filename.y" doesn't work try" bison filename.y"]
step 2: For installing c compiler
yum install gcc
Good Luck!
- Raj
Old 10-10-2012, 09:41 AM   #3
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,326

Rep: Reputation: 253Reputation: 253Reputation: 253
lex will call flex with -l option and maybe giving this output. Try:
$ flex filename.l
Old 10-10-2012, 09:51 AM   #4
LQ Newbie
Registered: Sep 2012
Location: india
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for your help Rupadhya.It worked well with yacc.But for lex programs,It is again showing error in the line yylex() as
unrecognised error

Last edited by shambhavi; 10-10-2012 at 09:53 AM.
Old 10-10-2012, 09:59 AM   #5
LQ Newbie
Registered: Sep 2012
Location: india
Posts: 11

Original Poster
Rep: Reputation: Disabled
Originally Posted by reuti
lex will call -l option and may be giving this output
Thanks for your help.I tried it.It is not working.
Old 10-11-2012, 10:09 AM   #6
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It sounds like the real error is in the syntax of your lex source file. Please reduce it to the least amount of code that still reproduces the problem, and post it here (use [CODE][/CODE] tags to preserve formatting).
--- rod.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Lex and YACC on fedora 17 shambhavi Programming 4 10-09-2012 12:07 PM
[SOLVED] lex and yacc rit Programming 9 08-22-2012 09:11 AM
lex and yacc aarsh Linux - Software 3 01-03-2011 08:58 AM
LEX and YACC with C gr33ndata Programming 4 11-18-2007 05:12 PM
usage of lex and yacc in fedora core 4 rameshsena Linux - Software 2 09-02-2005 03:53 AM

All times are GMT -5. The time now is 06:44 PM.

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