Erez Sh
5b30ba4841
Cleanup, and a few PEP8 changes
4 years ago
Erez Sh
19fc3c7520
Small fix to Earley debuging
4 years ago
MegaIng1
3112259b23
Fix for maybe_placeholders when keep_all_tokens=True
4 years ago
Chanic Panic
e459f28743
Add AmbiguousIntermediateExpander
4 years ago
Blank Spruce
e5620635c0
Reduce number of calls to Tree.meta in PropagatePositions
Since Tree.meta is property with additional presence check it
introduces unnecessary overhead in accessing underlying Meta
object once it's already initialized. Having local reference to actual
Meta object allows to reduce these presence checks to bare minimum
4 years ago
MegaIng1
a716f54b22
slight improvement for alias of templates
4 years ago
MegaIng1
20a2f690ca
Correct behaviour of aliases for templates (attempt 2)
4 years ago
Erez Sh
de1f619fcd
Bugfix in stand-alone parser (Issue #514 )
5 years ago
Erez Sh
b9c81a5450
Refactor: Simplify code by assuming rule.options is never None
5 years ago
Erez Sh
dcc9d46eef
Fixes to propagate_positions
5 years ago
Erez Sh
e1a39c58d0
Refactored v_args & visitors to a better, more agile implementation
5 years ago
Erez Shinan
58d6d9fac1
Added Token.end_pos, and updated docs regarding recent commits
5 years ago
Erez Shinan
a9106df824
Corrected thee Transformer's whole_tree interface, for both internal and external use
5 years ago
Mostafa Razavi
e5868415eb
Implement embedded in-place transformers. See #378 .
As discussed in issue #378 , when an embedded transformer (that is, one
passed to the Lark class using the transformer argument), is an
inplace transformer (either a subclass of Transformer_InPlace, or with
the @v_args(tree=True) decorator), the in-place transformer was not
working correctly and in-fact Lark used it like a normal non-in-place
transformer, expecting it to return the transformed value.
5 years ago
Erez Shinan
335206911d
Basic serialize/deserialize working!
5 years ago
Erez Shinan
bd75bf2dff
Refactor - callbacks are now {rule: callback}, instead of a Callback object referenced by Rule.alias
5 years ago
night199uk
d74781605d
Fix Ambiguous Expander problems with nested ambiguities
6 years ago
night199uk
1f5abfc937
Fix Propagate Positions
6 years ago
Erez Shinan
467483553b
Fixed placeholder code, should work as expected (Issue #285 )
6 years ago
Erez Shinan
adb30180aa
maybe_placeholder now doesn't apply to anonymous terminals
6 years ago
Erez Shinan
222df5bab4
New Feature: Added maybe_placeholders option (Issue #285 )
6 years ago
Erez Shinan
c172653ea6
Fix issue with propagate_positions
6 years ago
Erez Shinan
0935543280
Fix issue with propagate_positions
6 years ago
Jan Rydzewski
3ef84318b1
Removed unused imports and variables
6 years ago
night199uk
1d5fd7301a
Heavy modifications to the Earley parser to try and make it handle more
types of ambiguity.
- Rewritten along the lines of Elizabeth Scott's parser.
https://www.sciencedirect.com/science/article/pii/S1571066108001497
- Implement SPPF trees per Elizabeth Scott and Bram van der Sanden's work.
http://www.bramvandersanden.com/post/2014/06/shared-packed-parse-forest/
6 years ago
night199uk
067ade56d9
Fix propagate positions
6 years ago
Erez Shinan
48a781fcf2
Bugfix for propagate_positions
6 years ago
Erez Shinan
53a66132ba
Added visitors & transformers to standalone (Issue #223 )
6 years ago
Erez Shinan
242ac24ea6
Fixed the propagate_positions implementation, and added start_pos/end_pos attributes to Tree.Meta
Related to issue #216
6 years ago
Erez Shinan
d7d7b956b7
BUGFIX: Bad naming scheme in tree-builder callbacks caused conflicts (Issue #198 )
6 years ago
Erez Shinan
3ac32fa5f0
Bug in PropagatePositions when supplying a reducing transformer
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
6bfc27c11d
New transformers near completion
Nearley tool still needs fixing
6 years ago
Erez Shinan
7b32ffd83a
Fixed token visibility rules (Issue #109 )
Anonymous tokens would become visible if they had the same value as named tokens.
That's because they are merged for the lexer. But after this change, the rules for
visibility are based on their use in the rule, and not their name or identity.
6 years ago
Erez Shinan
33caa391d5
Breaking backwards compatibility:
* Removed the scanless parsing feature (dynamic lexing is king)
* Default LALR lexer is now contextual
6 years ago
Erez Shinan
4a5aa745ea
All tests passing
6 years ago
Erez Shinan
cf7ddeee88
Earley working too
6 years ago
Erez Shinan
67f372c994
Symbols instead of strings - initial
6 years ago
Erez Shinan
f69bceb335
Snap more things into place
6 years ago
Erez Shinan
f960c1b8ac
Initial: Added transformers.py, and Meta to tree
6 years ago
Erez Shinan
25c3c51b1c
Fixed bug in Earley: A tree builder optimization clashed with explicit ambiguity
6 years ago
Erez Shinan
d77f93c818
Standalone generator working again. Updated examples
7 years ago
Erez Shinan
d5c617f0fe
BUGFIX: Non-linearity in tree construction, causing performance issues for large inputs (Issue #94 )
7 years ago
Erez Shinan
ebdad8f144
Refactored parse_tree_builder, much small and cleaner now
7 years ago
Erez Shinan
22e525f53e
Fixed propagate positions. Added lexer_callbacks option.
7 years ago
Erez Shinan
5ac4120b71
Stand-alone tool working for LALR+traditional lexer (first commit)
7 years ago
Erez Shinan
da1910f5b6
More refactoring towards standalone
7 years ago
Erez Shinan
07b5469e86
More refactoring, untangling grammar compilation and parse-tree creation
7 years ago
Erez Shinan
38c5fd244a
Improved grammar validation and refactored the lexers
7 years ago
Erez Shinan
1cc4c965e8
Big Refactor: Grammars now build in half the time. Code shorter & cleaner.
7 years ago