Re: Technical question about yacc and LALR parsers

mauney@eos.ncsu.edu (Dr. Jon Mauney)
Mon, 22 Apr 1991 14:18:54 GMT

          From comp.compilers

Related articles
Technical question about yacc and LALR parsers jar@florida.HQ.Ileaf.COMid AA07671; Sun, 21 Apr 91 (1991-04-20)
Re: Technical question about yacc and LALR parsers jml@wally.altair.fr (1991-04-22)
Re: Technical question about yacc and LALR parsers mauney@eos.ncsu.edu (1991-04-22)
Re: Technical question about yacc and LALR parsers bliss@sp64.csrd.uiuc.edu (1991-04-22)
Re: Technical question about yacc and LALR parsers boyland@aspen.berkeley.edu (1991-04-23)
Technical question about yacc and LALR parsers compres!chris@crackers.clearpoint.com (1991-04-21)
| List of all articles for this month |

Newsgroups: comp.compilers
From: mauney@eos.ncsu.edu (Dr. Jon Mauney)
Posted-Date: Mon, 22 Apr 1991 14:18:54 GMT
Keywords: yacc, parse, errors
Organization: Project EOS - North Carolina State University
References: <9104210204.AA07587@florida.HQ.Ileaf.COM>
Date: Mon, 22 Apr 1991 14:18:54 GMT

> ... Note that the following is possible (I think):
>
> state 747
> gathered_type : '[' VOID . ']'
> gathered_type : '(' VOID . ')'


This is not possible using the normal LALR construction, for the
reason you mentioned: transition into a state is due to shifting
of a single symbol. Therefore all configurations must have the
same symbol to the right of the dot. The same must be true of
the state previous to that: The predecessor of the given state 747
would have had to contain
   gathered_type : '[' . VOID ']'
gathered_type : '(' . VOID ')'
which has been shown to be impossible.


The only way that items can differ in the left context is
for one to be contained in the other. For example,
given the grammar
    A --> x B
    A --> x y z
    B --> y w
the CFSM wil l contain the state
    A --> x y . z
    B --> y . w


--
Jon Mauney, parsing partisan
Computer Science Dept.
N.C. State University
--


Post a followup to this message

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