An open API service indexing awesome lists of open source software.

https://github.com/knightchaser/larkjsonparser

An example code of parsing JSON text into an utilizable structure with Lark library.
https://github.com/knightchaser/larkjsonparser

Last synced: about 2 months ago
JSON representation

An example code of parsing JSON text into an utilizable structure with Lark library.

Awesome Lists containing this project

README

          

# LarkJSONParser

An example code of parsing JSON text into an utilizable structure with Lark library.

### Directories
- `json.lark`: A LARK based grammar for parsing JSON(JavaScript Object Notation) syntax file.
- `parser.py`: A simple JSON parsing code that restructs JSON text to Python dictionary completely.
- `parser_for_tree.py`: A modified JSON parser using `Transformer` to build a customized tree. (Can be applied for a such thing like AST(Abstract Syntax Tree))
- `parser_error_handling.py`: A modified JSON parser gracefully handling parss failures due to grammatically incorrect inputs like compilers or interpreters.