code
stringlengths
1
1.72M
language
stringclasses
1 value
from ctypes import c_char, c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint from ctypes import c_long, c_ulong, c_longlong, c_ulonglong, c_float from ctypes import c_double, c_wchar, c_char_p from pypy.annotation import model as annmodel from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry f...
Python
#! /usr/bin/env python import os, py, sys import ctypes from pypy.translator.tool.cbuild import build_executable from pypy.tool.udir import udir # ____________________________________________________________ # # Helpers for simple cases def getstruct(name, c_header_source, interesting_fields): class CConfig: ...
Python
#! /usr/bin/env python """ Usage: compilemodule.py <module-name> Compiles the PyPy extension module from pypy/module/<module-name>/ into a regular CPython extension module. """ import autopath import sys import shutil import os from optparse import OptionParser from pypy.tool.error import debug def compilemodule(m...
Python
#! /usr/bin/env python import os, py, sys import ctypes from pypy.translator.tool.cbuild import build_executable from pypy.tool.udir import udir # ____________________________________________________________ # # Helpers for simple cases def getstruct(name, c_header_source, interesting_fields): class CConfig: ...
Python
import sys from ctypes import * # __________ the standard C library __________ # LoadLibrary is deprecated in ctypes, this should be removed at some point if "load" in dir(cdll): cdll_load = cdll.load else: cdll_load = cdll.LoadLibrary if sys.platform == 'win32': libc = cdll_load('msvcrt.dll') elif sys.p...
Python
""" This is the module 'ctypes.util', copied from ctypes 0.9.9.6. """ import sys, os import ctypes # find_library(name) returns the pathname of a library, or None. if os.name == "nt": def find_library(name): # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep)...
Python
""" self cloning, automatic path configuration copy this into any subdirectory of pypy from which scripts need to be run, typically all of the test subdirs. The idea is that any such script simply issues import autopath and this will make sure that the parent directory containing "pypy" is in sys.path. If y...
Python
#! /usr/bin/env python """ Usage: compilemodule.py <module-name> Compiles the PyPy extension module from pypy/module/<module-name>/ into a regular CPython extension module. """ import autopath import sys import shutil import os from optparse import OptionParser from pypy.tool.error import debug def compilemodule(m...
Python
#empty
Python
from pypy.rlib import rarithmetic from pypy.rpython.lltypesystem import lltype import ctypes def c_type_size(c_type): bits = 0 while c_type(1<<bits).value != 0: bits += 1 sign = c_type(-1).value < 0 return sign, bits def setup(): for _name in 'byte short int long longlong'.split(): ...
Python
from ctypes import py_object from pypy.annotation.model import SomeCTypesObject, SomeObject from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry from pypy.rpython.lltypesystem import lltype from pypy.tool.uid import Hashable class CallEntry(CTypesCallEntry): "Annotation and rtyping of c...
Python
from ctypes import ARRAY, c_int, c_char from pypy.annotation.model import SomeCTypesObject, SomeString from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry from pypy.rpython.lltypesystem import lltype ArrayType = type(ARRAY(c_int, 10)) class VarSizedArrayType(object): """Placeholder for...
Python
from pypy.rpython.rctypes.rmodel import CTypesValueRepr, C_ZERO from pypy.rpython.rctypes.rstringbuf import StringBufRepr from pypy.annotation.pairtype import pairtype from pypy.rpython.rstr import AbstractStringRepr from pypy.rpython.lltypesystem.rstr import string_repr from pypy.rpython.rctypes.rchar_p import CCharPR...
Python
#empty
Python
from pypy.rpython.rtyper import inputconst from pypy.rpython.rctypes.rmodel import CTypesValueRepr, CTypesRefRepr from pypy.rpython.rctypes.afunc import CFuncPtrType from pypy.rpython.error import TyperError from pypy.rpython.lltypesystem import lltype from pypy.annotation import model as annmodel from pypy.annotation....
Python
# Base classes describing annotation and rtyping from pypy.annotation.model import SomeCTypesObject from pypy.rpython import extregistry from pypy.rpython.extregistry import ExtRegistryEntry import ctypes if ctypes.__version__ < '0.9.9.6': # string comparison... good enough? raise ImportError("requires ctypes >= ...
Python
""" Var-sized arrays, i.e. arrays whose size is not known at annotation-time. """ from pypy.annotation.model import SomeCTypesObject from pypy.annotation.model import SomeBuiltin, SomeInteger, SomeString from pypy.annotation.pairtype import pair, pairtype from pypy.rpython.extregistry import ExtRegistryEntry class S...
Python
import py class Directory(py.test.collect.Directory): def run(self): try: import ctypes except ImportError: py.test.skip("these tests need ctypes installed") return super(Directory, self).run()
Python
from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.rpython.lltypesystem.lltype import Signed, Unsigned, Bool, Float from pypy.rpython.error import TyperError from pypy.rpython.rmodel import IntegerRepr, BoolRepr from pypy.rpython.robject import PyObjRepr, pyobj_repr fr...
Python
from pypy.annotation.pairtype import pairtype, extendabletype, pair from pypy.annotation import model as annmodel from pypy.annotation import description from pypy.objspace.flow.model import Constant from pypy.rpython.lltypesystem.lltype import \ Void, Bool, Float, Signed, Char, UniChar, \ typeOf, LowLevelTyp...
Python
""" The code needed to flow and annotate low-level helpers -- the ll_*() functions """ import types from pypy.tool.sourcetools import valid_identifier from pypy.annotation import model as annmodel from pypy.annotation.policy import AnnotatorPolicy, Sig from pypy.rpython.lltypesystem import lltype from pypy.rpython imp...
Python
""" RTyper: converts high-level operations into low-level operations in flow graphs. The main class, with code to walk blocks and dispatch individual operations to the care of the rtype_*() methods implemented in the other r* modules. For each high-level operation 'hop', the rtype_*() methods produce low-level operati...
Python
from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.rpython.lltypesystem.lltype import \ PyObject, Ptr, Void, pyobjectptr, nullptr, Bool from pypy.rpython.rmodel import Repr, VoidRepr, inputconst from pypy.rpython import rclass from pypy.tool.sourcetools import fun...
Python
import types from pypy.annotation import model as annmodel #from pypy.annotation.classdef import isclassdef from pypy.annotation import description from pypy.rpython.error import TyperError from pypy.rpython.rmodel import Repr, getgcflavor def getclassrepr(rtyper, classdef): try: result = rtyper.class_repr...
Python
import weakref import UserDict from pypy.tool.uid import Hashable class AutoRegisteringType(type): def __init__(selfcls, name, bases, dict): super(AutoRegisteringType, selfcls).__init__(selfcls, name, bases, dict) if '_about_' in dict: ...
Python
from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.objspace.flow.model import Constant from pypy.rpython.lltypesystem import lltype, rclass, llmemory from pypy.rpython import rint, raddress from pypy.rlib import rarithmetic, rstack, objectmodel from pypy.rpython.error ...
Python
from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.objspace.flow.model import Constant from pypy.rpython.lltypesystem import lltype from pypy.rlib.rarithmetic import r_uint from pypy.rlib.objectmodel import hlinvoke from pypy.rpython import robject from pypy.rlib impor...
Python
#!/usr/bin/env python import ctypes import py def primitive_pointer_repr(tp_s): return 'lltype.Ptr(lltype.FixedSizeArray(%s, 1))' % tp_s # XXX any automatic stuff here? SIMPLE_TYPE_MAPPING = { ctypes.c_ubyte : 'rffi.UCHAR', ctypes.c_byte : 'rffi.CHAR', ctypes.c_char : 'rffi.CHAR', ...
Python
#!/usr/bin/env python import ctypes import py def primitive_pointer_repr(tp_s): return 'lltype.Ptr(lltype.FixedSizeArray(%s, 1))' % tp_s # XXX any automatic stuff here? SIMPLE_TYPE_MAPPING = { ctypes.c_ubyte : 'rffi.UCHAR', ctypes.c_byte : 'rffi.CHAR', ctypes.c_char : 'rffi.CHAR', ...
Python
from pypy.rpython.rmodel import Repr, inputconst from pypy.rpython.rrange import AbstractRangeRepr from pypy.rpython.rint import IntegerRepr from pypy.rpython.rlist import AbstractBaseListRepr from pypy.rpython.error import TyperError from pypy.rpython.lltypesystem import lltype, llmemory from pypy.rpython.lltypesystem...
Python
from pypy.rpython.extregistry import ExtRegistryEntry from pypy.annotation.pairtype import pairtype from pypy.annotation.model import SomeExternalObject, SomeList, SomeImpossibleValue from pypy.annotation.model import SomeInteger, SomeFloat, SomeString, SomeChar from pypy.annotation.listdef import ListDef from pypy.rpy...
Python
#empty
Python
# Base classes describing annotation and rtyping from pypy.annotation.model import SomeCTypesObject from pypy.rpython import extregistry from pypy.rpython.extregistry import ExtRegistryEntry # Importing for side effect of registering types with extregistry import pypy.rpython.numpy.aarray
Python
import py class Directory(py.test.collect.Directory): def run(self): try: import numpy except ImportError: py.test.skip("these tests need numpy installed") return super(Directory, self).run()
Python
from pypy.objspace.flow.model import FunctionGraph, Constant, Variable, c_last_exception from pypy.rlib.rarithmetic import intmask, r_uint, ovfcheck, r_longlong from pypy.rlib.rarithmetic import r_ulonglong, ovfcheck_lshift from pypy.rpython.lltypesystem import lltype, llmemory, lloperation, llheap from pypy.rpython.ll...
Python
""" Dummy low-level implementations for the external functions of the 'time' module. """ # See ll_os.py. import time def ll_time_time(): return time.time() ll_time_time.suggested_primitive = True def ll_time_clock(): return time.clock() ll_time_clock.suggested_primitive = True def ll_time_sleep(t): ti...
Python
from pypy.rpython.lltypesystem import lltype from pypy.rlib import rstack from pypy.rpython import extfunctable from pypy.rpython.module.support import from_opaque_object, to_opaque_object FRAMETOPTYPE = extfunctable.frametop_type_info.get_lltype() def ll_stackless_stack_frames_depth(): return rstack.stack_frame...
Python
from pypy.rlib import rstack def ll_stack_too_big(): return rstack.stack_too_big() ll_stack_too_big.suggested_primitive = True def ll_stack_unwind(): rstack.stack_unwind() ll_stack_unwind.suggested_primitive = True def ll_stack_capture(): return rstack.stack_capture() ll_stack_capture.suggested_primitive...
Python
from pypy.rpython.lltypesystem import lltype from pypy.rpython.ootypesystem import ootype from pypy.rpython import extfunctable from pypy.rpython.lltypesystem.lltype import \ GcStruct, Signed, Array, Char, Ptr, malloc, GcArray from pypy.rpython.rlist import ll_append from pypy.rpython.lltypesystem.rlist import ll_...
Python
#
Python
""" Dummy low-level implementations for the external functions of the 'os.path' module. """ # see ll_os.py for comments import stat import os from pypy.tool.staticmethods import ClassMethods # Does a path exist? # This is false for dangling symbolic links. class BaseOsPath: __metaclass__ = ClassMethods def...
Python
""" The low-level implementation of termios module note that this module should only be imported when termios module is there """ import termios from pypy.rpython.lltypesystem import rffi from pypy.rpython.lltypesystem import lltype from pypy.rpython.extfunc import register_external from pypy.rlib.rarithmetic import ...
Python
#
Python
""" Low-level implementations for the external functions of the 'os' module. """ # actual idea might be found in doc/rffi.txt # ------------------------------------------ # WARNING! old vision, don't use it WARNING! # ------------------------------------------ # Idea: each ll_os_xxx() function calls back the os.xxx(...
Python
from pypy.rpython.error import TyperError from pypy.rpython.rmodel import inputconst def rtype_call_specialcase(hop): s_pbc = hop.args_s[0] if len(s_pbc.descriptions) != 1: raise TyperError("not monomorphic call_specialcase") desc, = s_pbc.descriptions tag = desc.pyobj._annspecialcase_ if ...
Python
from pypy.rpython.rmodel import Repr from pypy.rpython.lltypesystem.lltype import Signed, Void from pypy.objspace.flow.model import Constant from pypy.annotation import model as annmodel from pypy.rpython.error import TyperError class AbstractSliceRepr(Repr): pass def select_slice_repr(self): # Select which ...
Python
from pypy.annotation import model as annmodel from pypy.rpython.lltypesystem import lltype from pypy.rpython.ootypesystem import ootype, bltregistry from pypy.rpython.rmodel import Repr from pypy.annotation.signature import annotation from pypy.annotation.pairtype import pairtype class ExternalInstanceRepr(Repr):...
Python
from pypy.annotation.pairtype import pairtype from pypy.rpython.rlist import AbstractBaseListRepr, AbstractListRepr, \ AbstractListIteratorRepr, rtype_newlist, rtype_alloc_and_set from pypy.rpython.rmodel import Repr, IntegerRepr from pypy.rpython.rmodel import inputconst, externalvsinternal from pypy.rpython.l...
Python
from pypy.rpython.rmodel import CanBeNull, Repr, inputconst, impossible_repr from pypy.rpython.rpbc import AbstractClassesPBCRepr, AbstractMethodsPBCRepr, \ AbstractMultipleFrozenPBCRepr, MethodOfFrozenPBCRepr, \ AbstractFunctionsPBCRepr, AbstractMultipleUnrelatedFrozenPBCRepr, \ none_frozen_pbc...
Python
from pypy.rpython.rmodel import inputconst from pypy.rpython.rtuple import AbstractTupleRepr, AbstractTupleIteratorRepr from pypy.rpython.ootypesystem import ootype from pypy.rpython.ootypesystem import rstr class TupleRepr(AbstractTupleRepr): rstr_ll = rstr.LLHelpers def __init__(self, rtyper, items_r): ...
Python
from pypy.rpython.ootypesystem import ootype # ____________________________________________________________ # Implementation of the 'canfold' oo operations def op_ooupcast(INST, inst): return ootype.ooupcast(INST, inst) op_ooupcast.need_result_type = True def op_oodowncast(INST, inst): return ootype.oodownc...
Python
from pypy.rpython.lltypesystem.lltype import LowLevelType, Signed, Unsigned, Float, Char from pypy.rpython.lltypesystem.lltype import Bool, Void, UniChar, typeOf, \ Primitive, isCompatibleType, enforce, saferecursive, SignedLongLong, UnsignedLongLong from pypy.rpython.lltypesystem.lltype import frozendict, isCo...
Python
from pypy.rpython.exceptiondata import AbstractExceptionData from pypy.rpython.ootypesystem import rclass from pypy.rpython.ootypesystem import ootype from pypy.annotation import model as annmodel from pypy.annotation.classdef import FORCE_ATTRIBUTES_INTO_CLASSES class ExceptionData(AbstractExceptionData): """Publ...
Python
from pypy.rpython.extregistry import ExtRegistryEntry from pypy.annotation import model as annmodel from pypy.rpython.ootypesystem import ootype class Entry_oostring(ExtRegistryEntry): _about_ = ootype.oostring def compute_result_annotation(self, obj_s, base_s): assert isinstance(obj_s, (annmodel.Some...
Python
import sys from pypy.rpython.ootypesystem.ootype import new, oostring, StringBuilder from pypy.rpython.ootypesystem.ootype import make_string def ll_int_str(repr, i): return ll_int2dec(i) def ll_int2dec(i): return oostring(i, 10) SPECIAL_VALUE = -sys.maxint-1 SPECIAL_VALUE_HEX = make_string( '-' + he...
Python
import types from pypy.annotation import model as annmodel from pypy.annotation import description from pypy.objspace.flow import model as flowmodel from pypy.rpython.rmodel import inputconst, TyperError, warning from pypy.rpython.rmodel import mangle as pbcmangle from pypy.rpython.rclass import AbstractClassRepr, Abst...
Python
from pypy.annotation import model as annmodel from pypy.rpython.ootypesystem import ootype, rootype from pypy.rpython.ootypesystem import rclass from pypy.rpython.ootypesystem.rdict import rtype_r_dict from pypy.objspace.flow.model import Constant from pypy.rlib import objectmodel from pypy.rpython.error import TyperEr...
Python
from pypy.rpython.error import TyperError from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.objspace.flow.model import Constant from pypy.rpython.rdict import AbstractDictRepr, AbstractDictIteratorRepr,\ rtype_newdict, dum_variant, dum_keys, dum_values, dum_items...
Python
""" extdesc - some descriptions for external entries """ from pypy.annotation.signature import annotation class ArgDesc(object): """ Description of argument, given as name + example value (used to deduce type) """ def __init__(self, name, _type): self.name = name self._type = _type ...
Python
import math from pypy.rpython.ootypesystem import ootype FREXP_RESULT = ootype.Record({"item0": ootype.Float, "item1": ootype.Signed}) MODF_RESULT = ootype.Record({"item0": ootype.Float, "item1": ootype.Float}) def ll_frexp_result(mantissa, exponent): tup = ootype.new(FREXP_RESULT) tup.item0 = mantissa tu...
Python
from pypy.rlib import rarithmetic from pypy.rpython.module.support import OOSupport from pypy.tool.staticmethods import ClassMethods class Implementation(object, OOSupport): __metaclass__ = ClassMethods def ll_strtod_formatd(cls, fmt, x): return cls.to_rstr(rarithmetic.formatd(cls.from_rstr(fmt), x)) ...
Python
from pypy.rpython.module.support import OOSupport from pypy.rpython.module.ll_os_path import BaseOsPath class Implementation(BaseOsPath, OOSupport): pass
Python
import os from pypy.rpython.module.support import OOSupport from pypy.rpython.module.ll_os import BaseOS from pypy.rpython.ootypesystem import ootype from pypy.rlib.rarithmetic import intmask def _make_tuple(FIELDS): n = len(FIELDS) fieldnames = ['item%d' % i for i in range(n)] fields = dict(zip(fieldnames...
Python
from pypy.rpython.rslice import AbstractSliceRepr from pypy.rpython.lltypesystem.lltype import Void, Signed from pypy.rpython.ootypesystem import ootype SLICE = ootype.Instance('Slice', ootype.ROOT, {'start': Signed, 'stop': Signed}) class SliceRepr(AbstractSliceRepr): pass startstop_slice_repr = SliceRepr() sta...
Python
from pypy.annotation import model as annmodel from pypy.rpython.rmodel import Repr from pypy.rpython.ootypesystem import ootype from pypy.rpython.ootypesystem.ootype import Void, Class from pypy.annotation.pairtype import pairtype class __extend__(annmodel.SomeOOClass): def rtyper_makerepr(self, rtyper): r...
Python
from pypy.rpython.ootypesystem.ootype import Signed, Record, new from pypy.rpython.rrange import AbstractRangeRepr, AbstractRangeIteratorRepr RANGE = Record({"start": Signed, "stop": Signed}) RANGEITER = Record({"next": Signed, "stop": Signed}) RANGEST = Record({"start": Signed, "stop": Signed, "step": Signed}) RANGE...
Python
""" External objects registry, """ from pypy.annotation import model as annmodel from pypy.objspace.flow.model import Variable, Constant from pypy.rpython.ootypesystem import ootype from pypy.annotation.bookkeeper import getbookkeeper from pypy.rpython.lltypesystem.lltype import frozendict, isCompatibleType from type...
Python
from pypy.rpython.error import TyperError from pypy.rpython.rstr import AbstractStringRepr,AbstractCharRepr,\ AbstractUniCharRepr, AbstractStringIteratorRepr,\ AbstractLLHelpers from pypy.rpython.rmodel import IntegerRepr from pypy.rpython.lltypesystem.lltype import Ptr, Char, UniChar from pypy.rpython.ootype...
Python
from pypy.rpython.rgeneric import AbstractGenericCallableRepr from pypy.rpython.ootypesystem import ootype class GenericCallableRepr(AbstractGenericCallableRepr): def create_low_leveltype(self): l_args = [r_arg.lowleveltype for r_arg in self.args_r] l_retval = self.r_result.lowleveltype re...
Python
from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.objspace.flow import model as flowmodel from pypy.rpython.lltypesystem import lltype from pypy.rpython.error import TyperError from pypy.rpython.rmodel import Repr, IntegerRepr from pypy.rlib.rarithmetic import r_uint ...
Python
#
Python
from pypy.annotation.pairtype import pairtype from pypy.rpython.error import TyperError from pypy.rpython.lltypesystem.lltype import Signed, Void, Ptr from pypy.rpython.rmodel import Repr, IntegerRepr, IteratorRepr from pypy.objspace.flow.model import Constant from pypy.rpython.rlist import dum_nocheck, dum_checkidx ...
Python
from pypy.tool.pairtype import pairtype from pypy.objspace.flow.model import Constant from pypy.rpython.rmodel import Repr from pypy.rpython.error import TyperError class ControlledInstanceRepr(Repr): def __init__(self, rtyper, s_real_obj, controller): self.rtyper = rtyper self.s_real_obj = s_rea...
Python
from pypy.annotation import model as annmodel from pypy.annotation.pairtype import pairtype from pypy.annotation.bookkeeper import getbookkeeper from pypy.rpython.extregistry import ExtRegistryEntry from pypy.rpython.annlowlevel import cachedtype from pypy.rpython.error import TyperError class ControllerEntry(ExtRegi...
Python
from pypy.tool.staticmethods import StaticMethods from pypy.annotation.pairtype import pairtype, pair from pypy.annotation import model as annmodel from pypy.rpython.error import TyperError from pypy.rpython.rmodel import IntegerRepr, IteratorRepr from pypy.rpython.rmodel import inputconst, Repr from pypy.rpython.rtupl...
Python
""" information table about external functions for annotation/rtyping and backends """ import os import time import types from pypy.rlib.rarithmetic import r_longlong class ExtFuncInfo: def __init__(self, func, annotation, ll_function_path, ll_annotable, backend_functiontemplate): self.func = func ...
Python
from pypy.annotation import model as annmodel from pypy.rpython.rmodel import Repr from pypy.rpython.rpbc import AbstractFunctionsPBCRepr,\ AbstractMethodsPBCRepr from pypy.annotation.pairtype import pairtype from pypy.rpython.lltypesystem import lltype class AbstractGenericCallableRepr(Repr): def __init__(se...
Python
# rtyping of memory address operations from pypy.annotation.pairtype import pairtype from pypy.annotation import model as annmodel from pypy.rpython.memory.lladdress import _address from pypy.rpython.lltypesystem.llmemory import NULL, Address, \ cast_adr_to_int, WeakGcAddress from pypy.rpython.rmodel import Repr, ...
Python
# generic def simple1(): return 1 def simple2(): return False def not1(n): return not n def not2(n): t = not n if not n: t += 1 return t # bools def bool1(n): if n: return 3 return 5 def bool_cast1(n): n += bool(False) n += bool(True) n += bool...
Python
#
Python
import py from pypy.rpython.ootypesystem import ootype from pypy.rpython.lltypesystem import lltype from pypy.rpython.test.test_llinterp import gengraph, interpret, interpret_raises class BaseRtypingTest(object): def gengraph(self, func, argtypes=[], viewbefore='auto', policy=None, backendopt=False, ...
Python
import py, sys, os from py.__.test.outcome import Failed from pypy.interpreter.gateway import app2interp_temp from pypy.interpreter.error import OperationError from pypy.tool.pytest import appsupport from pypy.tool.option import make_config, make_objspace from inspect import isclass, getmro from pypy.tool.udir import u...
Python
import os import py from pypy.tool.udir import udir from pypy.translator.translator import TranslationContext from pypy.translator.lisp.gencl import GenCL from pypy.translator.lisp.clrepr import clrepr from pypy import conftest from pypy.translator.lisp import conftest as clconftest global_cl = None def is_on_path(n...
Python
import types from pypy.tool.udir import udir from pypy.objspace.flow.model import Constant, c_last_exception, FunctionGraph from pypy.translator.translator import graphof from pypy.rpython.ootypesystem.ootype import dynamicType, oodowncast, null, Record, Instance, _class, _static_meth, _meth, ROOT from pypy.rpython.oo...
Python
import py Option = py.test.config.Option option = py.test.config.addoptions('pypy-cl options', Option('--prettyprint', action='store_true', dest='prettyprint', default=False, help='pretty-print Common Lisp source'))
Python
from pypy.rpython.ootypesystem.ootype import List, Dict, Record, Instance from pypy.rpython.ootypesystem.ootype import DictItemsIterator from pypy.translator.lisp.clrepr import clrepr class OpFormatter: def __init__(self, gen, op): self.gen = gen self.op = op self.opname = op.opname ...
Python
from pypy.objspace.flow.model import Constant, Variable, Atom from pypy.rpython.ootypesystem.ootype import List, Record, Instance from pypy.rpython.ootypesystem.ootype import Signed, Unsigned, Float, Char from pypy.rpython.ootypesystem.ootype import Bool, Void, UniChar, Class from pypy.rpython.ootypesystem.ootype impor...
Python
# empty
Python
""" self cloning, automatic path configuration copy this into any subdirectory of pypy from which scripts need to be run, typically all of the test subdirs. The idea is that any such script simply issues import autopath and this will make sure that the parent directory containing "pypy" is in sys.path. If y...
Python
import py from pypy.tool.ansi_print import ansi_log log = py.log.Producer("oosupport") py.log.setconsumer("oosupport", ansi_log) from pypy.objspace.flow import model as flowmodel from pypy.rpython.ootypesystem import ootype from pypy.translator.oosupport.treebuilder import SubOperation from pypy.translator.oosupport...
Python
from pypy.rpython.lltypesystem.lloperation import LLOp, LL_OPERATIONS as LL_OPS from pypy.rpython.ootypesystem import ootype from pypy.objspace.flow import model as flowmodel LL_OPERATIONS = { 'clibox': LLOp(oo=True, canfold=True), 'cliunbox': LLOp(oo=True, canfold=True), 'cli_new...
Python
""" Varius microopcodes for different ootypesystem based backends These microopcodes are used to translate from the ootype operations to the operations of a particular backend. For an example, see cli/opcodes.py which maps from ootype opcodes to sets of metavm instructions. See the MicroInstruction class for discus...
Python
""" This module contains code and tests that can be shared between the various ootypesystem based backends. """
Python
""" basic oogenerator """ from pypy.translator.oosupport import constant as ooconst class GenOO(object): TypeSystem = None Function = None Database = None opcodes = None log = None # Defines the subclasses used to represent complex constants by # _create_complex_const: ConstantGen...
Python
from pypy.translator.oosupport.constant import is_primitive from pypy.rpython.ootypesystem import ootype class Database(object): def __init__(self, genoo): self.genoo = genoo self.cts = genoo.TypeSystem(self) self._pending_nodes = set() self._rendered_nodes = set() self._un...
Python
""" ___________________________________________________________________________ Constants Complex code for representing constants. For each complex constant, we create an object and record it in the database. These objects contain the knowledge about how to access the value of the constant, as well as the how to ini...
Python
""" Support classes needed for javascript to translate """
Python
""" mochikit wrappers """ from pypy.rpython.extfunc import genericcallable, register_external from pypy.rpython.ootypesystem.bltregistry import BasicExternal, MethodDesc from pypy.translator.js.modules import dom # MochiKit.LoggingPane def createLoggingPane(var): pass register_external(createLoggingPane, args=[...
Python
"""Document Object Model support this provides a mock browser API, both the standard DOM level 2 stuff as the browser-specific additions in addition this provides the necessary descriptions that allow rpython code that calls the browser DOM API to be translated note that the API is not and w...
Python
import string import types ## json.py implements a JSON (http://json.org) reader and writer. ## Copyright (C) 2005 Patrick D. Logan ## Contact mailto:patrickdlogan@stardecisions.com ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser Genera...
Python