CS3501 Set4
CS3501 Set4
(Regulations 2021)
1. Design a Lexical analyzer to recognize a few pattern in C.The lexical analyzer should ignore
redundant spaces, tabs and new lines, comments etc.
2. Implement the lexical analyzer using JLex, flex or other lexical analyzer generating tools.
3. Write a program to implement to recognize a valid arithmetic expression that uses operator +, – ,
* and /.
5. Write a Program to recognize a valid variable which starts with a letter followed by any number
of letters or digits.
6. Write a LEX Program to convert the substring abc to ABC from the given input string..
7. Write a C Program to implement NFAs that recognize identifiers, constants, and operators of the
mini language.
8. Write a C Program to implement DFAs that recognize identifiers, constants, and operators of the
mini language.
9. Write a program to Implement Simple Code Optimization Techniques using Constant Folding
10. Write a program to Implement the back end of the compiler which takes the three address code
and produces the 8086 assembly language instructions that can be assembled and run using a
8086 assembler. The target assembly instructions can be simple move, add, sub, jump. Also
simple addressing modes are used.
Page 1 of 2
11. Write a lex program to find out total number of vowels, and consonants from the given input
sting.
12. Write a program to implement to recognize a valid control structures syntax of C language using
For loop and while loop.
13. Write a program to Convert the BNF rules into Yacc form and write code to generate abstract
syntax tree.
14. Write a program to implement to recognize a valid control structures syntax of C language using
ifelse, if-else-if and switch-case.
17. Write a program to Implement Simple Code Optimization Techniques using Strength reduction
19. Write a program to Implement Simple Code Optimization Techniques using Algebraic
transformation
20. Write a program to generate three address code using LEX and YACC.
Page 2 of 2