Generate and parse Python code from a C # application

I need to generate Python code to be more specific IronPyton . I also need to be able to parse the code and upload it to the AST . I just started looking at some tools. I played with Oslo and decided that this is not the right tool for me. I just looked very briefly at Coco / R, and it looks promising.

Does anyone use Coco / R? If you did what you experienced with this tool, can you recommend some other tool?

+6
source share
3 answers

The very implementation IronPython includes in itself the parser and AST-representation Python programs that can be used with . PythonWalker

+9
source

Not really my area of ​​expertise, but you can try ANTLR 4 . It supports the generation of Python 2 and Python 3 .

+2
source

I think you should look at the dynamic runtime language . This will be a standard part of some later versions of .Net and C # (.Net 4 from memory).

I used it to compile and execute Python code generated at runtime, but I haven't played with all the AST stuff yet.

0
source

All Articles