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.7.tar.gz (14.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.7-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pplox-0.0.7.tar.gz
Algorithm Hash digest
SHA256 9723166287fe2be68d0ff0e151c178522e6beeb82fa4fd374e7893855774f574
MD5 fd1a92153c5a80445de677da4331ea59
BLAKE2b-256 7c17151128ec38eef57486a99d6e4b6ee0260a4af4a16a2bd9b54e8a434656af

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pplox-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1af2f7aa4302cdc05f27d9a8eb7278c7ca55bf915ea3f802afd85bf09b2e929a
MD5 64471a2711bcbaf3936d470675afb0df
BLAKE2b-256 582f0fddbd70bd811f1fa50fb192b400e289a21cc50fa652e773ae160c0af811

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