Compiler Design Question Bank
Compiler Design Question Bank
Section-A
1 Define lexeme, token and pattern. (BPUT,2021)
Define left recursion. Eliminate left recursion from the following grammar E → E+T | T
2 T → T*F | F (BPUT,2018)
F → (E) | id
3 What is the difference between LEX and FLEX ? Explain(BPUT,2021)
4 What is back patching? (BPUT,2022)
5 Mention the advantages of intermediate code generation. (BPUT,2022)
6 What is compiler Design ? Explain. (BPUT,2018)
7 Define the steps to calculate FIRST and FOLLOW in LL(1). (BPUT,2018)
8 What do you mean by handle pruning ? (BPUT,2022)
9 Convert the following to postfix : A*(B+C/D) -E (BPUT,2021)
10 Define a context free grammar. (BPUT,2022)
11 Mention the strategies of storage allocation .(BPUT 2018-19)
12 What are the objectives of code optimization ?(BPUT 2021-22)
13 What are the various problems in code generation ?(BPUT 2017-18)
14 What is a Symbol table ? Explain.(BPUT 2017-18)
15 Explain the functionalities of Inter procedural Analysis(BPUT 2017-18)
Section-B
Write an algorithm for converting a NFA into DFA? Find the NFA for the regular expression
16
(a+b)*a(a+b). Convert the obtained NFA in to DFA. (BPUT,2022)
17 Explain peephole optimization.(BPUT 2018-19)
Explain the various ways of calling procedure? Explain in detail.
18
(BPUT 2021-22)
Section-C
Construct the NFA that consists of all strings of b’s and a’s where the third symbol from the
19 right end is ‘b’. convert the NFA to corresponding DFA.
(BPUT,2019)
Test whether the grammar is LL(1) or not and construct a predictive parsing table it
S → AaAb / BbBa
20
A →ε
B→ε (BPUT,2018)
21 Explain Intermediate code generation techniques. Why it is essential ? (BPUT,2021)
Using Back Patching , generate an intermediate code for following expression A< B OR
22
C< D (BPUT,2022)
δ 0 1
→p {q,s} {q}
34
*q {r} {q,r}
r {s} {p}
*s - {p}
(BPUT,2021)
Explain various issues associated with grammars in top-down parsing with suitable example.
35
(BPUT,2018)
Write an Syntax directed translation to convert a binary number to decimal number. For
36 example, when 101.101 is given as an input, it outputs 5.625. Illustrate the Syntax Directed
Translation while parsing the input given in example.(BPUT 2018-19)
Discuss the structure of a symbol table. Explain how the symbol table is created for a block
37
structured language. (BPUT 2017-18)
Section-E
What is an activation record? Draw diagram of General Activation record and explain the
38 purpose of different fields of an activation record.
(BPUT 2018-19)