Browse Source

Updated performance comparison to include ANTLR

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.0
Erez Shinan 6 years ago
parent
commit
fc6169732e
4 changed files with 2 additions and 1 deletions
  1. +1
    -0
      README.md
  2. BIN
      docs/comparison_memory.png
  3. BIN
      docs/comparison_runtime.png
  4. +1
    -1
      examples/json_parser.py

+ 1
- 0
README.md View File

@@ -111,6 +111,7 @@ Check out the [JSON tutorial](/docs/json_tutorial.md#conclusion) for more detail
| [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 |


(\* *PEGs cannot handle non-deterministic grammars. Also, according to Wikipedia, it remains unanswered whether PEGs can really parse all deterministic CFGs*)


BIN
docs/comparison_memory.png View File

Before After
Width: 649  |  Height: 400  |  Size: 24 KiB Width: 655  |  Height: 403  |  Size: 26 KiB

BIN
docs/comparison_runtime.png View File

Before After
Width: 651  |  Height: 399  |  Size: 20 KiB Width: 654  |  Height: 404  |  Size: 23 KiB

+ 1
- 1
examples/json_parser.py View File

@@ -51,7 +51,7 @@ class TreeToJson(Transformer):
# def parse(x):
# return TreeToJson().transform(json_parser.parse(x))

json_parser = Lark(json_grammar, parser='lalr', transformer=TreeToJson())
json_parser = Lark(json_grammar, parser='lalr', lexer='standard', transformer=TreeToJson())
parse = json_parser.parse

def test():


Loading…
Cancel
Save