Uploaded by Datasciene datascience

CS3501 SET4

advertisement
B.E / B.Tech. PRACTICAL END SEMESTER EXAMINATIONS, NOVEMBER/DECEMBER2023
Fifth Semester
CS3501 -COMPILER DESIGN
(Regulations 2021)
Time : 3 Hours
Aim/Principle/Apparatus
required/Procedure
20
Answer any one Question
Tabulation/Circuit/
Program/Drawing
30
Calculation
& Results
30
Max. Marks 100
Viva-Voce
Record
Total
10
10
100
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 /.
4.
Write a program to implement a Calculator using LEX and YACC.
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.
15.
Write a program to Implement any one storage allocation strategies
16.
Write a program to Implement type checking.
17.
Write a program to Implement Simple Code Optimization Techniques using Strength reduction
18.
Write a program to implement to implement the symbol table
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
Download