interpreter pattern drinks weekdays mondays burgers thursday ribs sunday pizzas we also identified the actions that could take placeget discount get discount get one free eat all you can finallywe recognized the key ideas as they relate to specials in the restaurantif customer is of certain type they always get fixed off their total tab at certain times all items of specific type gets discounted with fixed percentage at certain times you get second item of certain type free if you were to buy one item of that type generalizing the elements in the key ideas results in the following rules for specialsif certain conditions are met certain items get discount one way to formally express grammar is by writing it in extended backus-naur form (ebnf for more information on ebnf seecmsc /tutorial/ebnf htmlour restaurant example in enbf looks like thisrule"if "conditionsthen "item_typeget "discount conditionscondition conditions and conditions conditions or conditions conditiontime_condition item_condition customer_condition discountnumber"discount"cheapest "numberitem_type free