-   Programming (
-   -   Lex and YACC on fedora 17 (

shambhavi 10-09-2012 01:04 PM

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

Rupadhya 10-09-2012 10:30 PM

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

Reuti 10-10-2012 10:41 AM

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

$ flex filename.l

shambhavi 10-10-2012 10: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

unrecognised error

shambhavi 10-10-2012 10:59 AM


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 11: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:37 AM.