Let's stop parser Hell

deadalnix deadalnix at gmail.com
Sat Jul 7 09:45:09 PDT 2012


On 07/07/2012 12:05, Dmitry Olshansky wrote:
> On 07-Jul-12 13:06, Roman D. Boiko wrote:
>> On Saturday, 7 July 2012 at 00:45:36 UTC, David Piepgrass wrote:
>>> This work on parsers might be a good place for me to dive in. I have
>>> an interest in parsers and familiarity with LL, LALR, PEGs, and even
>>> Pratt parsers (fun!), but I am still inexperienced.
>> ...
>>> One thing that has always concerned me about PEGs is that they always
>>> say PEGs are slower than traditional two-phase LALR(1) or LL(k)
>>> parsers. However, I have never seen any benchmarks. Does anyone know
>>> exactly how much performance you lose in an (optimized) PEG compared
>>> to an (optimized) LALR/LL parser + LL/regex lexer?
>>
>> I decided to ask a question about this:
>>
>> http://stackoverflow.com/questions/11373644/performance-of-parsers-peg-vs-lalr1-or-llk
>>
>>
>>
>> Don't hesitate to edit it if you would like to clarify some aspect.
>
> I can tell you that they are not slower then one another in principle.
> Quality of implementations trumps every theoretical aspect here. LALR is
> usually fast even if implemented by book but they are hard to optimize
> futher and quite restrictive on "semantic extensions".
>
> Proper CFG parsers all are liner-time anyway.
>

D isn't 100% CFG. But it is close.


More information about the Digitalmars-d mailing list