CDDD

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Om Sakthi

Adhiparasakthi Engineering College


Melmaruvathur – 603 319
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Academic Year - EVEN (2022 - 2023)
Model Examination
CS3452 – THEORY OF COMPUTATION
Regulation 2021
Year & SEM: II CSE & IV Max. Marks: 100
Date: 18.05.2023 Time: 12.50 pm to 3.50 pm
Part – A (10 X 2 = 20 Marks) (Answer ALL Questions)
Q. No Questions BTL CO
1. What are the two parts of compilation? BTL1 CO1
2. Define cross compiler. BTL1 CO1
3. BTL2 CO2
Compare SLR, LALR and LR parses.
4. Differentiate tokens, patterns, lexeme. BTL1 CO2
5. Define DAG.Give an example.. BTL2 CO3
6. Define backpatching. BTL1 CO3
7. BTL6 CO4
8. BTL5 CO4
9. Draw the DAG for the statement a=(a*b+c)-(a*b+c) BTL1 CO5
10. Mention the characteristics of peep hole optimization? BTL4 CO5
Part – B (5 X 13 = 65 Marks)
Q. No Questions BTL CO
11. a) Explain detail about the various phases of compiler with an example trace the
BTL1 CO1
example position= initial +rate*60
OR
11. b) (i)Write short notes on compiler construction tool(6)
(ii)Explain the various error encountered in different phases of compiler(5) BTL1 CO1
(ii)Describe in detail about cousins of the compiler(4)
12. a) Consider the grammar. E -> E + T
E -> T
T -> T * F T -> F
BTL3 CO2
F -> (E) / id
Construct an LR parsing table for the above grammar. Give the moves of the LR
parser on id * id + id
OR
12.b) Construct a predictive parsing table for BTL1 CO2
the grammar E -> E + T / F
T -> T * F / F BTL 1 CO2

F -> (E) / id
13. a) BTL5 CO3

BTL6 CO3
OR
13.b) BTL6 CO3
14. a) BTL6 CO4
OR
14.b) BTL6 CO4
OR

15.b) Explain in detail about optimization of basic block BTL6 CO5


Part – C (1 X 15 = 15 Marks)
Q. No Questions BTL CO
16.a) Give the LALR parsing table for the grammar.
S -> L = R / R
BTL1 CO1
L -> * R / id
R -> L
OR
16.b) BTL6 CO3

BTL 6 CO4

"Trust yourself. You know more than you think you do."

You might also like