Erez Sh
4fe49c9cdb
Change expand_kids_by_data to use range
3 years ago
Erez Sh
d2e8b15c2f
Another update for the PR
3 years ago
Erez Sh
f5c7af8ce9
Proposed corrections to PR #970
3 years ago
MegaIng
3a4568df24
Reworked grammar to simplify later processing + expand_kids_by_data + tests
3 years ago
Erez Sh
206030ecf7
Docs: Added docstring to Tree.scan_values()
3 years ago
Erez Sh
5b30ba4841
Cleanup, and a few PEP8 changes
4 years ago
Jonah Yolles-Murphy
b82f7177cb
added test
4 years ago
Jonah Yolles-Murphy
6cd706279a
make Trees and Tokens' reprs' evalable
4 years ago
Omega16
a01de190d3
Added pydot__tree_to_dot and pydot__tree_to_graph, changed pydot__tree_to_png
4 years ago
Erez Sh
288078a6a0
Corrections to PR
4 years ago
Sasank Chilamkurthy
b753e24b2f
document lark.Tree
4 years ago
Blank Spruce
5559b1a211
Add missing elements in standalone parser
Add:
- missing imports
- __version__ variable
Additionally regenerated json parser example
4 years ago
Erez Sh
cc1092bd53
Refactored puppet + small fixes
4 years ago
Erez Sh
4c61aaf1dc
Small refactoring for iter_subtrees
4 years ago
Blank Spruce
b18d109886
Rewrite iter_subtrees to more efficient version
Using OrderedDict provides these properties:
- given subtree is yielded only once since it's stored in OrderedDict
only once (even though it may be put there multiple times) so no need
to double check if subtree was already seen
- order of iteration is preserved as it was previously when subtrees
to iterate over were stored in a list
4 years ago
Erez Sh
a173117857
Included iter_subtrees and related methods in standalone parser (Issue #440 )
5 years ago
fbindel
09afcfcfc7
Allow any graph attribute in `pydot__tree_to_png`.
Keeping the explicit `rankdir="LR"` as default, add `kwargs`
to `pydot__tree_to_png` and `pydot.Dot` so that all graphviz
attributes are available for the graph.
5 years ago
night199uk
1f5abfc937
Fix Propagate Positions
5 years ago
Alexey Shrub
f604b73a3c
Tree walk tests
6 years ago
Alexey Shrub
1cdc7a0e88
Fix Python 2 error with return from generator
6 years ago
Alexey Shrub
2ad06a24bd
Method iter_subtrees_topdown added
6 years ago
evandrocoan
d8c9e1b5e1
Fixed SyntaxError: positional argument follows keyword argument on
lark/tree.py
6 years ago
evandrocoan
91a5a5dfcb
Allow to pass to lark/tree.py pydot__tree_to_png the pydot tree
shaping. For example, passing "TB" instead of "LR" makes the tree
to be draw vertically instead of horizontally.
https://stackoverflow.com/questions/29003465/pydot-graphviz-how-to-order-horizontally-nodes-in-a-cluster-while-the-rest-of-t
6 years ago
Erez Shinan
843da8e809
Fixed bugs in the standalone generator (Issue #212 )
6 years ago
Erez Shinan
5c6df8e825
Moved and restructured exceptions
* All exceptions are now under exceptions.py
* UnexpectedInput is now superclass of UnexpectedToken and UnexpectedCharacters,
all of which support the get_context() and match_examples() methods.
6 years ago
Erez Shinan
c0cf1b3176
Added some docstrings, removed is_terminal from common
6 years ago
Erez Shinan
6bfc27c11d
New transformers near completion
Nearley tool still needs fixing
6 years ago
Erez Shinan
9daacb9082
Refactored transformers, better code
6 years ago
Ramon Klass
1854b81ebc
interpreter: default behavior changed to return the values instead of discarding them, added test showcasing the behavior
6 years ago
Ramon Klass
f5550b3040
Implemented a new visitor class (Interpreter) that works top-down (PR #130 )
It emulates antlr's visitor behavior for a dynamic evaluation order of subtrees
6 years ago
Erez Shinan
f69bceb335
Snap more things into place
6 years ago
Erez Shinan
349a607ae3
Some more normalizing
6 years ago
Erez Shinan
f960c1b8ac
Initial: Added transformers.py, and Meta to tree
6 years ago
Erez Shinan
b9e1e444c9
Added SlottedTree
6 years ago
Erez Shinan
d5c617f0fe
BUGFIX: Non-linearity in tree construction, causing performance issues for large inputs (Issue #94 )
6 years ago
Erez Shinan
3d8b8b4725
A few more adaptations
6 years ago
Chris McKinney
d8fbf92fea
Fixed TypeError on pretty-printing tuples in tree
When a tuple is passed as the argument to percent-formatting, its
elements are interpreted as multiple arguments. The pretty printer
previously passed tuples (e.g. those introduced via a Transformer) from
the tree directly to the percent operator, causing a TypeError because
the format string only calls for a single argument. This fix simply
wraps the argument in a one-tuple to ensure it is not interpreted as
multiple arguments if it itself is a tuple.
6 years ago
Ehud Tamir
7c253b9372
Merge CYK parser.
6 years ago
Erez Shinan
5ac4120b71
Stand-alone tool working for LALR+traditional lexer (first commit)
6 years ago
Erez Shinan
da1910f5b6
More refactoring towards standalone
6 years ago
Kevin Latimer
240cf1ca21
Bug fixes to Transformer_NoRecurse
6 years ago
Kevin Latimer
26ce48b940
Bug fix for Discard and make the syntax more pythonic
6 years ago
Kevin Latimer
a5625a3be9
Add delete functionality
6 years ago
Erez Shinan
cb18cf5e77
BUGFIX: iter_trees() wasn't consistent with a recursive order (Issue #47 )
7 years ago
Erez Shinan
593446d025
Improved Readme
7 years ago
Erez Shinan
c93140386d
BUGFIX: The Earley parser collected repeating derivations, and filtered them out much later than needed. This resulted in very long lists and many unnecessary comparisons.
7 years ago
Erez Shinan
5d41371fb3
Added resolve__antiscore_sum
7 years ago
Erez Shinan
5c4c320c26
Small fixes
7 years ago
Erez Shinan
0c5acaab8a
Refactoring load_grammar
7 years ago
Erez Shinan
9570918005
Improved: efficiency of iter_subtrees(), customizability of pretty()
7 years ago