Back to the 2024 paper

Module 2 : Syntax Analysis (Parser)

20247m

Given a context-free grammar (CFG), compute FIRST and FOLLOW sets for all non-terminals, and construct the LL(1) parsing table. Also, determine whether the grammar is LL(1) or not.
Grammar:
S→ABS \rightarrow A B
A→aA∣ϵA \rightarrow a A | \epsilon
B→bB∣ϵB \rightarrow b B | \epsilon

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.