LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Lex and YACC on fedora 17 (http://www.linuxquestions.org/questions/programming-9/lex-and-yacc-on-fedora-17-a-4175431357/)

shambhavi 10-09-2012 12:04 PM

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....

Rupadhya 10-09-2012 09:30 PM

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

Reuti 10-10-2012 09:41 AM

lex will call flex with -l option and maybe giving this output. Try:
Code:

$ flex filename.l

shambhavi 10-10-2012 09:51 AM

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

shambhavi 10-10-2012 09:59 AM

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.

theNbomr 10-11-2012 10:09 AM

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.


All times are GMT -5. The time now is 06:08 AM.