I got some things done today. Basically, just a prototype for a set of functions for a data structure on top of Lua tables, to store keys and values, but also to maintain insertion order.
That should be part of what I need to be able to incrementally construct the grammar. I just need to write some more functions that delegate to that as keys in a higher-order table. And also to work out some way to represent sequences in a way that indexing is comprehensible. I've done stuff along those lines before, but I'm going to need to think about how I want to do it.
Like, I need a mapping from sequences of values to a canonical representation that (I think) needs to be able to retrieve the values.
Hopefully, I'll have a plan there in a few days. For now, I need to wind down.