You are on page 1of 2

B.P.

Poddar Institute of Management & Technology


Assignment1/B.TECH/CSE(NEW)/SEM 7/CS702/2019-20
COMPILER DESIGN

OUTCOME BASED EDUCATION (OBE)


Question No. Knowledge Domain Allotted Marks COs
1 Evaluate 5 CO2
2 Apply 5 CO2
3 Apply 5 CO1
4 Understanding 5 CO2
5 Understanding 5 CO2
6 Apply 5 CO2
7 Evaluate 5 CO2
8 Remember 5 CO2
9 Apply 5 CO2

1.
Check whether the following grammar is LL (1) or not:
A-> BD
B->e
D-> =A/€

2. Find the FIRST and FOLLOW set for


E-> TE’
E’->+TE’|€
T-> FT’
T’-> *FT’
F-> (E) | id

3. Find the regular expression corresponding to the finite automata.

PS Next State Next State


a b
q1 q1, q2 -
q2 q3 q2
q2 q2 -

4. Given a grammar
S->aSbS|bSaS|

a) Show that this grammar is ambiguous by constructing two different. Left most
derivations for the sentence abab.
b) Construct the corresponding parse tree for abab
5. Using block diagram, indicate different phases of compilation explaining their
activities.
6. Consider the following grammar
S-> aABe
A->Abc|b
B->d
Find the FIRST and FOLLOW set.

7. Construct predictive parsing table for the following grammar and check if it is LL(1)
grammar or not.
S->(S)S/

8. Give the algorithm for left factoring a grammar.


9. Left Factor the given grammar
E->T+E|T|a
T->id*T|id

You might also like