4 ms·
The C comment example seems more simply solved using non-greedy matching. Is that not done because the parser absolutely does not support non-greedy (or minimal
by doomrobo 11y ago
The C comment example seems more simply solved using non-greedy matching. Is that not done because the parser absolutely does not support non-greedy (or minimal-munch) matching?
- profquail 11y agoThe parsing of C-style comments is a sort of standard example to demonstrate some additional features you have available when your lexer-generator is implemented using regular expression derivatives. See section 5 of "Regular Expression Derivatives, Re-examined" for details: http://www.mpi-sws.org/~turon/re-deriv.pdf http://www.mpi-sws.org/~turon/re-deriv.pdf