Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site ada-uts.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!ada-uts!richw From: richw@ada-uts.UUCP Newsgroups: net.lang.c Subject: Re: C not LALR(1) & compiler bugs Message-ID: <10200038@ada-uts.UUCP> Date: Mon, 3-Feb-86 11:53:00 EST Article-I.D.: ada-uts.10200038 Posted: Mon Feb 3 11:53:00 1986 Date-Received: Thu, 6-Feb-86 05:22:33 EST References: <10200035@ada-uts.UUCP> Lines: 39 Nf-ID: #R:ada-uts:10200035:ada-uts:10200038:000:1437 Nf-From: ada-uts!richw Feb 3 11:53:00 1986 Some clarifications: Whether the ambiguity pointed out in H&S causes C's grammar to be context sensitive deserves to be questioned. My faint recollection of what it technically means to be context sensitive doesn't seem to apply (i.e. more the one terminal and/or non-terminal on the left-hand-side of a production?). However, whether or not H&S is correct in using the term "context- sensitive", there IS a point to be made! By simply looking at A (*B) ; the parser CAN generate A (sub-) tree for that statement/declaration. That is, the parser WILL still only recognize strings in the language for C (where language is defined in the more formal sense of being a possibly-infinite set of strings). HOWEVER, the tree that is built for this statement/declaration contains almost no semantic information. Contrast it against the sub-tree built for if () else After parsing that, the language processor KNOWS that that is an IF statement. However, after parsing, the language processor needs to look at PREVIOUS information (context, if you like) to figure out if A (*B) ; is a statement (i.e. procedure call) or a variable declaration. There's a big difference between the two interpretations... My apologies for probably using the wrong terminology, but remember that it was quoted from H&S (i.e. how to pawn off blame for a mistake). -- Rich