Compiler-compiler-compiler

Christopher F Clark <christopher.f.clark@compiler-resources.com>
Sat, 25 Jun 2022 18:32:07 +0300

          From comp.compilers

Related articles
The remarkable similarities between Flex/Lex and XSLT costello@mitre.org (Roger L Costello) (2022-06-24)
Re: The remarkable similarities between Flex/Lex and XSLT gah4@u.washington.edu (gah4) (2022-06-24)
Compiler-compiler-compiler christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-06-25)
| List of all articles for this month |

From: Christopher F Clark <christopher.f.clark@compiler-resources.com>
Newsgroups: comp.compilers
Date: Sat, 25 Jun 2022 18:32:07 +0300
Organization: Compilers Central
References: 22-06-073 22-06-074
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

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
------------------------------------------------------------------------------



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.