Erez Sh
ede2ed78ec
Fix puppet, add immutable puppet with hash
4 years ago
Erez Sh
4d096fae16
Refactor: Split ParserState into ParseConf
4 years ago
Erez Sh
f20d72d9f6
Fix due to CR - handle UnexpectedCharacters resume in the error loop
4 years ago
Erez Sh
45467e1f61
Changes due to code review by @MegaIng
4 years ago
Erez Sh
72e7926097
Completely redesigned the interface between Lexer<->Parser, and refactored LALR parser and lexers
4 years ago
Erez Sh
e84a64fc52
Added support for rule priorities in LALR
4 years ago
Louis Dubois
a423097362
fix: Propagate debug flag on loading grammar from cache
The debug flag is already saved in the cached file, but is not
resumed on loading the dumped file. To solve that,
- add argument `debug` to parser_fronteds.WithLexer.deserialize
- add argument `debug` lalr_parser.LALR_Parser.deserialize
- propagate the value of the `debug` option on resuming a cached
grammar, in lark.Lark._load
4 years ago
Louis Dubois
abdbabe429
fix: Propagate debug flag on loading grammar from cache
The debug flag is already saved in the cached file, but is not
resumed on loading the dumped file. To solve that,
- add argument `debug` to parser_fronteds.WithLexer.deserialize
- add argument `debug` lalr_parser.LALR_Parser.deserialize
- propagate the value of the `debug` option on resuming a cached
grammar, in lark.Lark._load
4 years ago
Erez Sh
02d57bc32a
Small adjustments to PR
4 years ago
MegaIng1
cb2d9cded0
Refactored ParserPuppet, added stubs
4 years ago
MegaIng1
a7bcd0bc2d
Added `accepts` attribute to `UnexpectedToken` and update stubs
4 years ago
Erez Sh
cc1092bd53
Refactored puppet + small fixes
4 years ago
Erez Sh
66a073d0aa
Added support for error handling, using a puppet parser.
TODO: Add docs
4 years ago
Erez Sh
4463524b3a
Puppet initial
4 years ago
Erez Sh
e12e1ccbf9
Minor refactor
4 years ago
Erez Sh
3bee21051e
Reverted changes regarding EOF
4 years ago
Erez Sh
c56112eea3
Added debug prints for parser error (in debug mode)
4 years ago
Erez Sh
cf7479f186
Post-merge fixed for end_symbol, + two more tests (Issue #237 )
5 years ago
Erez Sh
b9c81a5450
Refactor: Simplify code by assuming rule.options is never None
5 years ago
Erez Shinan
8466981c08
Cleanup
5 years ago
Raekye
0c59cba3f5
implement DeRemer and Pennello's lookahead algorithm for LALR(1)
5 years ago
Raekye
6f412c25b7
LALR optimizations and profiling
5 years ago
Raekye
21c41e54a9
lalr parser
5 years ago
Erez Shinan
aa75d50bd5
End symbol working for lalr + fixed validation for undefined %ignore
5 years ago
Erez Shinan
f1e844accd
Mid work. Not promising
5 years ago
Erez Shinan
a798dec779
Fix to new serializer code (Discussed in issue #349 )
5 years ago
Erez Shinan
3c64c56bcd
All tests passing
5 years ago
Erez Shinan
94e15fb6f7
Mid work. Almost stable
5 years ago
Erez Shinan
e52cc46fc5
Minor cleanup
5 years ago
Erez Shinan
d13ebb9c15
Using a mostly-generic serialization method
5 years ago
Erez Shinan
066303fdab
Serialized lark is now json compatible
5 years ago
Erez Shinan
335206911d
Basic serialize/deserialize working!
5 years ago
Erez Shinan
120d5b9ffa
Mid work
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
a892f184e3
Fix LALR shift/reduce warnings when debug=True (Issue #258 )
6 years ago
Erez Shinan
106508dcce
Tiny improvement to the LALR parser
6 years ago
Erez Shinan
519b07ceca
Tiny refactor
6 years ago
Erez Shinan
4487bf65c1
EOF token now gets proper line/column number (Issue #228 )
6 years ago
Erez Shinan
bd7e331ad7
Slightly better error message (UnexpectedToken)
6 years ago
Erez Shinan
9ce8a79dc0
Misleading error message at unexpected EOF (Issue #220 )
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
67f372c994
Symbols instead of strings - initial
6 years ago
DrSlump
e69d567bce
example driven parser errors
6 years ago
Erez Shinan
b951b5f79c
Significant reduction in memory consumption (Saving only parse-table instead of analysis instance)
6 years ago
Parker
ce26c7cced
Use loops for flow control instead of catching exceptions
While optimizing hot spots in a tool I wrote I saw this issue. Changing this to use a for loop granted a minor speed boost to my script.
7 years ago
Erez Shinan
6c28010581
Simplified grammar analysis. Improved performance of FIRST/FOLLOW calculations
7 years ago
Erez Shinan
da1910f5b6
More refactoring towards standalone
7 years ago
Erez Shinan
7182ba3991
Minor refactoring for the standalone tool (in progress)
7 years ago
Erez Shinan
39e58cb8fd
Post-refactor cleanup
7 years ago
Erez Shinan
1cc4c965e8
Big Refactor: Grammars now build in half the time. Code shorter & cleaner.
7 years ago