3 ms·
> it doesn't appear there is any other "serious" meta-language for top-down parsers other than ANTLR? Have you explored Perl 6 and its Rules sub-language and e
by raiph 10y ago
> it doesn't appear there is any other "serious" meta-language for top-down parsers other than ANTLR?
Have you explored Perl 6 and its Rules sub-language and engine?[1] The Rakudo Perl 6 compiler is written in Perl 6 using Rules.[2]
[1] https://en.wikipedia.org/wiki/Perl_6_rules https://en.wikipedia.org/wiki/Perl_6_rules
[2] https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar... https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.....
- chubot 10y agoI have heard of this feature of Perl 6, but not used it. One obvious difference is that ANTLR is language-agnostic in that you can generate parsers in C++ or Python too, while I assume Perl 6 doesn't have that functionality. So that limits its appeal. (Although honestly ANTLR is pretty skewed towards Java; the generated code is kind of like Java-in-Python or Java-in-C++.) I'm curious what algorithm Perl uses to match grammars. ANTLR uses a few algorithms, like the one to generate lookahead tables for LL(k), and then the LL() algorithm, and apparently a new one with ALL() in ANTLR v4.