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:
SABS \rightarrow A B
AaAϵA \rightarrow a A | \epsilon
BbBϵB \rightarrow b B | \epsilon

Similar questions