Which of the following statements about parser is/are CORRECT?
- is more powerful than
- is more powerful than
- is more powerful than
View worked solution
Answer: A
The "power" of a parser refers to the class of grammars it can successfully parse without any conflicts (shift-reduce or reduce-reduce).
The hierarchy of bottom-up parsers in terms of their parsing power is as follows:
- Statement I: "Canonical LR is more powerful than SLR" is CORRECT because any grammar that is is also , but the reverse is not always true.
- Statement II: "SLR is more powerful than LALR" is INCORRECT because is strictly more powerful than .
- Statement III: "SLR is more powerful than Canonical LR" is INCORRECT because Canonical LR is the most powerful LR parser.
Thus, only statement I is correct.
Free practice · Your answers on this page are not saved.
