Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech III COMPILER DESIGN Previous Question Paper (May - 2018 - R13)
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.
Part A
What are the two parts of a compilation? Explain briefly.
Answer
The two main parts of a compilation are the Analysis (or front end) and the Synthesis (or back end).
The Analysis part breaks the source code into smaller pieces and creates an intermediate representation. It typically includes lexical analysis, syntax analysis, and semantic analysis.
The Synthesis part takes the intermediate representation and generates the target code. It typically includes intermediate code generation, code optimization, and code generation.
Define a context free grammar.
Answer
A Context-Free Grammar (CFG) is a formal grammar that can be used to generate all of the strings in a given formal language. It is a set of production rules that describe how to form strings in the language. A CFG is defined by four components: a set of non-terminal symbols, a set of terminal symbols, a set of production rules, and a start symbol.
List the properties of LR parser.
Answer
Sign in to view the complete answer paper.
Write short notes on YACC.
Answer
Sign in to view the complete answer paper.
What are the various types of intermediate code representation?
Answer
Sign in to view the complete answer paper.
Give the format of symbol table
Answer
Sign in to view the complete answer paper.
List the terminologies used in basic blocks.
Answer
Sign in to view the complete answer paper.
What is a flow graph?
Answer
Sign in to view the complete answer paper.
Mention the properties that a code generator should possess.
Answer
Sign in to view the complete answer paper.
What is a DAG? Mention its applications.
Answer
Sign in to view the complete answer paper.
Unit I
Explain in detail about the role of Lexical analyzer with the possible error Recovery actions.
Answer
Sign in to view the complete answer paper.
Construct Predictive parsing table for the following grammar and check whether the (a, a) belong to that grammar or not.
Answer
Sign in to view the complete answer paper.
Unit II
Give the LALR parsing table for the grammar.
Answer
Sign in to view the complete answer paper.
Compare and contrast between SLR, LALR and LR parses.
Answer
Sign in to view the complete answer paper.
Unit III
How would you generate the intermediate code for the flow of control statements? Explain with examples.
Answer
Sign in to view the complete answer paper.
Explain how the types and relative addresses of declared names are computed and how scope information is dealt with.
Answer
Sign in to view the complete answer paper.
Unit IV
Write about Data flow analysis of structural programs.
Answer
Sign in to view the complete answer paper.
Explain the principle sources of optimization in detail.
Answer
Sign in to view the complete answer paper.
Unit V
Give an example to explain in detail about machine dependent code optimization.
Answer
Sign in to view the complete answer paper.
Describe how DAG can be used in register allocation process? Give examples.
Answer
Sign in to view the complete answer paper.