This repo contains Lex & Yacc code for lab practicals
1. Procedure step by step for windows :
If you are installing Ubuntu (or any Linux based OS) on your system either through Virtual Box or by making your system Multi-Bootable, just to execute your Lex & Yacc programs; then you might be wasting your HDD space & your valuable time. You can easily skip this annoying process and run your programs in Windows OS without any hassles.
Here’s how you can do it:
2. Installing Softwares :
- Download Flex 2.5.4a
- Download Bison 2.4.1
- Install Flex at “C:\GnuWin32“
- Install Bison at “C:\GnuWin32“
- Open Environment Variables.
- Add “C:\GnuWin32\bin
3. Compilation & Execution of your Program :
Open Command prompt and switch to your working directory where you have stored your lex file (“.l“) and yacc file (“.y“) Let your lex and yacc files be “hello.l” and “hello.y“. Now, follow the preceding steps to compile and run your program.
For Compiling Lex file only :
flex hello.l
gcc lex.yy.c
For Compiling Lex & Yacc file both :
flex hello.l
bison -dy hello.y
gcc lex.yy.c y.tab.c
For Executing the Program
a.exe
IMPORTANT
- How to run Lex and Yacc file in windows using flex & Bison
- How to compile LEX/YACC files on Windows?
- Most Important Link
- BEST MATERIAL TO LEARN - when using LEX first time (Theory Part)
- BEST MATERIAL TO LEARN - when using YACC first time (Theory Part)
- Introduction to LEX & pattern matches on gfg
- Introduction of Yacc
- Lex program to take input from file and remove multiple spaces, lines and tabs
DO PROGRAMS TO UNDERSTAND MORE :
REPOS Link :