Skip to content

AshishVajpayee/VTU-Computer-Science-6th-sem-SSC-LAB

Repository files navigation

Hello, folks!

visitors

VTU 18CSL66 System Software Lab Programs 6th Sem

Prerequisites

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

To Compile Lex Program:

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 

To Compile Yacc program :

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

Tutorials

Made with heart by Ashish Vajpayee