Some of the things I've learned every day since Oct 10, 2016
15: Context-Free Grammars
October 25, 2016Posted by on
A context-free grammar is a formal grammar in which the rewrite rules (or ‘productions’) of the grammar are all from single variables. That is, as implied in the name, the rewrite rules of a given variable in a context-free grammar are dependent only on that variable and not on any other ‘context’.
This is a valid subset of rewrite rules in a context-free grammar
while this is not
The violation of freedom-from-context in the latter example is due to the last rule, where the thing being rewritten is not a single variable.