<!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>&nbsp;&nbsp;&nbsp;&nbsp;if..else..</FONT></DIV>
<DIV><FONT 
face=Calibri>&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;</DIV>
<DIV><FONT face=Calibri>my pypy version is pypy-pypy-2346207d9946 download 
from:</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;<A 
title="https://bitbucket.org/pypy/pypy/get/release-1.8.zip&#10;CTRL + 单击以下链接" 
href="">https://bitbucket.org/pypy/pypy/get/release-1.8.zip</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
  <DIV><FONT face=Calibri>def 
  entry_point(argv):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a = 
  [1,2,3,4]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.extend([4,5])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print 
  a<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return len(a)</FONT></DIV>
  <DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
  <DIV><FONT face=Calibri>def target(*args):<BR>&nbsp;&nbsp;&nbsp; return 
  entry_point, None</FONT></DIV>
  <DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
  <DIV><FONT face=Calibri>if __name__ == '__main__':<BR>&nbsp;&nbsp;&nbsp; 
  entry_point(sys.argv)<BR></FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Calibri>after run command:</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;translator\goal\translate.py a2.py</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Calibri>after replace 2 attach files&nbsp;: </FONT></DIV>
<DIV><FONT 
face=Calibri>&nbsp;&nbsp;&nbsp;&nbsp;pypy\translator\c\funcgen.py</FONT></DIV>
<DIV><FONT 
face=Calibri>&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>I am still work hard try to improve pypy to 
get&nbsp;readable c++ output.</FONT></DIV>
<DIV><FONT face=Calibri>Anyone interest in this ?</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>Bookaa</FONT></DIV></FONT></DIV></BODY></HTML>