Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site well.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!amdcad!lll-crg!well!farren From: farren@well.UUCP (Mike Farren) Newsgroups: net.lang.c Subject: Re: C not LALR(1) & compiler bugs Message-ID: <561@well.UUCP> Date: Mon, 27-Jan-86 05:15:00 EST Article-I.D.: well.561 Posted: Mon Jan 27 05:15:00 1986 Date-Received: Tue, 28-Jan-86 06:15:56 EST References: <10200035@ada-uts.UUCP> Organization: Whole Earth Lectronic Link, Sausalito, CA Lines: 40 In article <10200035@ada-uts.UUCP>, richw@ada-uts.UUCP writes: With a little creative deletion: > C's grammar is CONTEXT SENSITIVE !? Can it be ?! > To see this, consider this program line > > A ( *B ); > > If A has been defined as a typedef name, then the line is a > declaration of a variable B to be of type "pointer to A." > (The parentheses surrounding "*B" are ignored.) If A is not > a type name, then this line is a call of the function A with > the single parameter *B. This ambiguity cannot be resolved > grammatically. > Doesn't that make you wonder if something is SERIOUSLY wrong with C? No, it supports my long-held theory that even Kernighan and Ritchie are only human. Oops, perhaps, but hardly a fatal flaw. > Personally, I think that the real fault for my "buggy" compiler > lies not with the compiler writer, but in the shoddy language design > that haunts the deep-dark corners of C. I mean, is there any excuse > for the grammar being context sensitive? Or, for that matter, for > identifiers having only 8 significant characters? > > -- Rich "Picky-Picky-Picky" Wagner Well, I think you've lived up to your nickname. One example of context sensitivity, especially in an area which is designed solely to make things a little easier on us poor programmers, hardly makes for "shoddy language design". There's probably no excuse, but then, I don't think that one is needed - too many good programs have been written for two many years using C for me to think it shoddy. As to the 8 significant characters, that's a problem for the compiler designer, not a built-in limitation, and undoubtedly stems from associated assembler and linker limitations, not C's own. -- Mike Farren uucp: {your favorite backbone site}!hplabs!well!farren Fido: Sci-Fido, Fidonode 125/84, (415)655-0667