Toy Parser Generator is a lexical and syntactic parser generator for Python. With a very clear and simple syntax, you can write an attributed grammar that is translated into a recursive descendant parser. TPG generated code is very closed to the original grammar. This means that the parser works like the grammar. A grammar rule can be seen as a method of the parser class, symbols as method calls, attributes as method parameters and semantic values as return values. You can also add Python code directly into grammar rules and build abstract syntax trees while parsing.
Toy Parser Generator is a lexical and syntactic parser generator for Python. With a very clear and simple syntax, you can write an attributed grammar that is translated into a recursive descendant parser. TPG generated code is very closed to the original grammar. This means that the parser works like the grammar. A grammar rule can be seen as a method of the parser class, symbols as method calls, attributes as method parameters and semantic values as return values. You can also add Python code directly into grammar rules and build abstract syntax trees while parsing.
To install py27-tpg, run the following command in macOS terminal (Applications->Utilities->Terminal)
sudo port install py27-tpg
To see what files were installed by py27-tpg, run:
port contents py27-tpg
To later upgrade py27-tpg, run:
sudo port selfupdate && sudo port upgrade py27-tpg
Reporting an issue on MacPorts Trac
The MacPorts Project uses a system called Trac to file tickets to report bugs and enhancement requests.
Though anyone may search Trac for tickets, you must have a GitHub account in order to login to Trac to create tickets.