By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

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

P: n/a
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/pyt...ly/392716.html

Any help is appreciated.

Thanks and Bye,

Efrat
Mar 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mar 23, 1:10 pm, Efrat Regev <efrat_re...@yahoo.comwrote:
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/pyt...ly/392716.html

Any help is appreciated.

Thanks and Bye,

Efrat
Maybe some of the files in google codesearch that import compiler and
walk would be helpful?

http://www.google.com/codesearch?q=c...nG=Search+Code

It seems from a superficial look that some of those files would be
helpful as examples.

-Bill Mill
bill.mill at gmail.com
http://billmill.org

Mar 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.