The function below is used to bootstrap the parser. We use the standard Python
tokeniser, and contruct a grammar by hand to recognize grammars.
The reduction functor is used to build a list of productions, the functions
named in the grammar are attached to these productions.
The grammar we will use is:
G -> Plist
Plist -> Plist newline P
Plist -> P
P -> LHS = RHS { func }
RHS -> RHS sym
RHS -> sym
We will immediately test the generated parser to parse a string
representing a grammar, namely, the same grammar, which should
generate an equivalent parser.