Shift reduce parsing belongs to a class of
(A) bottom up parsing
(B) top down parsing
(C) recursive parsing
(D) predictive parsing
Explanation: Shift reduce are the class of parsers which built a parse tree in bottom-up manner and scans it from left to right.
In these parsers, through shift step, a single character from the token stream is pushed on the parse stack and becomes a new single-node parse tree.
A reduce step applies a complete grammar production rule to the recent parse trees, joining them together as one tree with a new root symbol.
These parsers include LR parsers which are non-backtracking in nature. Examples: SLR, CLR, LALR etc.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.