JNTU
JNTU B.Tech III COMPILER DESIGN Previous Question Paper (November/December - 2017 - R13)
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
What are the features of a Lexical analyser?
Answer
A lexical analyser, or scanner, performs the following primary functions: it reads the input source code character by character to produce a stream of tokens, which are the meaningful units of the language such as keywords, identifiers, operators, and literals. It also removes white space, tabs, and newlines, and strips out comments from the source code. Additionally, it interacts with the symbol table to store information about identifiers and reports any lexical errors, such as illegal characters, to the compiler.
Explain in brief about left most and right most derivations.
Answer
A leftmost derivation is a process where the leftmost non-terminal in the sentential form is replaced by the right-hand side of a production rule at each step. This process continues until the string consists entirely of terminals. It is often associated with top-down parsing strategies.
A rightmost derivation is a process where the rightmost non-terminal in the sentential form is replaced by the right-hand side of a production rule at each step. This process is the reverse of the leftmost derivation in terms of selection order and is typically associated with bottom-up parsing strategies, such as shift-reduce parsing.
Define Left recursive grammar.
Answer
Sign in to view the complete answer paper.
List out the rules for FIRST and Follow.
Answer
Sign in to view the complete answer paper.
What are the advantages of heap storage allocation?
Answer
Sign in to view the complete answer paper.
Define Type Equivalence.
Answer
Sign in to view the complete answer paper.
What is algebraic transformation?
Answer
Sign in to view the complete answer paper.
Write in brief about flow graphs.
Answer
Sign in to view the complete answer paper.
What are the forms of a target program?
Answer
Sign in to view the complete answer paper.
What is machine independent code optimization?
Answer
Sign in to view the complete answer paper.
Part B
Define Regular Expression? Write about the identity rules for regular expressions.
Answer
Sign in to view the complete answer paper.
Discuss in brief about left Recursion and Left Factoring with examples.
Answer
Sign in to view the complete answer paper.
Define Compiler. Explain in brief about the LEX compiler.
Answer
Sign in to view the complete answer paper.
Construct FIRST and FOLLOW for the Grammar: E→E+T/T, T→T*F/F, F→(E)/id ?
Answer
Sign in to view the complete answer paper.
Construct SLR parsing table for the following grammar. E → E+T/T T → T*F/F F →(E)/id
Answer
Sign in to view the complete answer paper.
Discuss in brief about Yacc.
Answer
Sign in to view the complete answer paper.
Construct CLR parsing table for the following grammar. E → E+T/T T → T*F/F F →(E)/id
Answer
Sign in to view the complete answer paper.
Discuss in brief about error recovery strategies in Parsing.
Answer
Sign in to view the complete answer paper.
Explain in brief about Type checking and Type Conversion.
Answer
Sign in to view the complete answer paper.
Define Symbol table. Explain about the data structures used for Symbol table.
Answer
Sign in to view the complete answer paper.
Explain in brief about Stack Storage allocation strategy?
Answer
Sign in to view the complete answer paper.
Define activation record? Explain in brief about the fields in activation record.
Answer
Sign in to view the complete answer paper.
What is DAG? Construct DAG for the following Basic block: D:= B*C; E:= A+B; B:=B+C; A:=E-D;
Answer
Sign in to view the complete answer paper.
Explain how copy propagation can be done using data flow equation?
Answer
Sign in to view the complete answer paper.
Define loop optimization? Describe in brief about the transformation on basic blocks.
Answer
Sign in to view the complete answer paper.
Explain reducible and non reducible flow graphs with examples.
Answer
Sign in to view the complete answer paper.
Discuss about Instruction Selection and Register allocation.
Answer
Sign in to view the complete answer paper.