2018-09-26 15:55:16 +00:00
|
|
|
# Lark
|
|
|
|
|
|
|
|
A modern parsing library for Python
|
|
|
|
|
|
|
|
## Overview
|
2018-08-03 06:08:37 +00:00
|
|
|
|
|
|
|
Lark can parse any context-free grammar.
|
|
|
|
|
2018-09-26 15:55:16 +00:00
|
|
|
Lark provides:
|
2018-08-03 06:08:37 +00:00
|
|
|
|
|
|
|
- Advanced grammar language, based on EBNF
|
|
|
|
- Three parsing algorithms to choose from: Earley, LALR(1) and CYK
|
2018-09-26 15:55:16 +00:00
|
|
|
- Automatic tree construction, inferred from your grammar
|
2018-08-03 06:08:37 +00:00
|
|
|
- Fast unicode lexer with regexp support, and automatic line-counting
|
|
|
|
|
2018-09-26 15:55:16 +00:00
|
|
|
Lark's code is hosted on Github: [https://github.com/lark-parser/lark](https://github.com/lark-parser/lark)
|
2018-08-03 06:08:37 +00:00
|
|
|
|
|
|
|
### Install
|
|
|
|
```bash
|
|
|
|
$ pip install lark-parser
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Syntax Highlighting
|
|
|
|
|
|
|
|
- [Sublime Text & TextMate](https://github.com/lark-parser/lark_syntax)
|
|
|
|
- [Visual Studio Code](https://github.com/lark-parser/vscode-lark) (Or install through the vscode plugin system)
|
|
|
|
|
2018-09-26 15:55:16 +00:00
|
|
|
-----
|
2018-08-03 06:08:37 +00:00
|
|
|
|
|
|
|
## Documentation Index
|
|
|
|
|
|
|
|
|
|
|
|
* [Philosophy & Design Choices](philosophy.md)
|
|
|
|
* [Full List of Features](features.md)
|
|
|
|
* [Examples](https://github.com/lark-parser/lark/tree/master/examples)
|
|
|
|
* Tutorials
|
|
|
|
* [How to write a DSL](http://blog.erezsh.com/how-to-write-a-dsl-in-python-with-lark/) - Implements a toy LOGO-like language with an interpreter
|
|
|
|
* [How to write a JSON parser](json_tutorial.md)
|
2019-01-06 12:19:56 +00:00
|
|
|
* External
|
|
|
|
* [Program Synthesis is Possible](https://www.cs.cornell.edu/~asampson/blog/minisynth.html) - Creates a DSL for Z3
|
2018-08-03 06:08:37 +00:00
|
|
|
* Guides
|
|
|
|
* [How to use Lark](how_to_use.md)
|
2018-12-23 18:10:38 +00:00
|
|
|
* [How to develop Lark](how_to_develop.md)
|
2018-08-03 06:08:37 +00:00
|
|
|
* Reference
|
|
|
|
* [Grammar](grammar.md)
|
|
|
|
* [Tree Construction](tree_construction.md)
|
|
|
|
* [Classes](classes.md)
|
|
|
|
* [Cheatsheet (PDF)](lark_cheatsheet.pdf)
|
|
|
|
* Discussion
|
2019-01-06 12:19:56 +00:00
|
|
|
* [Gitter](https://gitter.im/lark-parser/Lobby)
|
2018-12-20 23:41:35 +00:00
|
|
|
* [Forum (Google Groups)](https://groups.google.com/forum/#!forum/lark-parser)
|