Re: LR(1) Parsers

torbenm@diku.dk (Torben AEgidius Mogensen)
27 Feb 2000 02:37:05 -0500

          From comp.compilers

Related articles
LR(1) Parsers nadersoliman@flashmail.com (Nader O. Soliman) (2000-02-23)
Re: LR(1) Parsers torbenm@diku.dk (2000-02-27)
| List of all articles for this month |

From: torbenm@diku.dk (Torben AEgidius Mogensen)
Newsgroups: comp.compilers
Date: 27 Feb 2000 02:37:05 -0500
Organization: Department of Computer Science, U of Copenhagen
References: 00-02-126
Keywords: parse

"Nader O. Soliman" <nadersoliman@flashmail.com> writes:


>There are some specifications that is required for production rules to
>be acceptable, if the parser is an LL(1) parser.


>Now, is there anyone knows the rules required for and LR(1) parser
>such as YACC?


There are requirements for LR(1) grammars, but these are not as easily
explained by local rules as in the case of LL(1) parsers. Basically,
you have to construct the parse-table to see if the grammar is
acceptable. However, a minimum requirement is that the grammar is
unambiguous (though most LR(k)/LALR/SLR parser generators allow
ambiguities to be resolved by addition of disambiguating rules such as
operator precedence declarations).


As for your explanations of what LL(1) and LR(1) means, these seem
basically correct, though they don't tell the whole story.


Torben Mogensen (torbenm@diku.dk)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.