> Suggestion 1: If the set of possible "length" values is not too large, > you could write (or have auto-generated) a grammar with a rule for > each length value.
In general lexing Hollerith-style tokens is an amusing problem. They're a really nice feature for machine-to-machine formats, since they massively simplify quoting, and before anyone says 'why would we be using human readable machine-to-machine formats,' I should point out that that's what xml is supposed to be, and <rant>this style of format seems at least as competent as xml is!</rant> I've been thinking that a nice compromise (in a new language design) would be to allow optional Hollerith quoting while retaining the quote marks. Thuis for instance, while one could write C-ishly "He said \"foo\"!", we would also accept 14"He said "foo"!" as equivalent - specifically checking that the 15th character is indeed a close quote, and avoiding the editing errors that Hollerith fields otherwise invite. Of course, lexer generators *never* oblige with these structures ;). Cheers all, Stephen _______________________________________________ SableCC-Discussion mailing list [email protected] http://lists.sablecc.org/listinfo/sablecc-discussion
