Install LEX & YACC packages on Linux[Ubuntu]
Follow the below Terminal Commands
-
sudo apt-get update
-
sudo apt-get install flex
-
sudo apt-get install bison
-
sudo apt-get install byacc
-
sudo apt-get install bison++
Cross platform source code.
In windows you need gcc compiler or any IDE such as Visual Studio, etc..
flex file_name.l
After the successful compilation of the lex program the lex.yy.c file is generated automatically
- To Run Lex Program :
gcc lex.yy.c
After the successful Run of the lex program the a.exe file is generated automatically
- To see the output of Lex program type
a.exe
bison –d filename.y
- After the successful compilation of the yacc program the 2 files is generated automatically namely
1 file_name.tab.c and
2 file name.tab.h
Rename that 2 files to y.tab.c and y.tab.h
- To Run Lex and Yacc Program :
gcc lex.yy.c y.tab.c
After the successful Run of the lex and Yacc program the a.exe file is generated automatically
- To see the output of Lex and Yacc program type
a.exe in the command prompt
- "Installation and Full Setup on YouTube" - Computer Science Geeks
Made with
by Ashish Vajpayee