Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!elroy.jpl.nasa.gov!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Re: zortech problem with lex Message-ID: <25F8C92A.9349@paris.ics.uci.edu> Date: 10 Mar 90 09:30:18 GMT References: <6300008@ux1.cso.uiuc.edu> <24800002@sunb6> <25ECE752.29589@paris.ics.uci.edu> <10541@alice.UUCP> <6553@cadillac.CAD.MCC.COM> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 26 In article <6553@cadillac.CAD.MCC.COM> ned@MCC.COM (Ned Nowotny) writes: > >Given the imprecise nature of the C++ specification, I am more than a >little disappointed that the language does not have a grammar expressible >in BNF form that will accept all legal strings and reject all illegal >strings. As Joe English also points out, this is utter nonsense. In all of the useful languages that I know of, the correctness of statements is based upon both syntax *and* semantics. Neither one can be used in isolation to decide on the correctness of statements. >... While it may be >true that some LALR(1) grammar will accept all legal C++ strings, the fact >that the grammar must also accept illegal strings makes the claim that >C++ is somehow a LALR(1) language something less than useful. I agree that in practice, nobody actually is stupid enough to use V* as their LALR(1) grammar for parsing C++ or other languages, but just because the statement "C++ is LALR(1)" may not be "useful" does not mean that it is not 100% accurate. In fact, I believe that it is. // Ron Guilmette (rfg@ics.uci.edu) // C++ Entomologist // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.