Coding 2022-01-07

By Max Woerner Chase

All right, my conclusion from thinking about trying to implement Earley parsing differently, is that I really should get a basic working implementation together. Prototype based on a design, before messing with the design. So, let's take this closely. First off, I've got some code that is very loosely based on Spark, so let's take stock of that.

Classes for:

Anyway, let's take the tutorial slowly.

Okay, I think I've written what I need for the outer loop, and some helpful stuff for the inner loop. Let's compare the effects of prediction, scanning, and completion.

Thinking about how these relate, prediction is the only process which adds a new starting index. I'm not sure if that is relevant to anything.

My big concern with these is, according to the open letter I linked yesterday, the different types of operation can be strictly sequenced, but I don't understand how that's possible. Let's set aside scans, since those have much easier behavior: you can just iterate through one set, and perform all scans, into the next set.

So, doing completions and then predictions works if we know that prediction will never add a completed set. If we allow empty rules, then it currently appears to me that the easiest way to guarantee that prediction doesn't add completed rules would be to essentially run any possible completions "in-line" as part of prediction.

It's getting late, so I'm going to take "I thought about this and wrote some helper functions" as a win, and get ready for bed.

Good night.