Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Christopher F Clark Newsgroups: comp.compilers Subject: Compiler-compiler-compiler Date: Sat, 25 Jun 2022 18:32:07 +0300 Organization: Compilers Central Lines: 33 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-06-076@comp.compilers> References: <22-06-073@comp.compilers> <22-06-074@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="78835"; mail-complaints-to="abuse@iecc.com" Keywords: tools Posted-Date: 25 Jun 2022 12:43:04 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3097 I think we should have (not sure about the word "need", "should have" is close enough) compiler-compiler-compilers. We know enough to write a single algorithm that can generate regular expression recognizers as either NFAs or DFAs, LL(k) parsers, LR(k) parsers, GLR(k) parsers, PEG parsers, and can incorporate captures, back-references, predicates, adaptive rules, permutations, dynamic precedence rules, etc. We also know enough to include the generation of visitors, attribute evaluators, and other next-level "assistants". Having it accept a variety of notations is also relatively easy. And to truly make it a compiler-compiler-compiler, one needs to make the parts separable and be able to be "generated" in the special case forms (e.g. to be able to recreate an LL version like ANTLR or an LR version like Bison and of course, the variations in between). Circa 2000 we already had a version of our Yacc++ that could generate something close to recursive descent code from an LR grammar, so this is just extending that concept. ANTLR4 is doing something close to the reverse and moving to a more state-machine-like description of (mostly) LL grammars. Thus, creating a compiler-compiler-compiler is a feasible (although non-trivial task). It's on my "to-do" list. -- ****************************************************************************** Chris Clark email: christopher.f.clark@compiler-resources.com Compiler Resources, Inc. Web Site: http://world.std.com/~compres 23 Bailey Rd voice: (508) 435-5016 Berlin, MA 01503 USA twitter: @intel_chris ------------------------------------------------------------------------------