Question: Write a context-free grammar generating the set of all strings corresponding to lists of pizza orders. A pizza order has a size (s, m, or
Write a context-free grammar generating the set of all strings corresponding to lists of pizza orders. A pizza order has a size (s, m, or l) followed by a crust (t or h) followed by up to 5 optional toppings chosen from a, m, o, p, or s. Double toppings are not allowed. m will not precede a, o will not precede m or a, etc. Commas are used to separate items in a list. A list may be empty.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
