3.5 pyggy.pylly - Lexer generation

This module implements the lexer generator. It is responsible for reading in a lexer spec file (in .pyl format), generating finite state machines and emitting tables for the machines into a Python module.

This module can be accessed from the command line or through a call from Python. To run from the command line:

$ python pylly.py [-d debuglevel] infile.pyl outfile.py

pyggy.pylly.parsespec( fname, outfname, debug=0)
The parsespec function causes the input file fname to be processed and finite state machine tables to be generated to fname. If debug is set, increasing amounts of diagnostic output will be emitted. The debug levels (especially higher-levels) are subject to change but are currently:

Level  Description 
0 Output a count of ambiguities in the lexer.
1 Output detailed diagnostics of the generated lexer.
2 Show the DFAs constructed for each start state with dotty.
3 Show the NFA constructed from the spec file with dotty.
10 Show the parse tree from the spec file with dotty.

This function may raise pyggy.SpecError if there are any errors in the spec file or pyggy.InternalError.

See the PyGgy Home Page.