Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech III COMPILER DESIGN Previous Question Paper (May - 2019 - R16)
Note: This question paper contains two parts A and B. Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit. Each question carries 10 marks and may have a, b, c as sub questions.
Part A
Define regular expression.
Answer
A regular expression is a notation used to define a regular language by describing a set of strings over a given alphabet. It is constructed recursively using basic operations: union (denoted by | or +), concatenation (denoted by juxtaposition), and Kleene closure (denoted by *), starting from the empty string, the empty set, and individual symbols from the alphabet.
Define linker and loader and explain briefly.
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. It resolves references to external symbols, such as functions or variables defined in separate modules or libraries, by assigning final memory addresses to them.
A loader is a part of the operating system that takes the executable file produced by the linker and places it into the main memory (RAM) to prepare it for execution. It performs tasks such as allocating memory space, initializing registers, and setting the program counter to the starting address of the program.
Define ambiguous grammar.
Answer
Sign in to view the complete answer paper.
Compare SLR, CLR and LALR.
Answer
Sign in to view the complete answer paper.
What is coercion?
Answer
Sign in to view the complete answer paper.
How to find evaluation order for SDD’s?
Answer
Sign in to view the complete answer paper.
What are the limitations of static allocation?
Answer
Sign in to view the complete answer paper.
Write the fields and uses of symbol table.
Answer
Sign in to view the complete answer paper.
What is common sub-expression elimination? Explain.
Answer
Sign in to view the complete answer paper.
What are induction variables? What is induction variable elimination?
Answer
Sign in to view the complete answer paper.
Part B
Explain the procedure to convert regular expression to Finite automata.
Answer
Sign in to view the complete answer paper.
Explain various phases in the construction of compiler with a neat sketch.
Answer
Sign in to view the complete answer paper.
What is the functionality of preprocessing and input buffering?
Answer
Sign in to view the complete answer paper.
Explain compiler construction tools.
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: E → E + T | T, T → T * F | F, F → (E) | id
Answer
Sign in to view the complete answer paper.
What is ambiguous grammar? Show that following grammar is ambiguous or not. A → A + A | A − A | A * A | a
Answer
Sign in to view the complete answer paper.
Verify whether the following grammar is LL(1) or not? E → E + T | T, T → T * F | F, F → (F) | a | b.
Answer
Sign in to view the complete answer paper.
What are three address codes? Explain different types of representations of three address code.
Answer
Sign in to view the complete answer paper.
Write three codes for x := A[y, z]
Answer
Sign in to view the complete answer paper.
What is type checker? Explain the specification of a simple type checker.
Answer
Sign in to view the complete answer paper.
Explain translation schema for array elements.
Answer
Sign in to view the complete answer paper.
Explain about Heap management.
Answer
Sign in to view the complete answer paper.
Define reference counting. What is the role of reference counting in garbage collection?
Answer
Sign in to view the complete answer paper.
Give the detailed description on DAG.
Answer
Sign in to view the complete answer paper.
Explain different methods for register allocation and assignment.
Answer
Sign in to view the complete answer paper.
Explain redundancy elimination techniques.
Answer
Sign in to view the complete answer paper.
Write the principal sources of optimization.
Answer
Sign in to view the complete answer paper.
Explain loop optimization technique with example.
Answer
Sign in to view the complete answer paper.
Explain constant propagation with example.
Answer
Sign in to view the complete answer paper.