Robin Houston writes: : Interesting! : : I think you're imagining that it will be possible to define something : like an EBNF grammar. Is that right? Will you be able to get a parse : tree out, rather than just a flat list? (There's certainly an issue : with my current implementation about what to do with the strings : captured by recursive calls. Currently I'm just discarding them.)
Yes, that's what I'm imagining. It ought to be pretty straightforward to arrange to return recursive set of arrays or hashes. One big question is where to store the rules such that you can have a mutable grammar over lexical scopes without changing the grammar globally. Perhaps a derived grammar should be represented by a derived class, so that most rules can be inherited. : Good luck with the apocalypse. Thanks. The next one is on regexes, so that's the sort of thing I'm thinking about right now. Larry