1.

Consider the production of the grammar S->AA A->aa A->bb Describe the language specified by the production grammar.(a) L = {aaaa,aabb,bbaa,bbbb}(b) L = {abab,abaa,aaab,baaa}(c) L = {aaab,baba,bbaa,bbbb}(d) L = {aaaa,abab,bbaa,aaab}The question was asked in exam.I would like to ask this question from Regular Expression in division Compiler Introduction of Compiler

Answer»

Correct answer is (a) L = {AAAA,aabb,bbaa,bbbb}

The EXPLANATION: S->AA (substitute A->aa)

S->aaaa

S->AA (substitute A->aa )

S->aaA (substitute A->bb)

S->aabb

S->AA (substitute A->bb the A->aa)

S->bbaa

S->AA (substitute A->bb)

S->bbbb.



Discussion

No Comment Found

Related InterviewSolutions