"http://www.w3.org/TR/html4/loose.dtd"> >

Chapter 11
Structure of the package

11.1 General structure of the package

TPG is delivered in a Python package named tpg. It is composed of:

turns tpg directory into a package. It defines some data about the current release (version, author, ...) and it imports in its local namespace the three useful objects compile, LexerError and ParserError.
defines the base class of the generated parsers and other classes used by these parsers. It’s a kind of runtime for the parsers.
contains the classes used by the parser to represent the AST corresponding to the parsed grammar. Theses classes have the necessary methods for code generation.
contains the grammar that recognizes TPG grammars. It defines the syntax of TPG grammars and builds the AST of the grammar.
is automatically generated by TPG itself from parser.g.
contains release data (version, author, ...).
is a wrapper script for TPG. It reads a grammar and produces a Python script.