3 ms·
Prolog implements Definite Clause Grammars[0] which can express context-sensitive grammars. In Prolog there is a simple DSL to express DCGs, but in fact DCG jus
by ceceron 6y ago
Prolog implements Definite Clause Grammars[0] which can express context-sensitive grammars.
In Prolog there is a simple DSL to express DCGs, but in fact DCG just uses Prolog runtime features. I don't believe there is aanother general purpose language with such complex parsing just built-in the runtime.
Here you can see my version of the raku parser, it's arguably shorter (I'm not a Prolog expert):
https://swish.swi-prolog.org/p/basic_logic_parser.pl https://swish.swi-prolog.org/p/basic_logic_parser.pl
[0] https://en.wikipedia.org/wiki/Definite_clause_grammar https://en.wikipedia.org/wiki/Definite_clause_grammar