Knowee
Questions
Features
Study Tools

Consider the following grammar G G: S → EF   E → a|∈F → abF|ac                  Which of the following is true about the grammar G?1. G is a LL(1) grammar2. G is a regular Grammar                                                                 1 only2 only1 and 2 bothNone of these

Question

Consider the following grammar G G: S → EF   E → a|∈F → abF|ac                  Which of the following is true about the grammar G?1. G is a LL(1) grammar2. G is a regular Grammar                                                                 1 only2 only1 and 2 bothNone of these

🧐 Not the exact question you are looking for?Go ask a question

Solution

The grammar G is not a LL(1) grammar because it is left recursive. LL(1) grammars cannot have left recursion. Therefore, statement 1 is false.

The grammar G is also not a regular grammar. Regular grammars only have rules of the form A -> aB or A -> a, where A and B are non-terminals and a is a terminal. The rule F -> abF in the grammar G does not fit this form. Therefore, statement 2 is also false.

So, the correct answer is "None of these".

This problem has been solved

Similar Questions

Prove that the given grammar is LL(1) grammarS  aBDhB  cCC  D  EFE  F  

Which of the following statement is true about regular grammar? Options : Regular grammar and context free grammar are the same entity All context free grammar are regular grammar but not vice versa All Regular grammar are context free but not vice versa All of above mentioned

Consider the Grammar, G, with the production rule: S-> aS | bS | ε Which of the following is generated by G? Options :{a n b m | m,n >=0}{w ∈ {a, b}*, w has equal number of a’s and b’s}{a, b}*{an |n >=0} ∪ {bn |n >=0} ∪ {anbn |n >=0}

Whether or not is the following grammar LL(1)? Why (State the reasons.)? If thegrammar is not LL(1), then convert it to an LL(1) grammar. Next, present thetransition table and show the parsing process by parsing the string “ababbbb”according to the prepared transition table.• S->aAbB | bS• A->AbB|λ• B->Bb|a

Given grammar G:S->aS| ABA-> eB-> eD-> bReduce the grammar, removing all the e productions:ans.S->aS| AB| A| B, D-> bS->aS| AB| A| BNone of the mentionedS->aS| AB| A| B| a, D-> b

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.