(Note that these will make more sense when the previous introduction to grammars has been completed!)
Demonstrate how compilers, interpreters, parsers or validators find errors in formal languages e.g. introduce an error to a compiled program, XML document file or web page, and show the effect of the error.
Find a grammar for a programming language, and show how a sample program would be parsed using the grammar.
Use examples to show the parse tree (or tree) for a correct and incorrect program fragment, or to show a sequence of grammar productions to construct a correct program fragment.
Explore the grammar for balanced parentheses: S -> SS, S -> (S), S -> ( )
Find a grammar for a simple arithmetic expression in a programming language, and show the parse tree for sample expressions (such as (a+b)*(c-d) ).