wiki:Reblok
Last modified 3 years ago Last modified on 10/07/11 13:31:48

Reblok

Introduction

Reblok logo

Reblok build an Abstract Syntax Tree (AST) from a python bytecode (typically found in .pyc files).

Example

>>> from reblok import Parser
>>> add = lambda x: x + 1
>>> print Parser().walk(add)
['function', '<lambda>', [['ret', ('add', ('var', 'x', 'local'), ('const', 1))]], [('x', '<undef>')], None, None, [], {}]

Documentation

Changes

  • 0.1.0 - initial release
    • library to build AST from python binary code/file (.pyc/.pyo)
    • AST opcodes documentation
  • 0.1.1 - unittests/binary
    • partial unittests (of reblok library)
    • reblok binary (uncompile python binary file and print out matching source code) (partially implemented)
    • new TUPLE opcode: disctinct tuples from lists with specific opcode
  • 0.1.2
    • new supported opcodes: DELETE_LOCAL, DELETE_GLOBAL, DELETE_NAME, UNPACK_SEQUENCE, BREAK_LOOP, STORE_ATTR
    • fix: loop iteration variable is now a reblok instruction
    • add new options to reblok program: display python opcodes, display AST tree
    • unittests for reblok program

TODO

Download

Contact

Reblok is written by Guillaume Bour <guillaume@…>

License

Reblok is distributed under GNU GPL v3 License.

Attachments