Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pplox-0.0.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pplox-0.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pplox-0.0.4.tar.gz.

File metadata

  • Download URL: pplox-0.0.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pplox-0.0.4.tar.gz
Algorithm Hash digest
SHA256 669d09f444eee7e23eebd3ff24508a5ba7e57875a7a920e7dc41ec51cf9b1253
MD5 13bdce1846e7e17d8be831d304c0b001
BLAKE2b-256 0d05cd8345816b57061c06db62680b392ccdb1bfa0d487489d88f37ab2ec27dd

See more details on using hashes here.

File details

Details for the file pplox-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pplox-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pplox-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 22379d4c85795b0756c3088abb8fa0d7f476ee980b835e4bb4cfe816b9dddc82
MD5 8c07db71a19c655dcedd973b5b479f58
BLAKE2b-256 b9092a576acc11232e67bce0976c8464aae9763a8c21cb6e0d4184cf6d81e24e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page