3 votes 3 votes The maximum number of reduce moves that can be taken by a bottom-up parser with no epsilon and unit productions to parse a string of length 3 tokens is ____ ? Compiler Design compiler-design context-free-grammar compiler-tokenization numerical-answers + – shikharV asked Nov 13, 2015 • retagged Jun 17, 2022 by Lakshman Bhaiya shikharV 851 views answer comment Share Follow See 1 comment See all 1 1 comment reply sridhar15399 commented Apr 7, 2020 reply Follow Share what if we have A-> A+B /a B->a then for aaa we need 3 moves so why 2 is ans 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes if grammar is CNF then total reduce move are 2n-1. put n=3 here . number of reduced move = 5 Digvijay Pandey answered Nov 13, 2015 Digvijay Pandey comment Share Follow See 1 comment See all 1 1 comment reply shikharV commented Nov 13, 2015 reply Follow Share Its solution has been given as 2 with the following explaination. Please check if it makes some sense 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes There are n-1 moves for this. For example take S->aBC B->a C->a then The string aaa can be derived by 2 moves S->aaC and S->aaa Anupoju Satish Kumar answered Nov 24, 2015 Anupoju Satish Kumar comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Answer : 2 Total n-1 reduce moves taken by a bottom-up parser if there is no epsilon or unit production. Intutive explaination : We can reduce except the start production. So, removing 1 production(token). ashutoshaay26 answered Sep 1, 2017 ashutoshaay26 comment Share Follow See all 0 reply Please log in or register to add a comment.