On Jun 12, 2007, at 8:45 AM, Robert Grimm wrote:
If you have a separate lexer and parser, then you need to have different lexer states to capture the different contexts. But the original lexer specifications are not written with states in mind and you have to backfit them. In contrast, with scannerless parsing everything works as expected. On a much smaller scale, I ran into this problem when bootstrapping Rats! with an ANTLR grammar. I mentioned to you before that I gave up on the ANTLR grammar when trying to add character classes and couldn't get lexer states to work in ANTLR. The not getting it to work part is likely my short- coming, but having to go through this extra step makes grammar extension/composition so much harder for everyone.

Yep, a scannerless system is really the only way to do seamless merging of languages and composition.

Ter

_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg

Reply via email to