2015-07-13 01:16:50 +02:00
2015-07-11 23:23:21 +02:00
2015-07-11 23:37:51 +02:00
2015-07-07 13:50:04 +02:00
2015-07-07 13:50:04 +02:00
2015-07-13 01:16:50 +02:00
2015-07-07 13:51:15 +02:00

###IMProved

IMProved aims to build an interpreter for IMP (based on this) that is fully documented, occassionally improved and embeddable into Python 3.

As you may notice, I am bad at documentation.

###Installation

The package has a setuptools toolchain, but is not (yet?) on pip, which means that installation has to be performed manually. The process looks like this:

git clone https://github.com/hellerve/IMProved
cd IMProved
python setup.py install

And you're good to go!

###Usage

Easy!

import improved

improved.callIMP("n := 5")
# this will return a dictionary containing the key/value pair n/5

For a less contrived example, let's calculate the nth fibonacci number where n is user input:

import improved

x = """
  n := read;
  fib := 1;
  while n > 1 do
    fib := n * fib;
    n := n -1
  end;
  write fib
"""

improved.callIMP(x)
Description
An embeddable IMP interpreter in Python
Readme 240 KiB
Languages
Python 100%