<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=gb2312 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16466"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>
<DIV><FONT face=Calibri>I find pypy translator output c files consist too many
'goto' statement.</FONT></DIV>
<DIV><FONT face=Calibri>Its hard to read and understand these c
files.</FONT></DIV>
<DIV><FONT face=Calibri>I try to make it output with c keywords:</FONT></DIV>
<DIV><FONT face=Calibri> if..else..</FONT></DIV>
<DIV><FONT
face=Calibri> while...break...continue</FONT></DIV>
<DIV><FONT face=Calibri>and now the output c file looks pretty
better.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>my pypy version is pypy-pypy-2346207d9946 download
from:</FONT></DIV>
<DIV> <A
title="https://bitbucket.org/pypy/pypy/get/release-1.8.zip CTRL + 单击以下链接"
href="">https://bitbucket.org/pypy/pypy/get/release-1.8.zip</A></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Calibri>test sample input file a2.py:</FONT></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<DIV><FONT face=Calibri>import sys</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>def
entry_point(argv):<BR> a =
[1,2,3,4]<BR> a.extend([4,5])<BR> print
a<BR> return len(a)</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>def target(*args):<BR> return
entry_point, None</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>if __name__ == '__main__':<BR>
entry_point(sys.argv)<BR></FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Calibri>after run command:</FONT></DIV>
<DIV> translator\goal\translate.py a2.py</DIV>
<DIV> </DIV>
<DIV>I can find file a2.c in my temperary directory. The funcion
pypy_g_entry_point in it is 662 lines and contains 103 goto.</DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>after replace 2 attach files : </FONT></DIV>
<DIV><FONT
face=Calibri> pypy\translator\c\funcgen.py</FONT></DIV>
<DIV><FONT
face=Calibri> pypy\translator\c\bookaa_cpp.py</FONT></DIV>
<DIV><FONT face=Calibri>and run the command again, I get a2.c with <FONT
face=宋体>pypy_g_entry_point is 539 lines and only contains 20
goto.</FONT> </FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>I am still work hard try to improve pypy to
get readable c++ output.</FONT></DIV>
<DIV><FONT face=Calibri>Anyone interest in this ?</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Bookaa</FONT></DIV></FONT></DIV></BODY></HTML>