GATE CSE 2020 Q34: Reduction steps of a bottom-up parse of aaadbbb
- Compiler Design
- 1 mark
- NAT
- No negative marking
Question
Consider the following grammar.
The number of reduction steps taken by a bottom-up parser while accepting the string is _______.
Try it: numerical answer: type the value
Numerical answer. No negative marking.
Show answer and explanation
Answer: 7 (official GATE 2020 final answer key)
Concept used: Each reduction in a bottom-up parse corresponds to one production used in the rightmost derivation.
First step: Write the derivation of : count the uses of , and .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2020 CS question paper and final answer key, organised by IIT Delhi. Question paper · Answer key
More Compiler Design PYQs
- 2026 Session 1 · Q27Classify errors in three C string declarations
- 2026 Session 1 · Q28True statements about LL(1) parsing
- 2026 Session 1 · Q42Redundant (common) subexpressions in blocks B4 and B5 of a CFG
- 2026 Session 1 · Q53Compare two SDDs for type declarations
- 2026 Session 2 · Q35Count tokens produced by a lexer for a given string
- 2026 Session 2 · Q41Shift-reduce conflicts in the LR(0) table of a grammar