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:
[email protected]
Compiler Resources, Inc. Web Site:
http://world.std.com/~compres
23 Bailey Rd voice: (508) 435-5016
Berlin, MA 01503 USA twitter: @intel_chris ------------------------------------------------------------------------------
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)