TOOLS AND TECHNIQUES FOR COMPILER DESIGN
MISCELLENOUS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
The following grammar is:S
|
Not SLR(1) and not CLR(1)
|
|
CLR(1) but not SLR (1)
|
|
SLR (1) but not CLR (1)
|
|
SLR (1) and CLR (1)
|
Explanation:
Detailed explanation-1: -If you can construct a parsing table and there are no conflicts, it’s SLR(1).
Detailed explanation-2: -CLR refers to canonical lookahead. CLR parsing uses the canonical collection of LR (1) items to construct the CLR (1) parsing table. CLR (1) parsing table make more number of states as compared to the SLR (1) parsing. In the CLR (1), it can locate the reduce node only in the lookahead symbols.
Detailed explanation-3: -SLR (1) refers to simple LR Parsing. It is same as LR(0) parsing. The only difference is in the parsing table.To construct SLR (1) parsing table, we use canonical collection of LR (0) item.
There is 1 question to complete.