mirror of https://github.com/lark-parser/lark.git
Updated How to use Lark (markdown)
parent
9dd6e3db2d
commit
4c58d05f8c
|
@ -25,7 +25,7 @@ Here is some mock usage of them. You can see a real example in the [[examples]]
|
|||
```python
|
||||
from lark import Lark, Transformer
|
||||
|
||||
parser = Lark("""start: rules and more rules
|
||||
gramamr = """start: rules and more rules
|
||||
|
||||
rule1: other rules AND TOKENS
|
||||
| rule1 "+" rule2 -> add
|
||||
|
@ -35,7 +35,9 @@ parser = Lark("""start: rules and more rules
|
|||
|
||||
TOKEN1: "a literal"
|
||||
TOKEN2: TOKEN1 "and literals"
|
||||
""", start="ebnf")
|
||||
"""
|
||||
|
||||
parser = Lark(grammar)
|
||||
|
||||
tree = parser.parse("some input string")
|
||||
|
||||
|
|
Loading…
Reference in New Issue