Path: utzoo!attcan!uunet!lll-winken!lll-ncis!lll-lcc!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: YACC grammar for C language Message-ID: <9363@smoke.BRL.MIL> Date: 14 Jan 89 11:57:23 GMT References: <175@calmasd.GE.COM> <1183@goofy.megatest.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <1183@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: -In article <175@calmasd.GE.COM>, jhh@calmasd.GE.COM (Jung Hamel) writes: -> Does anybody have or know of YACC grammar for C that does -> not require the lexical analyser to differentiate typedef -> names from other identifier names? -Nope, nobody does. There ain't know such thing. If type-names -are treated the same as identifiers, C is inherently ambiguous. More precisely, type names must be taken into account when parsing C. There are cases where the wrong parse will result if this isn't done. -I have a suspicion that the C grammar that has been circulating on the -net for the last year or two, with the comment that all it needs is a -lexical analyzer, is, in reality, a rather arcane practical joke. No, I think the people who keep requesting a copy of it really do think that all they need to do is feed it to YACC and that will take care of the syntactic phase of a C compiler. Of course, they're mistaken..