2081 6

CSC376 · 2081 · 5 marks

Compute the FIRST and FOLLOW of the non-terminals in the following grammar. S→(L)∣1S \rightarrow (L) \mid 1S→(L)∣1L→L;S∣ΔL \rightarrow L;S \mid \varepsilonL→L;S∣Δ

Compute the FIRST and FOLLOW of the non-terminals in the following grammar. S→(L)∣1S \rightarrow (L) \mid 1S→(L)∣1L→L;S∣ΔL \rightarrow L;S \mid \varepsilonL→L;S∣Δ[5]

Compiler Design and ConstructionChapter 2: Lexical, Syntax and Semantic AnalysisBasic parsing techniquesNumerical: FIRST and FOLLOW sets

Grammar: $$S \rightarrow (L) \mid 1$$ $$L \rightarrow L,;,S \mid \varepsilon$$ - Non-terminals: $S$, $L$ - Terminals: $($, $)$, $1$, $;$ - Start symbol: $S$ --- FIRST(S): - $S \rightarrow (L)$ gives first symbol $($ - $S \rightarrow 1$ gives first symbol $1$ $$FIRST(S) = {\ (,\ 1\ }$$ FIRST(L...