I was reminded of this by the post on the goto statement -- having used the AST module recently in a limited capacity[1], I was really impressed by how easy it was to use. There's a good pycon talk for those interested specifically in this part of the process[2], and you can also see the full grammar[3].
[1] http://blueprintforge.com/blog/2012/02/27/static-modificatio...
[2] http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2011-wha...
[3] http://docs.python.org/library/ast.html#abstract-grammar