Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

Direction: Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and the following set of production rules

  1. Which of the following strings is generated by the grammar?
    1. aaaabb
    2. aabbbb
    3. aabbab
    4. abbbba
Correct Option: C

Let solve out to get the string generated by the grammar.
S → aB
S → aaBB
S → aabB
S → aabbS
S → aabbaB
S → aabbab
We get the string as aabbab.



Your comments will be displayed only after manual approval.