Context: I'm porting an existing handwritten parser to use parsus.
Right now, parsus is built on the presumption that a Grammar is complete. It would be helpful if Grammars could be composed.
Because it doesn't support this natively, I've resorted to this hack:
internal abstract class C<T> : Grammar<T>() {
// ... grammar
}
val extendedGrammar = object : C<Expression>() {
// Additional grammar
override val root by parser_in_C_class
}
Context: I'm porting an existing handwritten parser to use parsus.
Right now, parsus is built on the presumption that a Grammar is complete. It would be helpful if Grammars could be composed.
Because it doesn't support this natively, I've resorted to this hack: