Question

2. Convert the following grammar to a left-linear grammar. Show your work. S A B + aaS|A|B → bbA|A + bbb B|6

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A grammar is said to be left linear grammar if it is in the form of V -> VT* or V -> T* where V is called variable and T is called terminal

S -> Saa | A | B

A -> Abb | λ

B -> Bbbb | b

The productions S-> A, S -> B are not in left linear grammar form so convert them

S -> Saa | Abb | Bbbb

A -> Abb | λ

B -> Bbbb | b

The grammar is in left linear form but it has null production so we have to eliminate it

S -> Saa | Abb | Bbbb | bb

A -> Abb | bb

B -> Bbbb | b

Hence this is the grammar in left linear form without null productions

Add a comment
Know the answer?
Add Answer to:
2. Convert the following grammar to a left-linear grammar. Show your work. S A B +...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT