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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pplox-0.0.5.tar.gz
  • Upload date:
  • Size: 11.9 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.5.tar.gz
Algorithm Hash digest
SHA256 76afed2f8d688f6a7bc64245e29ec55d11be6ecfc01d3cefa5b04dd804941acf
MD5 d16973b0c0e0952c338c194e5ada8171
BLAKE2b-256 f24721e35a10938158c7adb04a17ee7fe7355cb6d0a01fb5eca5773aaa482fac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pplox-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e3a25f4a2d41d87a152b7c1605fa2e427dc7169bf5ee3b568be92781c34d2f
MD5 72779b2be1dc365ed41272eb8ce06a42
BLAKE2b-256 747ec8d71f0fe92f7692625595d43ec787b815b74cb28cec680e113b325a7feb

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