You are on page 1of 1

Department of CSE, NMIT Bangalore

Name:
Compiler Design 18CS73
USN:
Assignment (Unit 2)

Submission Date: 15 October 2023

Instructions: Answer all questions. Maximum marks = 10

Sl.No Question Marks


1. Find the FIRST and FOLLOW sets for the grammar 2
given below.
E → TE’
E’→ +TE’|ε
T → FT’
T’→ *FT’| ε
F → (E)|id
2. Determine the FIRST and FOLLOW for the grammar, 2
S→iEtSS’|a
S’→eS| ε
E→b
3. Construct a LL (1) parsing table for the grammar 2
E→TE’
E’→+TE’| ε
T’→FT’
T’→*FT’| ε
F→ (E) | id

4. Construct DFA & LR(0) table with the LR(0) item set 2
for the grammar below.
S → AA
A → aA | b
5. Consider the grammar 2
S –> S + S
S –> S * S
S –> id
Perform Shift Reduce parsing for input string “id + id +
id”. Show the stack moves.

You might also like