What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit-production (i.e. of type A $\rightarrow$$\in$ Î and A $\rightarrow$ a) to parse a string with n tokens?
Reveal answer
Fill a bubble to check yourself
2 × (4) − 1 = 7 reductions
$\Rightarrow$2n − 1 reductions are required.
[Note: Unit production is given as A $\rightarrow$ a, it was typo]
Above reductions are not in reverse of RMD but when they are reduced in bottom-up parsing, we will get same number of reductions.