help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QUESTION: what does LR(0) mean? and what's behind the name LR0.c ?


From: Akim Demaille
Subject: Re: QUESTION: what does LR(0) mean? and what's behind the name LR0.c ?
Date: Wed, 31 Dec 2014 12:31:35 +0100

> Le 6 oct. 2014 à 19:37, John Levine <address@hidden> a écrit :
> 
> In article <address@hidden> you write:
>> Hi, I'm going through the bison code, and I'm curious as to the name of the 
>> source code file LR0.c .
>> 
>> Seems like this file creates the states.  After they are created, the first 
>> state is at state 0.
> 
> You might want to read up on LR parsing. LR(0) langauges are the ones
> that can be parsed with no lookahead, i.e. zero tokens.  Ordinary
> bison parsers are LR(1) which, to greatly oversimplify, does LR(0)

FWIW, you meant LALR(1) here, not LR(1).

> parsing where it can, and looks one token ahead where it can't.
> 
> The Wikipedia article is a reasonable place to start, and the topic is
> covered in all modern compiler textbooks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]