Btech Cs 6 Sem Compiler Design f1031 May 2019
Btech Cs 6 Sem Compiler Design f1031 May 2019
PART B
Answer any two full questions, each carries9 marks.
5 a) Explain the different phases in the design of a compiler. (5)
b) Find the FIRST and FOLLOW of the non-terminals in the grammar (4)
S->aABe
A->Abc|b
B->d
6 a) Design a recursive descent parser for the grammar (5)
E->E + T | T
T->T*F | F
F->(E) | id
b) Develop a lexical analyzer for the token identifier. (4)
7 a) What is left recursive grammar? Give an example. What are the steps in (5)
removing left recursion?
b) Explain any four compiler writing tools (4)
Page 1 of 2
http://www.ktuonline.com
B F1031 Pages: 2
PART C
Answer all questions, each carries3 marks.
8 Explain the main actions in a shift reduce parser (3)
9 What are different parsing conflicts in SLR parsing table? (3)
10 What are annotated parse trees? Give examples. (3)
11 What are L-attributed definitions and S-attributed definitions in a syntax directed (3)
translation scheme?
PART D
Answer any two full questions, each carries9 marks.
12 a) Find the LR(0) items for the grammar (4)
S->SS | a| €.
Page 2 of 2
http://www.ktuonline.com