Topy news - and a request for Python pretty-printing

Tim Peters tim.one at comcast.net
Sun Apr 14 23:56:27 EDT 2002


[Ira D. Baxter]
> Our DMS Software Reengineering Toolkit can easily build prettyprinters
> for arbitrary langauges; we've done it for many standard ones.
> See http://www.semdesigns.com/Products/Formatters/index.html
> Not Python yet, but all DMS really needs is a good grammar definition.
>  (Anybody have a Python lexer/grammar definition?)

The input for Python's parser generator is in the Python source
distribution, file Grammar/Grammar.

Note that block structure is denoted *by* indentation in Python source, and
there are no "curly braces" (or other visible "begin block"/"end block"
tokens).  In the grammar, INDENT and DEDENT are the tokens generated by the
lexer when a change in indentation level (from the indentation of the
previous statement) is seen.






More information about the Python-list mailing list