Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: minforth@arcor.de Newsgroups: comp.compilers Subject: Re: Supporting multiple input syntaxes Date: Thu, 13 Aug 2020 14:15:09 -0700 (PDT) Organization: Compilers Central Lines: 14 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <20-08-005@comp.compilers> References: <20-08-002@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="69491"; mail-complaints-to="abuse@iecc.com" Keywords: parse, C, tools, comment Posted-Date: 13 Aug 2020 18:24:34 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <20-08-002@comp.compilers> Xref: csiph.com comp.compilers:2557 Am Donnerstag, 13. August 2020 00:32:56 UTC+2 schrieb luser droog: > I've got my project successfully parsing the circa-1975 C syntax > from that old manual. I'd like to add parsers for K&R1 and c90 > syntaxes. > > How separate should these be? Should they be complete > separate grammars, or more piecewise selection? ... Why not settle for one master dialect and use awk to translate between dialects? [Probably because there is a great deal of C code written to comply with the various versions of the standard, users want error messages that match the code they wrote rather than some intermediate code, and it would be quite an awk program that could reconcile all the differences among C flavors. -John]