On Mon, 2007-02-05 at 23:13 -0500, Jason Morrison wrote: > If not, any thoughts on the idea? Is this something that can be > usefully resolved via error symbols? (Perhaps I am simply ignorant of > an error-recovery enabling flag in my trusty JRuby parsing calls, and > would be better served directing inquiry to the JRuby list?) I'd > rather not just blast an arbitrary number of close-parens and "end"s > at the cursor position until a valid parse surfaces, the > quickest-and-dirtiest solution that originally came to mind ; )
I think that's pretty much one of the better solutions. Either you can do "follow set recovery", where you know what tokens should come next to close out the current nonterminal, or you can do "panic mode" where you just slap on closing tokens and hope something works, or you remove/replace tokens until it gets back to some known state. You've probably already encountered the Burke-Fisher algorithm, about which I am clueless but it seems to be good :-) You might want to post a question about this to the compilers list (*); all sorts of gurus hang out there and it's moderated by John Levine who wrote yacc. Yours, Tom (*) Search for 'compilers' here, not sure of a better way to get there: http://lists.gurus.com/cgi-bin/mj_wwwusr/domain=lists.iecc.com _______________________________________________ Rubygrammar-grammarians mailing list [email protected] http://rubyforge.org/mailman/listinfo/rubygrammar-grammarians
