This repository contains programs done as part of Compiler Design Lab [CS1U48A].
Write a C program that works as a Lexical Analyzer. Run the below terminal commands from main repository location to run the code. Provide input C program in /Exp_01/inputFile.txt
cd Exp_01
gcc lexicalAnalyzer.c -o lexicalAnalyzer.out
./lexicalAnalyzer.out
Use LEX tool to implement a lexical analyzer 2.1 - Lexical Analyzer using LEX tool 2.2 - Count number of words from a set of strings 2.3 - Get number of vovels in a string
Navigate to the folder where your program is, and use the following commands to use LEX tool.
lex <filename>.l
gcc lex.yy.c -ll
./a.out
Write a C program to implement a recursive descend parser for the given language.
Write a C program to implement a shift reduce parser for any given set of productions.
Use LEX and YACC tools to check if an expression is valid or not. Use the following commands to run tools
yacc -d filename.y
lex filename.l
cc lex.yy.c y.tab.c -ll
./a.out
Use LEX and YACC tools to create a calculator
Program to create intermediate 3 address code from given expression
Program to find First and Follow of a grammar