lark/examples
Erez Shinan 895e056e74 Fixes 2018-05-24 15:20:55 +03:00
..
standalone Standalone generator working again. Updated examples 2018-03-10 12:28:35 +02:00
README.md Update README.md 2018-04-25 19:09:50 +03:00
__init__.py Added examples (calc, json) 2017-02-05 13:40:19 +02:00
calc.py Earley now uses dynamic lexer by default. Bump to version 0.3.0 2017-08-04 16:05:40 +03:00
conf.py Fixed issue in examples.conf 2017-03-01 18:24:12 +02:00
conf_nolex.py Earley now uses dynamic lexer by default. Bump to version 0.3.0 2017-08-04 16:05:40 +03:00
error_reporting_lalr.py Added example for error reporting with LALR 2018-04-18 12:37:57 +03:00
examples-requirements.txt New example showing how to use lark+qscintilla (Issue #150) 2018-05-24 12:26:49 +02:00
fruitflies.png Improved Readme 2017-11-02 13:47:05 +02:00
fruitflies.py Improved Readme 2017-11-02 13:47:05 +02:00
indented_tree.py Changed parser/lexer interface in lark. Bumped minor version 2017-02-25 18:35:31 +02:00
json_parser.py Example JSON parser is now LALR 2018-01-02 09:58:19 +02:00
lark.g Added examples/lark.g - Reference implementation of the Lark grammar 2018-04-25 19:06:33 +03:00
lark_grammar.py Added examples/lark.g - Reference implementation of the Lark grammar 2018-04-25 19:06:33 +03:00
python2.g Small fix in Python grammars (misread tuples, issue #68) 2018-01-21 16:10:26 +02:00
python3.g Small fix in Python grammars (misread tuples, issue #68) 2018-01-21 16:10:26 +02:00
python_parser.py Fixed to Python3 grammar (Thanks @autocorr) 2017-11-20 13:25:09 +02:00
qscintilla_json.py Fixes 2018-05-24 15:20:55 +03:00
reconstruct_json.py Earley now uses dynamic lexer by default. Bump to version 0.3.0 2017-08-04 16:05:40 +03:00
turtle_dsl.py Earley now uses dynamic lexer by default. Bump to version 0.3.0 2017-08-04 16:05:40 +03:00

README.md

Examples for Lark

Beginners

  • calc.py - A simple example of a REPL calculator
  • json_parser.py - A simple JSON parser (comes with a tutorial, see docs)
  • indented_tree.py - A demonstration of parsing indentation ("whitespace significant" language)
  • fruitflies.py - A demonstration of ambiguity
  • turtle_dsl.py - Implements a LOGO-like toy language for Python's turtle, with interpreter.
  • lark_grammar.py + lark.g - A reference implementation of the Lark grammar (using LALR(1) + standard lexer)

Advanced

  • error_reporting_lalr.py - A demonstration of example-driven error reporting with the LALR parser
  • python_parser.py - A fully-working Python 2 & 3 parser (but not production ready yet!)
  • conf.py - Demonstrates the power of LALR's contextual lexer on a toy configuration language
  • reconstruct_json.py - Demonstrates the experimental text-reconstruction feature