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

Discussion in 'Python' started by Efrat Regev, Mar 23, 2007.

  1. Efrat Regev

    Efrat Regev Guest

    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
     
    Efrat Regev, Mar 23, 2007
    #1
    1. Advertising

  2. Efrat Regev

    Bill Mill Guest

    On Mar 23, 1:10 pm, Efrat Regev <> wrote:
    > 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


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

    http://www.google.com/codesearch?q=compiler walk lang:python&hl=en&btnG=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
     
    Bill Mill, Mar 24, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boris Boutillier
    Replies:
    0
    Views:
    1,030
    Boris Boutillier
    Jun 15, 2004
  2. Andrey Khavryuchenko

    script to translate from compiler AST

    Andrey Khavryuchenko, Jan 11, 2004, in forum: Python
    Replies:
    6
    Views:
    380
    Andrey Khavryuchenko
    Jan 12, 2004
  3. Marcus Alves Grando
    Replies:
    7
    Views:
    497
    Marcus Alves Grando
    Nov 14, 2007
  4. Giovanni Azua
    Replies:
    0
    Views:
    443
    Giovanni Azua
    Nov 30, 2007
  5. Harishankar
    Replies:
    4
    Views:
    2,026
    Harishankar
    Mar 27, 2010
Loading...

Share This Page