Coding 2023-07-24
I was doing stuff besides working on coding today, so I'm going to just drop a few notes on implementation stuff:
- The logic for constructing a parse forest requires the index of the start.
- The straightforward way to handle this is with an array, but I'm skeptical of the performance characteristics.
- So I'm still messing around with whether it's possible to implement something decent using list. Like some kind of system of adding up indices so it's actually pointing back instead of counting from the beginning. There are two immediately obvious drawbacks to this approach: it sounds tricky, which isn't great when I'm trying to figure out the actual main implementation at the same time; and I don't actually know if any of it would help.
- For parse forest construction, the useful indices would be the left-hand-side and the start index.
- For actually constructing stuff, I think the relevant thing is completion, because the work structure can have any required format. To carry out completion, we need to look for a non-terminal after the dot, which is a completely different arrangement of data.
- Maybe instead of "just" a mapping from left-hand-side to start index to sets of zippered right-hand-sides, I should have "that, plus a map from non-terminal-after-dot to 'whatever the format is for inserting into the work queue'"
I think that's enough to work with later. For now, I'm going to properly wrap up.
Good night.