COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The following statement:A:Every regular grammar is LL(1)B:Every regular expression is LR(1)Which of the following stament is True
A
A is true and B is False
B
A is True and B is True
C
A is False, B is True
D
A is False and B is False
Explanation: 

Detailed explanation-1: -if a grammar is regular then it will be Context free also [as per chomsky hierarchy] it may be or may be not ambiguous depending on grammar. But it is sure any ambiguous regular grammar can be converted into unambiguous regular grammar.

Detailed explanation-2: -Option A: Every subset of a regular set is regular is False. For input alphabets a and b, a*b* is regular. A DFA can be drawn for a*b* but a n b n for n≥0 which is a subset of a*b* is not regular as we cannot define a DFA for it.

Detailed explanation-3: -Every language is a subset of itself. Thus, if every subset of the language is regular, then the subset that is the language itself is regular as well, and thus the language itself is regular. Not just that, if every proper subset of a language is regular, then the language is finite (and thus regular).

There is 1 question to complete.