Skip to main content

An extension to Lark that generates a Javascript standalone

Project description

Lark.js - a port of the Lark parsing toolkit to Javascript

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.

With Lark.js, you create a fast Javascript parser from a grammar written for Lark.

The compiled Javascript modules include Lark's base classes and utilities, such as Tree, Transformer, and InteractiveParser.

Currently, only LALR(1) is supported. (Earley support is planned!)

Quick links

Install Lark.js

$ pip install lark-js --upgrade

Build Status

Generate a Javascript LALR(1) parser

	python -m lark-js my_grammar.lark -o my_parser.js

For help, run:

	python -m lark-js --help

Syntax Highlighting

Lark provides syntax highlighting for its grammar files (*.lark):

List of main features

  • Builds a parse-tree (AST) automagically, based on the structure of the grammar
  • LALR(1) parser - Fast and light
  • EBNF grammar
  • Usable in the browser and in Node
  • Automatic line & column tracking
  • Standard library of terminals (strings, numbers, names, etc.)
  • Import grammars from Nearley.js (read more)
  • And much more!

License

Lark.js uses the MIT license.

Contribute

Lark.js is accepting pull-requests. If you would like to help, open an issue or find us on gitter.

Sponsoring

Lark.js was made possible with the help of a generous donation by Smore ❤️

If you like Lark, and want to see it grow, please consider sponsoring us!

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

Larkjs-0.0.2.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

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

Larkjs-0.0.2-py2.py3-none-any.whl (33.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Larkjs-0.0.2.tar.gz.

File metadata

  • Download URL: Larkjs-0.0.2.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.2 Windows/10

File hashes

Hashes for Larkjs-0.0.2.tar.gz
Algorithm Hash digest
SHA256 efd2ef487d3a9d9eb89adf8991bcb281809355f33830e3c9600ad0ae7ec742c7
MD5 a9c6f5813bd4e871c2cdb7973fddc394
BLAKE2b-256 0ab0d3dba5508be284ce6167bdc845150ee9eeaeee18f1aa026aff1edafc5e8e

See more details on using hashes here.

File details

Details for the file Larkjs-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: Larkjs-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.2 Windows/10

File hashes

Hashes for Larkjs-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da03639dc5459006e07ca62a01ad4327b1596fd1f17fe57916499b66b94a465b
MD5 b8eb5cfb1a62322fbb4d84de4bd81955
BLAKE2b-256 1190ad90ce3c8174a79186e1a1c706e447ecb672b8a9f92202ee0dc195637dbe

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