Compiler-AST-Walk-Visitor: Any Examples or Documentation?

Efrat Regev efrat_regev at yahoo.com
Fri Mar 23 13:10:42 EDT 2007


     Hello,

     I'm trying to write something that will translate Python code to 
pseudo-code (for teaching purposes). Googling around indicated that the 
compiler module is pertinent, especially creating a visitor to walk the 
generated AST:
http://docs.python.org/lib/module-compiler.html

     I can build the AST, but I can't figure out how to write the 
visitor. The package documentation didn't help me out that much, and I 
couldn't find any examples. In fact, google only came up with this 
unanswered related question:
http://mail.python.org/pipermail/python-list/2006-July/392716.html

     Any help is appreciated.

      Thanks and Bye,

       Efrat



More information about the Python-list mailing list