
88 Compilers – Principles and Practice
1. FIRST(α
i
) ∩ FIRST(α
j
) = ∅ for i ≠ j, and further, if then
2. FIRST(α
j
) ∩ FOLLOW(A) = ∅, ∀j ≠ i.
The parsing function M is now defined as
4.3 Bottom-up Parsing
We shall now discuss another approach to parsing – Bottom-up parsing, which starts with the given
sentence to be parsed, detects a handle while left-to-right scanning and reduces the sentential forms
by replacing the handle by an NT according to the grammar rules. The key issue here will be to detect
the handle reliably (Figs. 4.1 and 4.3).
Table 4.5 Parsing of example sentence i[e] = e#
Stack Input string Action/Remarks
A# i[e] = e# rule 1
iB