[pypy-svn] r23046 - pypy/dist/pypy/bin

cfbolz at codespeak.net cfbolz at codespeak.net
Sun Feb 5 18:56:14 CET 2006


Author: cfbolz
Date: Sun Feb  5 18:56:12 2006
New Revision: 23046

Modified:
   pypy/dist/pypy/bin/translator.py
Log:
fix the interactive translator frontend to use translator/interactive.py. Some
work needs to be done to document the usage with llvm better -- can't test that
anywhere right now.


Modified: pypy/dist/pypy/bin/translator.py
==============================================================================
--- pypy/dist/pypy/bin/translator.py	(original)
+++ pypy/dist/pypy/bin/translator.py	Sun Feb  5 18:56:12 2006
@@ -8,31 +8,19 @@
 
 Example:
 
-    t = Translator(func)
+    t = Translation(func)
     t.view()                           # control flow graph
 
-    print t.source()                   # original source
-    print t.c()                        # C translation
-    print t.cl()                       # common lisp translation
-    print t.llvm()                     # LLVM translation
-
-    t.simplify()                       # flow graph simplification
-    a = t.annotate([int])              # pass the list of args types
-    a.simplify()                       # simplification by annotator
+    t.annotate([int])                  # pass the list of args types
     t.view()                           # graph + annotations under the mouse
 
-    t.call(arg)                        # call original function
-    t.dis()                            # bytecode disassemble
-
-    t.specialize()                     # use low level operations 
-    f = t.ccompile()                   # C compilation
-    mod = t.llvmcompile()              # LLVM compilation
+    t.rtype()                          # use low level operations 
+    f = t.compile_c()                  # C compilation
     assert f(arg) == func(arg)         # sanity check (for C)
-    assert mod.pypy_func_wrapper(arg) == func(arg)     # sanity check (for LLVM)
     
 
 Some functions are provided for the benefit of interactive testing.
-Try dir(test) for list of current snippets.
+Try dir(snippet) for list of current snippets.
 
 For extra features start this script with a -h option.
 """
@@ -54,7 +42,7 @@
 
 
 import autopath, os, sys
-from pypy.translator.translator import Translator
+from pypy.translator.interactive import Translation
 from pypy.rpython.rtyper import *
 from pypy.rpython.rarithmetic import *
 
@@ -233,8 +221,7 @@
         setup_readline()
     except ImportError, err:
         print "Disabling readline support (%s)" % err
-    from pypy.translator.test import snippet as test
-    #from pypy.translator.llvm.test import llvmsnippet as test2
+    from pypy.translator.test import snippet
     from pypy.rpython.rtyper import RPythonTyper
 
     if (os.getcwd() not in sys.path and



More information about the Pypy-commit mailing list