2081.1 9

Compiler Design and Construction2081.15 marksNumerical: LL(1) parsing tableTop-down parsing

Construct the LL(1) parsing table for the following grammar. S→AS1∣CS \rightarrow AS1 \mid CS→AS1∣CA→0A \rightarrow 0A→0C→2C∣εC \rightarrow 2C \mid \varepsilonC→2C∣ε

Construct the LL(1) parsing table for the following grammar. S→AS1∣CS \rightarrow AS1 \mid CS→AS1∣CA→0A \rightarrow 0A→0C→2C∣εC \rightarrow 2C \mid \varepsilonC→2C∣ε[5]

Grammar: $$S \rightarrow AS1 \mid C$$ $$A \rightarrow 0$$ $$C \rightarrow 2C \mid \varepsilon$$ Non-terminals: $S, A, C$; Terminals: $0, 1, 2$; End marker: $$$ $$. Note: In $AS1$, the symbol $1$ is treated as a terminal. --- FIRST(A): $A \to 0 \Rightarrow$ FIRST(A) = ${0}$ FIRST(C): $C \to 2C

Up nextWhat are the advantages of intermediate code? How do you convert procedure call to 3AC?