Groups
Sign in
Groups
rpython
Conversations
About
Send feedback
Help
Automatic Translation of C to RPython
13 views
Skip to first unread message
HartsAntler
unread,
Sep 28, 2010, 3:10:06 AM
9/28/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rpython, eli...@gmail.com
Just starting this project, at the moment it can only translate a
subset of C to Python.
http://code.google.com/p/rpythonic/
# input C code
struct {
int id;
char* name;
} joe;
void foo(void) {
printf("hi");
}
int bar( char x ) {
if (x=="A") { return 1; }
if (x=="B") { return 2; }
}
int main()
{
int i;
int j;
j=55;
while (i<10) {
foo();
bar( "A" );
i += 1;
}
return 0;
}
# output Python code
class joe(object):
id=0 #declare
name = [""] # <pointer>
def foo( ):
printf( "hi", )
def bar( x, ):
if (x == "A"):
return 1
if (x == "B"):
return 2
def main( ):
i=0 #declare
j=0 #declare
j = 55
while (i < 1000000000):
foo( )
bar( "A", )
i += 1
return 0
Reply all
Reply to author
Forward
0 new messages