On Sunday, 8 November 2015 at 14:37:32 UTC, Sebastiaan Koppe
wrote:
You mean instead of mixin(grammer(`...`)) I write the output of
grammer(`...`) to a file and include that into the final build?
Yes, use asModule() for that [1]. Not only does it enable using
large grammars, it also saves compilation time for builds after
the grammar has stabilised.
And should the grammar still be too large, it is good to know
that Pegged is good at composing a parser from different
sub-grammars [2]. So the difficulty is only in finding natural
boundaries at which the grammar can be split, making it work
should be easy.
[1]
https://github.com/PhilippeSigaud/Pegged/wiki/Grammars-as-D-Modules
[2]
https://github.com/PhilippeSigaud/Pegged/wiki/Grammar-Composition