2.6 More Examples

For more examples of the use of PyLly and PyGgy refer to the code in the examples directory. In addition to several small examples there are the beginnings of a C parser in the examples/ansic directory. This example is based on the ANSI C test case from the D-Parser found at http://dparser.sourceforge.net/d/tests/ansic.test.g.

The most complete example of using PyGgy and ultimate reference for the behavior of PyGgy is found in the source code of PyGgy. The files pylly.pyl and pyggy.pyl specify the spec file lexers while the files pylly.pyg and pyggy.pyg specify their grammars. The files pylly.py and pyggy.py complete the functionality of the lexer and parser specification reading code. They are slightly complicated by their use of a lower level API which allows them to use pre-generated lexer and parser tables.

See the PyGgy Home Page.