I started writing a post on the work I've done this week but soon realised that it would be useful to explain grammars a bit more before continuing. After all, it is possible that some of you went to the Wikipedia page for context-free grammars and were (like me) unable to curb the involuntary reflex to close the tab as soon as that stack of ugly math symbols came into view. Anyway, lets get to it. To make a grammar you need the following:
- One or more terminal symbols.
- One or more non-terminal symbols.
- A start symbol (must be non-terminal).
- Production rules that relate a non-terminal symbol to a set of symbols.