Subtopic 4 of 4
4.4Predictive (stack) parsing
Stack holds the expected symbols. Terminal on top: match with input. Non-terminal on top: look up M[A, a] and replace A by the right-hand side (pushed reversed). Accept at $ / $.
| # | Stack | Input | Action |
|---|---|---|---|
| 1 | E $ | id + id * id $ | output E → T E' |
Stack top is on the left. Terminal on top: match with input. Non-terminal on top: replace it by the table entry (pushed in reverse).
Previous year questions: Top-down Parsing (LL(1)) (5)
PYQs are grouped by topic, so this is the full set for Top-down Parsing (LL(1)); try the ones that match this subtopic. Open all 5 on the topic page.