Peter Stuifzand

Marpa parser for parsing marpa

I just wrote a small program to parse and generate a parser that parses Marpa. Marpa itself doesn’t include such a program for good reasons I assume. Or if it exists I couldn’t find it.

But as this is a small program it only generates a part of the parser. It is also not bootstrapping.

The repository contains a small tokenizer written in Perl. It tokenizes a line of text and passes this on to the token recognizer, which in turn calls the grammer.

The grammer calls methods in My_Actions to build a tree. This tree is the rules part of the argument to Marpa::Grammer->new. This argument is then dumped using Data::Dumper to create a Perl readable version.

© 2023 Peter Stuifzand