Question Paper Code : 40926
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2024.
Fifth Semester
Computer Science and Engineering
CS 3501 — COMPILER DESIGN
(Common to : )
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
State the term interpreter.
- 2.
Write the major task of lexical analyzer.
- 3.
Mention the role of parser.
- 4.
Specify the error recovery in YAAC.
- 5.
Express the construction of syntax tree.
- 6.
Source-language expression is x + y * z and translate it into the sequence of three-address code instructions.
- 7.
Differentiate between static and dynamic storage allocation.
- 8.
Define flowgraph.
- 9.
Identify the causes of redundancy.
- 10.
Write the principal sources of optimization.
PART B — (5 × 13 = 65 marks)
- 11.(a)
Draw the phases of compiler and describe each phase of it.
- Or
- (b)
Define finite automata. Explain the two types of finite automata with suitable example.
- 12.(a)
Construct a parse tree for the input string starting from the root and creating the nodes of the parse tree in preorder using top-down parsing.
- Or
- (b)
Write the error handling process and recovery in syntax analyzer.
- 13.(a)
Summarize how to construct syntax trees for simple expressions.
- Or
- (b)
Discuss about the things behind type checking in intermediate code generation.
- 14.(a)
With neat diagram illustrate typical subdivision of run-time memory into code and data areas.
- Or
- (b)
Elaborate the issues in the designing of a code generator.
- 15.(a)
State and explain peephole optimization as an effective technique to improve the locally target code.
- Or
- (b)
Write short notes on optimization of basic blocks using Directed Acyclic Graph (DAG).
PART C — (1 × 15 = 15 marks)
- 16.(a)
"A Syntax-Directed Definition (SDD) is a context-free grammar together with attributes and rules". - Justify the statement.
- Or
- (b)
Write a review on the "recent trends in compiler design".