LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-09-2012, 12:04 PM   #1
shambhavi
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:
Code:
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
Rupadhya
Member
 
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.

Code:
step 1: For installing lex and yacc
yum install flex bison
or,
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
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
lex will call flex with -l option and maybe giving this output. Try:
Code:
$ flex filename.l
 
Old 10-10-2012, 09:51 AM   #4
shambhavi
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
Code:
unrecognised error

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

Original Poster
Rep: Reputation: Disabled
Quote:
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
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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.
 
  


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 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 08:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration