Consider the following grammar.
S → aSB ∣ d B → b
The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is ________ .
Note – This question was Numerical Type.
(A) 6
(B) 7
(C) 8
(D) 4
Answer: (B)
Explanation: According to Bottom Up or Shift Reduce Parsers:
Initailly: aaadbbb
1. aaaSbbb {S→d}
2. aaaSBbb {B→b}
3. aaSbb {S→aSB}
4. aaSBb {B→b}
5. aSb {S→aSB}
6. aSB {B→b}
7. S {S→aSB}
Therefore, total 7 steps required.
Option (B) is correct.
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 1999 | Question 36
- GATE | GATE CS Mock 2018 | Question 39
- Top 5 Topics for Each Section of GATE CS Syllabus
- How to prepare in Last 10 days to score high in GATE?
- Aptitude | GATE IT 2006 | Question 7
- Aptitude | GATE IT 2006 | Question 8
- GATE | GATE CS 2013 | Question 1
- GATE | GATE CS 2013 | Question 3
- GATE | GATE CS 2013 | Question 4
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 6
- GATE | GATE CS 2013 | Question 7
- GATE | GATE CS 2013 | Question 8
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 11
- GATE | GATE CS 2013 | Question 65
- GATE | GATE CS 2013 | Question 17
- GATE | GATE CS 2013 | Question 18
- GATE | GATE CS 2013 | Question 19

