CS3501 – COMPILER DESIGN LAB
LIST OF EXPERIMENTS:
1. Using the LEX tool, Develop a lexical analyzer to recognize a few patterns in
C. (Ex. identifiers, constants, comments, operators etc.). Create a symbol table,
while recognizing identifiers.
2. Implement a Lexical Analyzer using LEX Tool
3. Generate YACC specification for a few syntactic categories.
a. Program to recognize a valid arithmetic expression that uses operator +, -, *
and /.
b. Program to recognize a valid variable which starts with a letter followed by
any number of letters or digits.
c. Program to recognize a valid control structures syntax of C language (For
loop, while loop, if-else, if-else-if, switch-case, etc.).
d. Implementation of calculator using LEX and YACC
4. Generate three address code for a simple program using LEX and YACC.
5. Implement type checking using Lex and Yacc.
6. Implement simple code optimization techniques (Constant folding, Strength
reduction and Algebraic transformation)
7. Implement back-end of the compiler for which the three address code is given
as input and the 8086 assembly language code is produced as output.