Chanic Panic
bca7c79b1f
Declare instance variable types at class level
3 years ago
Chanic Panic
d7b819e9ce
Continue merging .pyi files
load_grammar, reconstruct, and visitors
3 years ago
MegaIng
67bbb3dc21
Update reconstruct.pyi + add insert_spaces
3 years ago
julienmalard
364f9ae3a5
Response to code review
4 years ago
julienmalard
74c94bb369
Tests now pass!
4 years ago
Erez Sh
afde561ac3
Refactored reconstructor out into tree_matcher. Functionality should stay the same.
4 years ago
Erez Sh
023709f710
Added comment
4 years ago
julienmalard
a768506945
Erez's idea
4 years ago
julienmalard
7a67f0d027
Postproc option for reconstruct, and fixed isalnum bug
4 years ago
Erez Sh
d631cad024
Minor adjustments
4 years ago
MegaIng1
e4e29f5127
Added a bit of explanation for `term_subs`
4 years ago
julienmalard
a3368d8a72
Need to remove duplicate rules for root rools as well.
4 years ago
julienmalard
6b9bd84091
Remove commented out line
4 years ago
julienmalard
bca6cfa458
Expand rules reconstructor test passes
4 years ago
Erez Sh
52e510780a
Small stuff
4 years ago
Erez Sh
b9c81a5450
Refactor: Simplify code by assuming rule.options is never None
4 years ago
Erez Sh
86f1bb1db6
Improved the reconstructor, but it still feels like a lost cause
5 years ago
Erez Shinan
84f08a452f
propagate_positions & maybe_placeholders are now true by default, updated docs, tests & examples accordingly (Issue #449 , #451 )
5 years ago
Erez Shinan
e79689dce7
Remove unused rules (Issue #384 )
5 years ago
PJCampi
c5218b185e
reconstructor creates parser at instantiation and update start_symbol in _reconstruct step.
5 years ago
Erez Shinan
bd75bf2dff
Refactor - callbacks are now {rule: callback}, instead of a Callback object referenced by Rule.alias
5 years ago
Erez Shinan
688c453456
Corrections
5 years ago
night199uk
80a09697fe
Rebuild the way Earley prioritizes ambiguities
- Makes rule ordering the default ambiguity tie breaker.
E.g.
start: a | b
a: "A"
b: "A"
will return:
start
a
start: b | a
a: "A"
b: "A"
will return
start
b
- Replaces the ambiguity='resolve__antiscore_sum' with a separate option: 'priority'.
The priority option has 4 values: 'auto', 'none', 'normal', 'invert'.
'Auto' maps to 'Normal' for CYK and Earley and 'None' for LALR.
'None' filters your priorities and ignores them. This saves some extra tree walking on Earley.
'Normal' uses your priorities untouched, mimicing the old behaviour.
'Invert' negates your priorities, emulating the old 'resolve__antiscore_sum' behaviour.
This allows you to use priority logic even when ambiguity=='explicit', to get a better idea
of the shape of your tree; and to easily disable priorities without removing them from the
grammar for testing (or performance).
- ambiguity='explicit' now correctly returns an ambiguous tree again, as 0.6 did.
5 years ago
evandrocoan
48351c3d3e
Trimmed whitespaces and ensured a new line on the end of the file
5 years ago
Erez Shinan
74fc559ea5
Reconstructor fixes
6 years ago
Jan Rydzewski
3ef84318b1
Removed unused imports and variables
6 years ago
Erez Shinan
1798971455
Adjustments
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
Erez Shinan
f048bfb870
Refactoring around terminals / tokens
6 years ago
Erez Shinan
cffd610e77
Fixed reconstructor. All tests passing
6 years ago
Erez Shinan
d11c67fea0
Fixed reconstruct
6 years ago
Erez Shinan
1cc8bc9848
Refactoring and bugfixes in reconstruct.py
6 years ago
Erez Shinan
b90b0a215f
Fixed reconstruct (Issue #72 )
6 years ago
Erez Shinan
feb95ec64d
Earley now uses dynamic lexer by default. Bump to version 0.3.0
7 years ago
Erez Shinan
a73cc9ad90
Re-wrote the Earley parser to use a parse-forest
It now knows how to resolve ambiguity! And in a memory-efficient way!
7 years ago
Erez Shinan
e151d22ea2
examples.reconstruct_json now working with scanless
7 years ago
Erez Shinan
5c115acbd9
Final fixes for scanless (hopefully)
7 years ago
Erez Shinan
d230e7744c
Pylint
7 years ago
Erez Shinan
4397d38daa
Some fixes in examples
7 years ago
Erez Shinan
a5a20a423a
Changed parser/lexer interface in lark. Bumped minor version
7 years ago
Erez Shinan
4076256faa
Reconstruct working again
7 years ago
Erez Shinan
43da0ddad9
Initial reconstruct, working with example!
Definitely needs more work though
7 years ago