|
|
@@ -19,7 +19,7 @@ Lark implements the following parsing algorithms: |
|
|
|
|
|
|
|
An [Earley Parser](https://www.wikiwand.com/en/Earley_parser) is a chart parser capable of parsing any context-free grammar at O(n^3), and O(n^2) when the grammar is unambiguous. It can parse most LR grammars at O(n). Most programming languages are LR, and can be parsed at a linear time. |
|
|
|
|
|
|
|
Lark's Earley implmementation runs on top of a skipping chart parser, which allows it to use regular expressions, instead of matching characters one-by-one. This is a huge improvement to Earley that is unique to Lark. This feature is used by default, but can also be requested explicitely using `lexer='dynamic'`. |
|
|
|
Lark's Earley implementation runs on top of a skipping chart parser, which allows it to use regular expressions, instead of matching characters one-by-one. This is a huge improvement to Earley that is unique to Lark. This feature is used by default, but can also be requested explicitely using `lexer='dynamic'`. |
|
|
|
|
|
|
|
It's possible to bypass the dynamic lexer, and use the regular Earley parser with a traditional lexer, that tokenizes as an independant first step. Doing so will provide a speed benefit, but will tokenize without using Earley's ambiguity-resolution ability. So choose this only if you know why! Activate with `lexer='standard'` |
|
|
|
|
|
|
@@ -59,4 +59,4 @@ Its too slow to be practical for simple grammars, but it offers good performance |
|
|
|
- Grammar composition |
|
|
|
- LALR(k) parser |
|
|
|
- Full regexp-collision support using NFAs |
|
|
|
- Automatically produce syntax-highlighters for grammars, for popular IDEs |
|
|
|
- Automatically produce syntax-highlighters for grammars, for popular IDEs |