Browse Source

Updated docs (pitch & benchmarks)

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.7.0
Erez Shinan 6 years ago
parent
commit
9137cc4fa4
4 changed files with 7 additions and 7 deletions
  1. +5
    -5
      README.md
  2. BIN
      docs/comparison_memory.png
  3. BIN
      docs/comparison_runtime.png
  4. +2
    -2
      docs/features.md

+ 5
- 5
README.md View File

@@ -4,7 +4,7 @@ Parse any context-free grammar, FAST and EASY!

**Beginners**: Lark is not just another parser. It can parse any grammar you throw at it, no matter how complicated or ambiguous, and do so efficiently. It also constructs a parse-tree for you, without additional code on your part.

**Experts**: Lark lets you choose between Earley and LALR(1), to trade-off power and speed. It also contains a CYK parser and unique features such as a contextual-lexer.
**Experts**: Lark implements both Earley(SPPF) and LALR(1), and several different lexers, so you can trade-off power and speed, according to your requirements. It also provides a variety of sophisticated features and utilities.

Lark can:

@@ -21,11 +21,10 @@ Most importantly, Lark will save you time and prevent you from getting parsing h
### Quick links

- [Documentation @readthedocs](https://lark-parser.readthedocs.io/)
- [Tutorial](/docs/json_tutorial.md) for writing a JSON parser.
- [Cheatsheet (PDF)](/docs/lark_cheatsheet.pdf)
- [Tutorial](/docs/json_tutorial.md) for writing a JSON parser.
- Blog post: [How to write a DSL with Lark](http://blog.erezsh.com/how-to-write-a-dsl-in-python-with-lark/)
- [Forum @googlegroups](https://groups.google.com/forum/#!forum/lark-parser)
- [Gitter chat](https://gitter.im/lark-parser/Lobby) (New)
- [Gitter chat](https://gitter.im/lark-parser/Lobby)

### Install Lark

@@ -114,6 +113,8 @@ Check out the [JSON tutorial](/docs/json_tutorial.md#conclusion) for more detail

*Note: I really wanted to add PLY to the benchmark, but I couldn't find a working JSON parser anywhere written in PLY. If anyone can point me to one that actually works, I would be happy to add it!*

*Note 2: The parsimonious code has been optimized for this specific test, unlike the other benchmarks (Lark included). Its "real-world" performance may not be as good.*

#### Feature comparison

| Library | Algorithm | Grammar | Builds tree? | Supports ambiguity? | Can handle every CFG? | Line/Column tracking | Generates Stand-alone
@@ -122,7 +123,6 @@ Check out the [JSON tutorial](/docs/json_tutorial.md#conclusion) for more detail
| [PLY](http://www.dabeaz.com/ply/) | LALR(1) | BNF | No | No | No | No | No |
| [PyParsing](http://pyparsing.wikispaces.com/) | PEG | Combinators | No | No | No\* | No | No |
| [Parsley](https://pypi.python.org/pypi/Parsley) | PEG | EBNF | No | No | No\* | No | No |
| [funcparserlib](https://github.com/vlasovskikh/funcparserlib) | Recursive-Descent | Combinators | No | No | No | No | No |
| [Parsimonious](https://github.com/erikrose/parsimonious) | PEG | EBNF | Yes | No | No\* | No | No |
| [ANTLR](https://github.com/antlr/antlr4) | LL(*) | EBNF | Yes | No | Yes? | Yes | No |



BIN
docs/comparison_memory.png View File

Before After
Width: 655  |  Height: 403  |  Size: 26 KiB Width: 657  |  Height: 405  |  Size: 26 KiB

BIN
docs/comparison_runtime.png View File

Before After
Width: 654  |  Height: 404  |  Size: 23 KiB Width: 656  |  Height: 406  |  Size: 24 KiB

+ 2
- 2
docs/features.md View File

@@ -1,8 +1,8 @@
# Main Features
- Earley parser, capable of parsing any context-free grammar
- Implements SPPF, for efficient parsing and storing of ambiguous grammars.
- LALR(1) parser, limited in power of expression, but efficient in space and performance (O(n)).
- Implements a parse-aware lexer that provides a better power of expression than traditional implementations.
- LALR(1) parser, limited in power of expression, but very efficient in space and performance (O(n)).
- Implements a parse-aware lexer that provides a better power of expression than traditional LALR implementations (such as ply).
- EBNF-inspired grammar, with extra features (See: [Grammar Reference](grammar.md))
- Builds a parse-tree (AST) automagically based on the grammar
- Stand-alone parser generator - create a small independent parser to embed in your project.


Loading…
Cancel
Save