Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!wuarchive!sdd.hp.com!ucsd!ucbvax!CTC.CONTEL.COM!reid From: reid@CTC.CONTEL.COM (Tom Reid x4505) Newsgroups: comp.lang.modula2 Subject: Re: Modula-2 grammar Message-ID: <9012111923.AA16232@ctc.contel.com> Date: 11 Dec 90 19:23:29 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Modula2 List Organization: The Internet Lines: 39 = > Does anyone out there have either a corrected version = > of this grammar or some other complete machine readable = > Modula-2 grammar that they could send to me? Pretty = A student and I are working on a Modula-2-to-Ada translator and pretty well have the kinks worked out of the PIM, 3rd Ed., Corrected EBNF syntax. There are at least four places it is ambiguous - all needing left factoring (e.g., Dsgntr is in the FIRST set of the Assign and ProcCall right-hand-sides of Statement). Another more difficult example is that QualId ::= Id { "." Id } and Dsgntr ::= QualId { "." Id | "[" ExprList "]" | "^" } is ambiguous. Fortunately, our translator writer system has a sense of humor at the moment which allows this and the semantics are right. In fact, all of the problems seem to have QualId lurking somewhere. We about have this ironed out and I will send it out in a message when it is. I have found it amusing that the cross reference listing that accompanies the PIM 3 EBNF wasn't extended to calculating the selector sets and verifying LL1. Either that or including the LL1 grammar that the his parser was "really" generated from. Warning - just because we think that we have an LL1 EBNF grammar does not guarantee that it matches any particular vendors source programs :-> Incidently, the recursive descent parser created from the EBNF breaks the FST compiler because it exceeds 64K characters. Score one for table- driven things. Tom. Thomas F. Reid, Ph. D. (703)818-4505 (work) Contel Technology Center (703)742-8720 (home) 15000 Conference Center Drive Net: reid@ctc.contel.com P.O. Box 10814 Chantilly, Va. 22021-3808