TOOLS AND TECHNIQUES FOR COMPILER DESIGN
MISCELLENOUS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Considering LALR(1) has n state for grammar, which of the following false
|
SLR will have n state
|
|
CLR will have exaclty n state
|
|
SLR will have n state
|
|
CLR may or may not have n state
|
Explanation:
Detailed explanation-1: -A grammar is LALR(k) if and only if its LALR(k) automaton is deterministic. The only way that we know of checking that a grammar is LALR(k) is to build the automaton, or something that essentially amounts to building the automaton.
Detailed explanation-2: -A → a is LALR(1) but not SLR(1). Then, the LALR(1) parsing table can be obtained by merging items with common first components, In this problem, no merging occurs. That is, the final LALR(1) parsing table is the same as the LR(1) one. Thus, the given grammar is LALR(1).
There is 1 question to complete.