johnl@ima.UUCP (Compilers mailing list) (03/18/86)
I have some questions on LALR grammers. 1) How does one convert a BNF to LALR. (To get rid of conflicts from Yacc etc. ?) 2) When there are "NO CONFLICTS", is there some way of making sure the parser generated does what it is supposed to? 3) Are there systematic procedures to do the above ? 4) Is it more efficient to try something and then test for LALRness? Thanks in advance. ...hplabs!tektronix!reed!omssw2!omssw1!pathy [The dragon book addresses this in some detail. What I have always done is to run my grammar through Yacc and then look at the Yacc listing to find out what it is that Yacc can't deal with; then adjust the grammar. You always have to test your parser, since humans are not so good at specifying things formally that you can be sure that your formal grammar describes the language that you thought you were describing. Other thoughts are, as always, invited. -John] -- John Levine, Javelin Software, Cambridge MA +1 617 494 1400 { decvax | harvard | think | ihnp4 | cbosgd }!ima!johnl, Levine@YALE.ARPA The opinions above are solely those of a 12 year old hacker who has broken into my account, and not those of my employer or any other organization.