Skip to content
/ ToyPy Public

A toy Python 3 interpreter written in pure Python, just for fun.

Notifications You must be signed in to change notification settings

travcunn/ToyPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToyPy

A toy Python 3 interpreter written in pure Python, just for fun.

Features

Working example

Test file - test.py:

# The parser handles order of operations, making our interpreter more simple
x = 3 + 16 * 2
y = 5 - 16 / 2
z = 5 - 16 / 2 * 52 + 9 * 2 / 18 + 82 - (52 / 2) / 82 - 2

# Test reassignment
b = 5 + 1
b = 6 + 2

Execution:

# The interpreter reads a file called test.py
> python interpreter.py
Parsing time (seconds): 0.0014879070000000105
Execution time (seconds): 3.261599999992981e-05
========= Stack Locals ==========
{'x': 35, 'y': -3.0, 'z': -330.3170731707317, 'b': 8}

Future Work

About

A toy Python 3 interpreter written in pure Python, just for fun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages