Translation Process

40 views
Skip to first unread message

Pradyun Gedam

unread,
Feb 11, 2014, 9:48:14 AM2/11/14
to py2c-di...@googlegroups.com
The plan for the translation process (currently) is like so:
  1. Generate an AST from Python code. (High-level nodes)
  2. Make a pass through it collecting and adding type information. (Intermediate-level nodes)
  3. Pass the AST with the type-information to the Fixers. They can add low-level or intermediate-level nodes to this AST.
    Fixers can be used to optimize the code, provide 3rd party module support etc. This way the core of the package stays clean.
  4. Another pass through the AST will change all intermediate nodes to low-level ones.
  5. Finally, The C++ code shall be generated.
So there are 2 things that are involved in the code generate:
  • An AST system that has high-level (Python) nodes, intermediate-level (hold type information) nodes and low-level (C) nodes.
  • Fixers (in Py2C or user specified)

Any comments?

Jurgis Pralgauskis

unread,
Feb 27, 2014, 10:38:56 AM2/27/14
to py2c-di...@googlegroups.com
I have made rough translator
and proposed it here https://github.com/pradyun/Py2C/issues/3
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages