Interpreter for the Lox programming language
Project description
Interpreter for the Lox programming language
Getting Started
pip install pplox
Create your lox file. For example, hello_world.lox
print "Hello world"
Tokenize the file with pplox --tokenize hello_world.lox.
Parse the file with pplox --parse hello_world.lox.
See the documentation for more details.
Library Usage
pplox can also be used as a library in your own Python projects. For example, if you want to implement your own Lox interpreter but want to skip writing the scanner, you can use pplox' scanner like so:
from pplox.scanner import Scanner
scanner = Scanner('print "Hello world"')
tokens = scanner.scan_tokens()
This gives you a list of tokens to be parsed and interpreted.
See https://github.com/karlcaga/pplox_web/ for an example application of pplox being used as a library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pplox-0.0.6.tar.gz.
File metadata
- Download URL: pplox-0.0.6.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4613d5ac9a3ff7d5ce2c2fcbcde28398bf590c1395ec5ac99b5c13bb5cfa5e02
|
|
| MD5 |
57c485739107de591eedcba7e49523ea
|
|
| BLAKE2b-256 |
94fef060c7f0738d868c4ee49bcbb647835c3bb13923356b865d2555e87b633a
|
File details
Details for the file pplox-0.0.6-py3-none-any.whl.
File metadata
- Download URL: pplox-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc2aebff14a08066552110a2a9e09015dc1b6b9692a0c78d89d839b468c652a5
|
|
| MD5 |
3e604458569594607140fe8cddc1e5f8
|
|
| BLAKE2b-256 |
fe1bc53e9600964a0b266e95d7790d679a52ddc237083298e760d251c8a63bb8
|