You are on page 1of 2

NOIDA INSTITUTE OF ENGINEERING & TECHNOLOGY, GR.

NOIDA

SESSION 2019-20(EVEN)
FIRST SESSIONAL TEST
B.Tech Semester--VI
Branch – CSE/IT Section –ALL

Subject Name : - COMPILER DESIGN Paper Code : RCS-602


Time : 90 Min M.M. : 20

Note: Attempt all questions.

SECTION ‘A’

Note: All Questions carry equal marks 4*1=04 Marks


1. a) Describe a cross compiler? (CO1)
b) Explain problems associated with Top Down Parsing. (CO2)
2. a) Design a DFA for strings containing 0’s & 1’s which accepts the strings having 011
as a substring. (CO1)
b) Remove Left factor from the grammar (CO2)
SbaB / bA / a , A abC / ab , B AbC/AbB /t , C j / k
SECTION ‘B’
Note: All Questions carry equal marks 4*2=08 Marks

3. a) Explain different phases and their working in compiler. (CO1)

b) Explain the concept of bootstrapping. Develop a compiler for language S on machine


B with the help of an existing compiler of language other than S on machine M.
(CO1)
4. a) Write Subset Construction Method for converting NFA with ε moves into
equivalent DFA with example. (CO1)
b) Consider the following grammar. (CO2)
S aAb | t , A AcS | S where S is start symbol of the grammar.
Compute first and follow of every non terminal in the grammar.

SECTION ‘C’

Note: All Questions carry equal marks 2*4=08 Marks

5. a) Convert regular expression ((a/b)*a)*ba in a DFA without creating intermediate


NFA and minimize it if possible. (CO1)

b) Consider the following grammar. Where S is start symbol of the grammar. (CO2)
S aAC| bB , A Abc | Abd | e , B f | g , C h | i
Construct Predictive parsing table for above grammar and find out whether the
grammar is LL(1) or not

**** ****
NOIDA INSTITUTE OF ENGINEERING & TECHNOLOGY, GR. NOIDA

SESSION 2019-20(EVEN)
FIRST SESSIONAL TEST
B.Tech Semester--VI
Branch – CSE/IT Section –ALL

Subject Name : - COMPILER DESIGN Paper Code : RCS-602


Time : 90 Min M.M. : 20

Note: Attempt all questions.

SECTION ‘A’

Note: All Questions carry equal marks 4*1=04 Marks

1. a) How a program executes in the language processing system? Draw only diagram. (CO1)
b) Design a DFA for strings containing a’s & b’s which accepts the strings having abb as
a substring (CO1)
2. a) Remove left recursion from the grammar. (CO2)
A ABC / aBb / id / c , B + / * / =
b) Explain the concept of bootstrapping. (CO2)

SECTION ‘B’

Note: All Questions carry equal marks 4*2=08 Marks

3. a) Explain the action taken by every phase of the compiler with a suitable example. Also
discuss the different types of grouping of phases. (CO1)
b) Construct top down & bottom up parse tree for the string (id+ (id*id)) by using the
following grammar where E is start symbol:-- (CO1)
E E+E / E*E / (E) / id
4. a) Write the procedure for constructing the LL(1) parsing table. (CO2)
*
b) Convert regular expression (a/b) b*ab in a DFA without creating intermediate NFA
(CO1)
SECTION ‘C’

Note: All Questions carry equal marks 2*4=08 Marks

5. a) Consider the following grammar. (CO2)


A BA’, A’ +BA’/ Ԑ, B CB’, B’ *CB’/ Ԑ, C (A)/ id where A is start
symbol of the grammar. Compute first and follow of every non terminal in the
grammar.
b) Convert regular expression a (ba)*(a+b) in a DFA by using Thompson’s
construction Method and Subset Construction Method. (CO1)

**** ****

You might also like