diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2024-10-19 20:03:50 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2024-10-19 20:03:50 -0300 |
commit | 16169311d2d39d82a799fd90c77c829767842c9d (patch) | |
tree | fab553bbf2003ac132b50e41f65326c9d6051489 /notes.md | |
parent | a60d9bd972f31a79aa0f0f8b10585187dc418fe8 (diff) | |
download | monparser-16169311d2d39d82a799fd90c77c829767842c9d.tar.gz monparser-16169311d2d39d82a799fd90c77c829767842c9d.zip |
Revert some changes
Diffstat (limited to 'notes.md')
-rw-r--r-- | notes.md | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/notes.md b/notes.md deleted file mode 100644 index 717613a..0000000 --- a/notes.md +++ /dev/null @@ -1,33 +0,0 @@ -# one-of in parallel -## Problem -When in a one-of block, it's harder to tell where an error came from. - -## Current solution -We have critical blocks that stop parsing when the parser inside fails. - -## Problem with current solution -We need to be dilligent in placing critical blocks. - -## Another approach -We could take a page from LR parsers and instead of driving the parsing from the parsers themselves we invert the flow, making the input drive the parsing. This results in a breadth first parsing, where the one-of block parses one step of every of it's children and decides which to keep. In the event there's only one children left, it is critical, so a failure stops parsing and reports the error. - -## How to select between BF and DF when parsing -Add an extra argument to parser type (lambda (input)) for the parsing mode. -one-of will be BF and comp will be DF. -This means that the immediate children of a one-of block will be parsed step by step. - -## Implementing BF in bind -Instead of calling the resulting function with the input, return it. -It will be the caller's responsibility to call the resulting lambda with the appropiate input. -This will give control to the one-of block to call the next parsing step. - -# lazy binding -## Problem -If defining a parser that surrounds another, the inner parser must know about what the delimiter parser is attempting to parse, specially after the inner parser. - -## Solution -Implement lazy binding. This sweeps the next parser across the input until it finds where it first parses, then takes the distance from the current input and calls the current parser with a limit on how much input to parse equal to said difference. - -# TODO -* Change the parser entry so that it takes streams as input. This will make it easier to interact with other packages. -* Change literal parser into a macro that chains unit parsers. This will take advantage of the BF feature in one-of block. |