script to translate from compiler AST

  • Thread starter Andrey Khavryuchenko
  • Start date
A

Andrey Khavryuchenko

Hi!

I'm looking for a script to translate from 'compiler' AST to py source
and executable code.

Google search reveals hardly useful links.

Is there something like that or it is left as an exercise for a curious
developer?
 
M

Miki Tebeka

Hello Andrey,
I'm looking for a script to translate from 'compiler' AST to py source
and executable code.

Google search reveals hardly useful links.

Is there something like that or it is left as an exercise for a curious
developer?

Have you looked at the parser module?
(http://www.python.org/doc/current/lib/module-parser.html) it does
have some functions operating on AST. The is also a visitor patter
support in the compiler module.

HTH.
Miki
 
M

Michael Hudson

Andrey Khavryuchenko said:
Hi!

I'm looking for a script to translate from 'compiler' AST to py source
google('decompyle')

and executable code.

Um, not sure what you're asking for here. You might be asking for
Python2C, but it's probably not what you want...

Cheers,
mwh
 
A

Andrey Khavryuchenko

Miki,

"MT" == Miki Tebeka wrote:

MT> Have you looked at the parser module?
MT> (http://www.python.org/doc/current/lib/module-parser.html) it does
MT> have some functions operating on AST. The is also a visitor patter
MT> support in the compiler module.

Well, I'm speaking exactly about the compiler module. Imagine, I've built
an AST that I want to run. I've not found an easy (read library) way to do
that, hence the questions.
 
A

Andrey Khavryuchenko

Michael,

"MH" == Michael Hudson wrote:


MH> google('decompyle')

Well, not *that* :)

MH> Um, not sure what you're asking for here. You might be asking for
MH> Python2C, but it's probably not what you want...

Imagine, I've built an AST that I want to run. I've not found an easy
(read library) way to do that, hence the question.

Is there a way or I'd better write a proper 'visitor' myself?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top