├── .gitignore ├── CMakeLists.txt ├── README.md ├── code ├── binaryFileParser.cpp ├── binaryFileParser.hpp ├── bytecode.hpp ├── codeObject.cpp └── codeObject.hpp ├── extlib └── math.cpp ├── inc └── koshox.hpp ├── lib └── builtin.py ├── main.cpp ├── memory ├── heap.cpp ├── heap.hpp ├── oopClosure.cpp └── oopClosure.hpp ├── object ├── hiDict.cpp ├── hiDict.hpp ├── hiInteger.cpp ├── hiInteger.hpp ├── hiList.cpp ├── hiList.hpp ├── hiObject.cpp ├── hiObject.hpp ├── hiString.cpp ├── hiString.hpp ├── klass.cpp └── klass.hpp ├── runtime ├── cellObject.cpp ├── cellObject.hpp ├── frameObject.cpp ├── frameObject.hpp ├── functionObject.cpp ├── functionObject.hpp ├── generator.cpp ├── generator.hpp ├── interpreter.cpp ├── interpreter.hpp ├── module.cpp ├── module.hpp ├── stringTable.cpp ├── stringTable.hpp ├── traceback.cpp ├── traceback.hpp ├── universe.cpp └── universe.hpp ├── test ├── class1.py ├── closure.py ├── constructor.py ├── decorator.py ├── dict.py ├── dict2.py ├── dict_iterator.py ├── extends.py ├── func.py ├── func_bound.py ├── func_def.py ├── func_default_param.py ├── hello_if.py ├── hello_while.py ├── key_arg.py ├── list.py ├── list_append.py ├── list_contains.py ├── list_insert.py ├── list_iterator.py ├── list_modify.py ├── list_plus.py ├── list_sort.py ├── list_subscr.py ├── method.py ├── native_func.py ├── none.py ├── object_instance.py ├── object_prop.py ├── op_overload1.py ├── op_overload2.py ├── op_overload3.py ├── op_overload4.py ├── op_overload5.py ├── test_break.py ├── test_builtin_lib.py ├── test_continue.py ├── test_coroutine.py ├── test_exception.py ├── test_exception_trace.py ├── test_finally.py ├── test_func.py ├── test_gc1.py ├── test_generator.py ├── test_global.py ├── test_global2.py ├── test_import.py ├── test_iter_fib.py ├── test_param.py ├── test_so.py ├── type_object.py └── type_prop.py └── util ├── arrayList.cpp ├── arrayList.hpp ├── bufferedInputStream.hpp ├── handles.cpp ├── handles.hpp ├── map.cpp ├── map.hpp ├── stack.cpp └── stack.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | cmake-build-debug/ 3 | *.pyc 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/README.md -------------------------------------------------------------------------------- /code/binaryFileParser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/code/binaryFileParser.cpp -------------------------------------------------------------------------------- /code/binaryFileParser.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/code/binaryFileParser.hpp -------------------------------------------------------------------------------- /code/bytecode.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/code/bytecode.hpp -------------------------------------------------------------------------------- /code/codeObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/code/codeObject.cpp -------------------------------------------------------------------------------- /code/codeObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/code/codeObject.hpp -------------------------------------------------------------------------------- /extlib/math.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/extlib/math.cpp -------------------------------------------------------------------------------- /inc/koshox.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/inc/koshox.hpp -------------------------------------------------------------------------------- /lib/builtin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/lib/builtin.py -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/main.cpp -------------------------------------------------------------------------------- /memory/heap.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/memory/heap.cpp -------------------------------------------------------------------------------- /memory/heap.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/memory/heap.hpp -------------------------------------------------------------------------------- /memory/oopClosure.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/memory/oopClosure.cpp -------------------------------------------------------------------------------- /memory/oopClosure.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/memory/oopClosure.hpp -------------------------------------------------------------------------------- /object/hiDict.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiDict.cpp -------------------------------------------------------------------------------- /object/hiDict.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiDict.hpp -------------------------------------------------------------------------------- /object/hiInteger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiInteger.cpp -------------------------------------------------------------------------------- /object/hiInteger.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiInteger.hpp -------------------------------------------------------------------------------- /object/hiList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiList.cpp -------------------------------------------------------------------------------- /object/hiList.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiList.hpp -------------------------------------------------------------------------------- /object/hiObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiObject.cpp -------------------------------------------------------------------------------- /object/hiObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiObject.hpp -------------------------------------------------------------------------------- /object/hiString.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiString.cpp -------------------------------------------------------------------------------- /object/hiString.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/hiString.hpp -------------------------------------------------------------------------------- /object/klass.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/klass.cpp -------------------------------------------------------------------------------- /object/klass.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/object/klass.hpp -------------------------------------------------------------------------------- /runtime/cellObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/cellObject.cpp -------------------------------------------------------------------------------- /runtime/cellObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/cellObject.hpp -------------------------------------------------------------------------------- /runtime/frameObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/frameObject.cpp -------------------------------------------------------------------------------- /runtime/frameObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/frameObject.hpp -------------------------------------------------------------------------------- /runtime/functionObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/functionObject.cpp -------------------------------------------------------------------------------- /runtime/functionObject.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/functionObject.hpp -------------------------------------------------------------------------------- /runtime/generator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/generator.cpp -------------------------------------------------------------------------------- /runtime/generator.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/generator.hpp -------------------------------------------------------------------------------- /runtime/interpreter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/interpreter.cpp -------------------------------------------------------------------------------- /runtime/interpreter.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/interpreter.hpp -------------------------------------------------------------------------------- /runtime/module.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/module.cpp -------------------------------------------------------------------------------- /runtime/module.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/module.hpp -------------------------------------------------------------------------------- /runtime/stringTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/stringTable.cpp -------------------------------------------------------------------------------- /runtime/stringTable.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/stringTable.hpp -------------------------------------------------------------------------------- /runtime/traceback.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/traceback.cpp -------------------------------------------------------------------------------- /runtime/traceback.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/traceback.hpp -------------------------------------------------------------------------------- /runtime/universe.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/universe.cpp -------------------------------------------------------------------------------- /runtime/universe.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/runtime/universe.hpp -------------------------------------------------------------------------------- /test/class1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/class1.py -------------------------------------------------------------------------------- /test/closure.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/closure.py -------------------------------------------------------------------------------- /test/constructor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/constructor.py -------------------------------------------------------------------------------- /test/decorator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/decorator.py -------------------------------------------------------------------------------- /test/dict.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/dict.py -------------------------------------------------------------------------------- /test/dict2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/dict2.py -------------------------------------------------------------------------------- /test/dict_iterator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/dict_iterator.py -------------------------------------------------------------------------------- /test/extends.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/extends.py -------------------------------------------------------------------------------- /test/func.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/func.py -------------------------------------------------------------------------------- /test/func_bound.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/func_bound.py -------------------------------------------------------------------------------- /test/func_def.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/func_def.py -------------------------------------------------------------------------------- /test/func_default_param.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/func_default_param.py -------------------------------------------------------------------------------- /test/hello_if.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/hello_if.py -------------------------------------------------------------------------------- /test/hello_while.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/hello_while.py -------------------------------------------------------------------------------- /test/key_arg.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/key_arg.py -------------------------------------------------------------------------------- /test/list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list.py -------------------------------------------------------------------------------- /test/list_append.py: -------------------------------------------------------------------------------- 1 | lst = [1, 2] 2 | lst.append(0) 3 | print lst 4 | -------------------------------------------------------------------------------- /test/list_contains.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_contains.py -------------------------------------------------------------------------------- /test/list_insert.py: -------------------------------------------------------------------------------- 1 | l = [1, 2] 2 | l.insert(0, 3) 3 | print l -------------------------------------------------------------------------------- /test/list_iterator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_iterator.py -------------------------------------------------------------------------------- /test/list_modify.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_modify.py -------------------------------------------------------------------------------- /test/list_plus.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_plus.py -------------------------------------------------------------------------------- /test/list_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_sort.py -------------------------------------------------------------------------------- /test/list_subscr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/list_subscr.py -------------------------------------------------------------------------------- /test/method.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/method.py -------------------------------------------------------------------------------- /test/native_func.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/native_func.py -------------------------------------------------------------------------------- /test/none.py: -------------------------------------------------------------------------------- 1 | print None -------------------------------------------------------------------------------- /test/object_instance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/object_instance.py -------------------------------------------------------------------------------- /test/object_prop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/object_prop.py -------------------------------------------------------------------------------- /test/op_overload1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/op_overload1.py -------------------------------------------------------------------------------- /test/op_overload2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/op_overload2.py -------------------------------------------------------------------------------- /test/op_overload3.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/op_overload3.py -------------------------------------------------------------------------------- /test/op_overload4.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/op_overload4.py -------------------------------------------------------------------------------- /test/op_overload5.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/op_overload5.py -------------------------------------------------------------------------------- /test/test_break.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_break.py -------------------------------------------------------------------------------- /test/test_builtin_lib.py: -------------------------------------------------------------------------------- 1 | print range(3) -------------------------------------------------------------------------------- /test/test_continue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_continue.py -------------------------------------------------------------------------------- /test/test_coroutine.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_coroutine.py -------------------------------------------------------------------------------- /test/test_exception.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_exception.py -------------------------------------------------------------------------------- /test/test_exception_trace.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_exception_trace.py -------------------------------------------------------------------------------- /test/test_finally.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_finally.py -------------------------------------------------------------------------------- /test/test_func.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_func.py -------------------------------------------------------------------------------- /test/test_gc1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_gc1.py -------------------------------------------------------------------------------- /test/test_generator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_generator.py -------------------------------------------------------------------------------- /test/test_global.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_global.py -------------------------------------------------------------------------------- /test/test_global2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_global2.py -------------------------------------------------------------------------------- /test/test_import.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_import.py -------------------------------------------------------------------------------- /test/test_iter_fib.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_iter_fib.py -------------------------------------------------------------------------------- /test/test_param.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_param.py -------------------------------------------------------------------------------- /test/test_so.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/test_so.py -------------------------------------------------------------------------------- /test/type_object.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/type_object.py -------------------------------------------------------------------------------- /test/type_prop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/test/type_prop.py -------------------------------------------------------------------------------- /util/arrayList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/arrayList.cpp -------------------------------------------------------------------------------- /util/arrayList.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/arrayList.hpp -------------------------------------------------------------------------------- /util/bufferedInputStream.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/bufferedInputStream.hpp -------------------------------------------------------------------------------- /util/handles.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/handles.cpp -------------------------------------------------------------------------------- /util/handles.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/handles.hpp -------------------------------------------------------------------------------- /util/map.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/map.cpp -------------------------------------------------------------------------------- /util/map.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/map.hpp -------------------------------------------------------------------------------- /util/stack.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/stack.cpp -------------------------------------------------------------------------------- /util/stack.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koshox/pythonvm/HEAD/util/stack.hpp --------------------------------------------------------------------------------