Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Grammar changes that lead to the successful parse of a 200KiB real-life Prospero Extended Pascal file.
You were asking about performance: The parse takes 13 minutes. The generated HTML file is close to 24 MiB large. I have never traced all of it, because my trace files passed the 1GiB mark and I am short on disk space.
So, it's not fast. To be fair, this grammar is bloated and could probably be optimised heavily for speed. But I like to stay close to the text of the standard, and it is not too slow for my application.
I have been delayed with the documentation that I promised, because it came to me that trying the rules in
longest_match
could possibly be parallelised, and how cool would that be? I almost have it working, but at least on OS X I get a bus error, possibly because of the recursive calls tolongest_match
(I counted 52 levels maximum in my test) and because of the small default stack space for threads on OS X. When I only parallelised the first call tolongest_match
it did work, and 3 minutes quicker, but it doesn't feel right to make a PR for that. And, I didn't take data sharing measures, so each thread is probably using its own memoisation table, which probably wastes a lot of work. So a real solution would involve a lot more I fear, and it is not going to be real fast anyway. But in case we need it, it is in my branch https://github.com/veelo/Pegged/commits/parallel.