On Jun 9, 2007, at 1:28 AM, Roman Redziejowski wrote:


On Jun 8 13:44:15 EDT 2007 Terence Parr wrote:

Despite the disadvantages, I still favor the separate lexer as it's faster.

I fully agree. As I pointed out in my paper, PEG is not good at specifying lexical structures. But, if I need an ad hoc parser, I would prefer to skip
a separate lexer. So, my question is: how could one modify PEG
to facilitate this, and at the same time have a decent speed?

The approach I've taken in ANTLR is to optimize PEG with LL(*) to reduce number of backtracking decisions. Analogous to GLR's optimization over Earley's algorithm: only pursue multiple paths upon LR nondeterminism.

ANTLR lexers can backtrack if they need to but generally use a DFA predictor and normal LL lexing.

BTW: I've rewritten Jean Bovet's and my ANTLRWorks paper to include a description of LL(*) and relationship to other strategies...will resubmit to SP&E shortly. Anybody care to review a draft for me?

Ter

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

Reply via email to