Hello! This is a public repository of compiler design lab codes. following are the details of the creator and purpose of this repository.
Tags | Information |
---|---|
Name | Amardeep Saha |
Roll Number | 2019UGCS029R |
Branch | C.S.E. |
Subject | Compiler Design Lab |
Faculty Incharge | Dr. Bhaskar Mondal |
Institution | Indian Institute of Information Technology, Ranchi |
The codes in this repository uses Flex as lexical analyzer to convert the respective lex files into c files. The file system in this repo contains:-
- Lex file with
myfile.l
format. - Lexically analyzed
lex.yy.c
c file. - GCC compiled
a.out
file.
- Flex (the Lexical Analyzer):-
For Ubuntu (v 20.04 LTS) :-
Open terminal.
Type
sudo apt install flex
.Flex will be installed.
For Windows (10 home) :-
Go to google and search Flex.
Open the first link showing flex-GnuWin32 .
Downoload the Flex file and install it in your system (Make sure to note the PATH of the installed Flex program).
Change add a system PATH to the file directory of the installed flex program.
- C Compiler (the compiler for compiling lex.yy.c file) :-
For Ubuntu (v 20.04 LTS) :-
Open terminal.
Type
sudo apt install gcc
.Flex will be installed.
For Windows (10 home) :-
Go to google and search GNU-GCC.
Open the first link and Download the required version of the compiler.
Install the downloaded file in your system.
Check whether the GCC compiler is installed by running
gcc -version
code in cmd.
- Any code editor can be installed for writing lex programs (Notepad can also do the work).