diff --git a/README.md b/README.md index dd37660..bc48b48 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/docs/comparison_memory.png b/docs/comparison_memory.png index 8ef7938..1cdd5f3 100644 Binary files a/docs/comparison_memory.png and b/docs/comparison_memory.png differ diff --git a/docs/comparison_runtime.png b/docs/comparison_runtime.png index 65ca91d..bba0182 100644 Binary files a/docs/comparison_runtime.png and b/docs/comparison_runtime.png differ diff --git a/docs/features.md b/docs/features.md index 2abaa21..4b58f1c 100644 --- a/docs/features.md +++ b/docs/features.md @@ -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.