Browse Source

Examples: A few minor changes

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.12.0
Erez Sh 3 years ago
parent
commit
7fdd59849b
3 changed files with 23 additions and 2356 deletions
  1. +3
    -0
      examples/advanced/create_ast.py
  2. +20
    -0
      examples/standalone/README.md
  3. +0
    -2356
      examples/standalone/json_parser.py

+ 3
- 0
examples/advanced/create_ast.py View File

@@ -1,4 +1,7 @@
"""
Creating an AST from the parse tree
===================================

This example demonstrates how to transform a parse-tree into an AST using `lark.ast_utils`.

create_transformer() collects every subclass of `Ast` subclass from the module,


+ 20
- 0
examples/standalone/README.md View File

@@ -0,0 +1,20 @@
# Standalone example
To initialize, cd to this folder, and run:
````bash
./create_standalone.sh
```
Or:
```bash
python -m lark.tools.standalone json.lark > json_parser.py
````
Then run using:
```bash
python json_parser_main.py <path-to.json>
```

+ 0
- 2356
examples/standalone/json_parser.py
File diff suppressed because it is too large
View File


Loading…
Cancel
Save