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.
- Host: GitHub
- URL: https://github.com/knightchaser/larkjsonparser
- Owner: KnightChaser
- Created: 2024-09-15T13:46:42.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T13:39:08.000Z (over 1 year ago)
- Last Synced: 2025-03-23T10:26:47.225Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.MD
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.