/dports/devel/py-lark-parser/lark-parser-0.12.0/tests/ |
H A D | test_grammar.py | 19 p = Lark(example) 32 p = Lark(""" 54 p = Lark(""" 66 p = Lark(""" 79 p = Lark(""" 88 p = Lark(""" 205 l = Lark(g, parser='lalr') 214 l = Lark(g, parser='lalr') 226 l = Lark(g, parser='lalr') 234 l = Lark(g, parser='lalr') [all …]
|
H A D | test_cache.py | 5 from lark import Lark, Tree, Transformer 76 Lark(self.g, parser='lalr', cache=fn) 78 parser = Lark(self.g, parser='lalr', cache=fn) 83 Lark(self.g, parser='lalr', cache=True) 85 parser = Lark(self.g, parser='lalr', cache=True) 88 parser = Lark(self.g + ' "b"', parser='lalr', cache=True) 92 parser = Lark(self.g, parser='lalr', cache=True) 97 parser = Lark(self.g, parser='lalr', lexer=CustomLexer, cache=True) 98 parser = Lark(self.g, parser='lalr', lexer=CustomLexer, cache=True) 104 Lark(self.g, parser="lalr", debug=True, cache=True) [all …]
|
H A D | test_parser.py | 34 from lark.lark import Lark 51 Lark(r""" 82 g = Lark("""start: a 89 g = Lark("""start: x 98 g = Lark("""start: a 119 g = Lark("""start: a 127 g = Lark("""start: a 135 g = Lark("""start: a 142 g = Lark("""start: a 244 tree = Lark(''' [all …]
|
H A D | test_reconstructor.py | 9 from lark import Lark 25 parser = Lark(grammar, parser='lalr', maybe_placeholders=False, **options) 140 json_parser = Lark(json_grammar, parser='lalr', maybe_placeholders=False) 186 l1 = Lark(g1, parser='lalr') 187 l2 = Lark(g2, parser='lalr')
|
H A D | test_logger.py | 3 from lark import Lark, logger 31 Lark(collision_grammar, parser='lalr', debug=True) 46 Lark(collision_grammar, parser='lalr', debug=False) 59 Lark(collision_grammar, parser='lalr', debug=True)
|
H A D | test_tree_forest_transformer.py | 5 from lark import Lark 20 parser = Lark(grammar, parser='earley', ambiguity='forest') 24 l = Lark(self.grammar, parser='earley', ambiguity='resolve') 30 l = Lark(self.grammar, parser='earley', ambiguity='explicit') 199 l = Lark(grammar, parser='earley', ambiguity='forest')
|
H A D | test_lexer.py | 3 from lark import Lark, Tree 10 p = Lark("""
|
/dports/devel/py-lark-parser/lark-parser-0.12.0/ |
H A D | README.md | 1 # Lark - a parsing toolkit for Python 34 ### Install Lark 38 Lark has no dependencies. 54 These are implementations of Lark in other languages. They accept Lark grammars, and provide simila… 64 from lark import Lark 66 l = Lark('''start: WORD "," WORD "!" 119 Lark is the fastest and lightest (lower is better) 147 ### Projects using Lark 166 Using Lark? Send me a message and I'll add your project! 170 Lark uses the [MIT license](LICENSE). [all …]
|
/dports/devel/py-lark-parser/lark-parser-0.12.0/docs/ |
H A D | tools.md | 5 Lark can generate a stand-alone LALR(1) parser from a grammar. 7 The resulting module provides the same interface as Lark, but with a fixed grammar, and reduced fun… 20 Lark comes with a tool to convert grammars from [Nearley](https://github.com/Hardmath123/nearley), … 24 1. Install Lark with the `nearley` component: 42 Here's an example of how to import nearley's calculator example into Lark: 66 - Lark currently cannot import templates from Nearley 68 - Lark currently cannot export grammars to Nearley
|
H A D | how_to_use.md | 1 # How To Use Lark - Guide 5 This is the recommended process for working with Lark: 11 3. Try your grammar in Lark against each input sample. Make sure the resulting parse-trees make sen… 13 4. Use Lark's grammar features to [shape the tree](tree_construction.md): Get rid of superfluous ru… 47 By default Lark silently resolves Shift/Reduce conflicts as Shift. To enable warnings pass `debug=T… 51 from lark import Lark, logger 60 p = Lark(collision_grammar, parser='lalr', debug=True) 67 Lark can generate a stand-alone LALR(1) parser from a grammar. 69 The resulting module provides the same interface as Lark, but with a fixed grammar, and reduced fun… 81 It is possible to import Nearley grammars into Lark. The Javascript code is translated using Js2Py.
|
H A D | recipes.md | 3 A collection of recipes to use Lark and its various features 13 from lark import Lark, Transformer 20 parser = Lark(""" 51 from lark import Lark 55 parser = Lark(""" 88 Lark provides a utility transformer for that purpose: 91 from lark import Lark, Tree, Transformer 106 parser = Lark(grammar, ambiguity='explicit') 160 from lark import Lark, Transformer 163 tree = Lark('start: "a"').parse('a')
|
H A D | json_tutorial.md | 4 In this tutorial we will write a JSON parser in Lark, and explore Lark's various features in the pr… 91 We simply instantiate Lark, and tell it to accept a "value": 94 from lark import Lark 95 json_parser = Lark(r""" 174 from lark import Lark 175 json_parser = Lark(r""" 295 from lark import Lark, Transformer 363 json_parser = Lark(json_grammar, start='value', parser='lalr') 427 | Lark - Earley *(with lexer)* | 42s | 4s | 1167M | 608M | 428 | Lark - LALR(1) | 8s | 1.53s | 453M | 266M | [all …]
|
H A D | index.rst | 1 .. Lark documentation master file, created by 6 Welcome to Lark's documentation! 44 Lark is a modern parsing library for Python. Lark can parse any context-free grammar. 46 Lark provides: 54 Install Lark 88 - :doc:`json_tutorial` - Teaches you how to use Lark
|
H A D | classes.rst | 4 Lark section in API Reference 7 .. autoclass:: lark.Lark 19 Any instance of Lark instantiated with ``regex=True`` will use the ``regex`` module instead of ``re… argument 25 from lark import Lark 26 >>> g = Lark(r"""
|
H A D | how_to_develop.md | 1 # How to develop Lark - Guide 7 * Write new grammars for Lark's library 8 * Write a blog post introducing Lark to your audience 9 * Port Lark to another language 17 Lark comes with an extensive set of tests. Many of the tests will run several times, once for each …
|
H A D | tree_construction.md | 4 Lark builds a tree automatically based on the structure of the grammar, where each rule that is mat… 20 Lark filters out certain types of terminals by default, considering them punctuation: 44 Lark will parse "(Hello) (World)" as: 66 Lark will parse "((hello world))" as: 91 Lark will parse "(hello world)" as: 108 Lark will parse "hello world (planet)" as: 149 Lark will parse "hello world" as:
|
H A D | parsers.md | 2 Lark implements the following parsing algorithms: Earley, LALR(1), and CYK 8 Lark's Earley implementation runs on top of a skipping chart parser, which allows it to use regular… 14 Lark implements the Shared Packed Parse Forest data-structure for the Earley parser, in order to re… 18 As a result, Lark can efficiently parse and store every ambiguity in the grammar, when using Earley. 20 Lark provides the following options to combat ambiguity: 22 1) Lark will choose the best derivation for you (default). Users can choose between different disam… 53 Lark comes with an efficient implementation that outperforms every other parsing library for Python… 55 Lark extends the traditional YACC-based architecture with a *contextual lexer*, which processes fee… 61 This is an improvement to LALR(1) that is unique to Lark.
|
H A D | forest.rst | 4 When parsing with Earley, Lark provides the ``ambiguity='forest'`` option 8 Lark provides a few tools to facilitate working with the SPPF. Here are some 23 - Loss of Lark grammar features:
|
/dports/devel/py-lark-parser/lark-parser-0.12.0/examples/ |
H A D | indented_tree.py | 14 from lark import Lark 38 parser = Lark(tree_grammar, parser='lalr', postlex=TreeIndenter())
|
H A D | fruitflies.py | 11 from lark import Lark, tree 29 parser = Lark(grammar, start='sentence', ambiguity='explicit')
|
H A D | calc.py | 9 from lark import Lark, Transformer, v_args 62 calc_parser = Lark(calc_grammar, parser='lalr', transformer=CalculateTree())
|
H A D | json_parser.py | 10 from lark import Lark, Transformer, v_args 58 json_parser = Lark(json_grammar, parser='lalr',
|
/dports/devel/py-tartiflette/tartiflette-1.4.1/tartiflette/language/parsers/lark/ |
H A D | parser.py | 5 from lark import Lark 14 _LARK_PARSER = Lark.open(
|
/dports/emulators/qemu-devel/qemu-de8ed1055c2ce18c95f597eb10df360dcb534f99/scripts/simplebench/ |
H A D | table_templater.py | 20 from lark import Lark 30 parser = Lark(grammar)
|
/dports/emulators/qemu/qemu-6.2.0/scripts/simplebench/ |
H A D | table_templater.py | 20 from lark import Lark 30 parser = Lark(grammar)
|