Question

Write a EBNF grammar for the set of ALL (and ONLY) the strings that are made...

Write a EBNF grammar for the set of ALL (and ONLY) the strings that are made of 0 or more occurrences, in any order, of the letters a and/or b in which the total number of occurrences of the letter a is even. Your answer must use the EBNF extensions WHENEVER possible in order to minimize the number of non-terminals and productions.

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

GRAMMAR

<expr> := '' | a <A> | b{<expr>}

<A> := a { <expr> } | b {<A>}

EXPLANATION

expr has even number of a's

A has odd number of a's

If b comes, staying at the same non-terminal.

Please up vote. Happy Learning!

Add a comment
Know the answer?
Add Answer to:
Write a EBNF grammar for the set of ALL (and ONLY) the strings that are made...
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