Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Re: zortech problem with lex Message-ID: <25F8C62D.7937@paris.ics.uci.edu> Date: 10 Mar 90 09:17:33 GMT References: <6300008@ux1.cso.uiuc.edu> <24800002@sunb6> <25ECE752.29589@paris.ics.uci.edu> <10541@alice.UUCP> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 23 In article <10541@alice.UUCP> bs@alice.UUCP (Bjarne Stroustrup) writes: >... There can be no simple LALR(1) parser for C++. Gosh darn it Bjarne! Here I am trying to dispel this inexact notion, and here you are perpetuating it! Of course in any *practical* sense, you are correct. Any real compiler or translator will probably try to use LALR(1) grammar rules to parse and disambiguate as much of that language as possible, but don't you agree that V* qualifies as an LALR(1) grammar and that this "grammar" accepts all valid sentences in C++? >Had I had 20/20 foresight I would probably have chosen an LALR(1) grammar >for C++. Don't you mean to say that you would have designed a language in which more cases could be determined to be either legal or illegal via a "simple" LALR(1) parse (without lexical tricks)? Isn't that more accurate? // Ron Guilmette (rfg@ics.uci.edu) // C++ Entomologist // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.