Bonus Marks


  • › Write a regular expression matching strings of all a or b such as aababa or bbaa.
  • › Write a regular expression matching strings of consecutive a and b such as ababab or aba.
  • › Write a regular expression matching pit, pot and respite but not peat, spit, or part.
  • › Change the grammar to add a new operator such as %.
  • › Change the grammar to recognise operators written in textual format add, sub, mul, div.
  • › Change the grammar to recognize decimal numbers such as 0.01, 5.21, or 10.2.
  • › Change the grammar to make the operators written conventionally, between two expressions.
  • › Use the grammar from the previous chapter to parse Doge. You must add start and end of input.