|LR(1) Parsers email@example.com (Nader O. Soliman) (2000-02-23)|
|Re: LR(1) Parsers firstname.lastname@example.org (2000-02-27)|
|From:||email@example.com (Torben AEgidius Mogensen)|
|Date:||27 Feb 2000 02:37:05 -0500|
|Organization:||Department of Computer Science, U of Copenhagen|
"Nader O. Soliman" <firstname.lastname@example.org> 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 (email@example.com)
Return to the
Search the comp.compilers archives again.