Interpreting the D grammar

Xinok via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 2 11:06:56 PDT 2015


On Sunday, 2 August 2015 at 17:33:35 UTC, Jacob Carlborg wrote:
> On 02/08/15 18:37, MakersF wrote:
>
>> Of course it's recursive! Do you want the grammar to be able 
>> to only
>> define a finite number of programs?
>
> I don't know how this work, that's why I'm asking. But I read 
> something about left recursion needs to be removed to be able 
> to parse a grammar, at least for some parsers.

There's lots of videos online that show you how to do this. I 
suppose some parsers are smart enough to rewrite the grammar to 
remove left recursion. Otherwise, for a simple parser which does 
nothing more than a breadth-first search, it may require 
exponential time to parse a string.


More information about the Digitalmars-d mailing list