INTRODUCTION TO COMPILER DESIGN
KEY COMPONENTS OF A COMPILER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
In SLR parsing for the grammar E’
|
Both will have shift-reduce conflict
|
|
Only ‘a’ will have shift-reduce conflict
|
|
Only ‘b’ will have shift-reduce conflict
|
|
Neither of the other option
|
Explanation:
Detailed explanation-1: -SLR grammars are a superset of all LR(0) grammars and a subset of all LALR(1) and LR(1) grammars. When processed by an SLR parser, an SLR grammar is converted into parse tables with no shift/reduce or reduce/reduce conflicts for any combination of LR(0) parser state and expected lookahead symbol.
Detailed explanation-2: -A shift-reduce conflict occurs in a state that requests both a shift action and a reduce action. A reduce-reduce conflict occurs in a state that requests two or more different reduce actions.
There is 1 question to complete.