473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Translation from Python to CIL(C Intermediate Language)

I have worked on the static analysis on Python source code recently. There is already a static analyzer written in Ocaml for CIL(C Intermediate Language) in our group. We want to reuse this analyzer, so our ideal approach is to translate Python to CIL.

Currently, I use Python built-in ast module to parse Python to Python AST. And then I translate the Python AST that ast.dump printed to C AST. In consider of C AST to CIL API and the static analyzer all written in Ocaml. I choose Ocamllex&Ocamlyacc to parse Python AST to C AST. However, there are some big problems.

The AST representation which ast.dump printed is hard to identify. That make my parser not easy to implement. On the other hand, I can't use Ocaml to acess the Python ast internal structure. I thought about maybe I should use other programming languages before, but I didn’t know if it will affect the execution of C AST to CIL and static analysis later.

I wonder whether I choose a wrong approach on the translation from Python code to CIL at first? Is there any other existing tools or approaches that may meet my requirements?

If there is anything I miss, please just point out that will be a lot of help for me. Thanks.
Apr 26 '11 #1
0 1358

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Joe Cheng | last post by:
I'm curious about something... many Artima.com members who have a Java background and learned Python have come to the conclusion that Java and Python are highly complimentary languages. They would...
49
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville...
18
by: qwweeeit | last post by:
Hi all, when I moved from Windows to Linux I choosed Python as my language of reference and as GUI, Qt (not much investigated up to now). Till now I didn't regret but one thing: Python can't act...
5
by: Torsten Bronger | last post by:
Hallöchen! I'd like to use Python as an extension language for a C++ program. I.e., the user starts my program and gives a python script, either by file name or via stdin. The python script...
27
by: scott | last post by:
Hi all, I have been looking at the various programming languages available. I have programed in Basic since I was a teenager and I also have a basic understanding of C, but I want something...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.