2080 7

CSC376 · 2080 · 5 marks

Find the FIRST and FOLLOW of all the non terminals in following grammar. S→aAbcD∣ΔS \rightarrow aAbcD | \varepsilonS→aAbcD∣ΔA→SD∣ΔA \rightarrow SD | \varepsilonA→SD∣ΔC→SaC \rightarrow SaC→SaD→aBD∣ΔD \rightarrow aBD | \varepsilonD→aBD∣Δ

Find the FIRST and FOLLOW of all the non terminals in following grammar. S→aAbcD∣ΔS \rightarrow aAbcD | \varepsilonS→aAbcD∣ΔA→SD∣ΔA \rightarrow SD | \varepsilonA→SD∣ΔC→SaC \rightarrow SaC→SaD→aBD∣ΔD \rightarrow aBD | \varepsilonD→aBD∣Δ[5]

Compiler Design and ConstructionChapter 2: Lexical, Syntax and Semantic AnalysisTop-down parsingNumerical: FIRST and FOLLOW sets

Grammar productions: $$S \rightarrow aAbcD \mid \varepsilon$$ $$A \rightarrow SD \mid \varepsilon$$ $$C \rightarrow Sa$$ $$D \rightarrow aBD \mid \varepsilon$$ Non-terminals present in productions: $S, A, C, D$ (and $B$ appears on the RHS of $D \rightarrow aBD$). Missing data note: The non-termin...