JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III COMPILER DESIGN Previous Question Paper (February - 2023 - R16)
Note: i) Question paper consists of Part A, Part B.
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Define linker and loader.
Answer
A linker is a system program that takes one or more object files generated by a compiler or assembler and combines them into a single executable file by resolving references to external symbols and library functions. A loader is a part of the operating system that takes the executable file from the disk, places it into the main memory (RAM), and prepares it for execution by setting up the necessary registers and memory addresses.
Write a short note on regular expression.
Answer
A regular expression is a formal notation used to define and represent the set of strings that constitute a regular language. It provides a declarative way to describe patterns in strings, which are essential for specifying the lexical structure of programming languages, such as identifiers, constants, and keywords.
Regular expressions are constructed using three fundamental operations:
- Union: The union of two regular expressions r and s, denoted as r|s, represents the set of strings in either r or s.
- Concatenation: The concatenation of r and s, denoted as rs, represents the set of strings formed by taking a string from r followed by a string from s.
- Kleene Closure: The closure of r, denoted as r*, represents the set of strings formed by concatenating r zero or more times.
These expressions serve as the input for lexical analyzers, which use them to generate finite automata that perform pattern matching during the scanning phase of compilation.
Explain context free grammar.
Answer
Sign in to view the complete answer paper.
Compute FIRSTs and FOLLOWs for the following grammar
Answer
Sign in to view the complete answer paper.
What are the evaluation orders for syntax directed definitions?
Answer
Sign in to view the complete answer paper.
Explain the variants of syntax trees.
Answer
Sign in to view the complete answer paper.
What is trace based collection?
Answer
Sign in to view the complete answer paper.
Explain the addresses in the target code.
Answer
Sign in to view the complete answer paper.
Define strength reduction.
Answer
Sign in to view the complete answer paper.
Discuss about common sub expression elimination.
Answer
Sign in to view the complete answer paper.
Part B
Define compiler. Explain various phases of compiler with neat sketch.
Answer
Sign in to view the complete answer paper.
Explain various error recovery strategies in lexical analysis.
Answer
Sign in to view the complete answer paper.
Construct a Finite automata and scanning algorithm for recognizing identifiers, numerical constants in ‘C’ language.
Answer
Sign in to view the complete answer paper.
What is left recursion? Describe the algorithm used for eliminating left recursion.
Answer
Sign in to view the complete answer paper.
Eliminate left recursion in the following grammar:
Answer
Sign in to view the complete answer paper.
Write an algorithm for computing LR(K) item sets.
Answer
Sign in to view the complete answer paper.
Differentiate between Top down and Bottom up parsing techniques.
Answer
Sign in to view the complete answer paper.
Construct a Quadruple, Triple and Indirect triple for the statement
Answer
Sign in to view the complete answer paper.
How are inherited attributes differ from synthesized attributes?
Answer
Sign in to view the complete answer paper.
Give syntax directed translation scheme for simple desk calculator.
Answer
Sign in to view the complete answer paper.
Explain various storage allocation strategies with an example.
Answer
Sign in to view the complete answer paper.
What is a basic block? How to construct a basic block?
Answer
Sign in to view the complete answer paper.
Explain peephole optimization with an illustrative example.
Answer
Sign in to view the complete answer paper.
Explain the following with an example
Constant Propagation
Answer
Sign in to view the complete answer paper.
Partial Redundancy Elimination.
Answer
Sign in to view the complete answer paper.
Explain loop optimization techniques with example.
Answer
Sign in to view the complete answer paper.
Explain various notations used in data flow analysis.
Answer
Sign in to view the complete answer paper.