2080 1

CSC376 · 2080 · 10 marks

Differentiate between one-pass and multi-pass compiler. Construct the LL(1) parsing table for the following grammar.S→ABCDS \rightarrow ABCDS→ABCDA→a∣ΔA \rightarrow a | \varepsilonA→a∣ΔB→bB \rightarrow bB→bC→0∣ΔC \rightarrow 0 | \varepsilonC→0∣ΔD→d∣ΔD \rightarrow d | \varepsilonD→d∣Δ

Differentiate between one-pass and multi-pass compiler. Construct the LL(1) parsing table for the following grammar.S→ABCDS \rightarrow ABCDS→ABCDA→a∣ΔA \rightarrow a | \varepsilonA→a∣ΔB→bB \rightarrow bB→bC→0∣ΔC \rightarrow 0 | \varepsilonC→0∣ΔD→d∣ΔD \rightarrow d | \varepsilonD→d∣Δ[10]

Compiler Design and ConstructionChapter 2: Lexical, Syntax and Semantic AnalysisTop-down parsingNumerical: LL(1) parsing table

Feature One-Pass Compiler Multi-Pass Compiler --------- Number of scans Scans source exactly once Scans source/intermediate form multiple times Speed Faster compilation Slower (multiple traversals) Memory usage Requires less memory Requires more memory (intermediate results stored) Optimization L...