I’m gonna write a grammar that has variants across the different versions of the language, this differences are somewhat small, like adding or removing operators, or changing the definition of a number to include int64 and uint64 instead of only doubles, and such.
Is there a simple way to do this? Would it require four grammars? if so can there be a base grammar that each would extend in their own way?
I would like to do something similar for SQL and the different variations (primarily Presto and Spark). Any suggestions on a starting point?
Please take a look at lezer 0.10.0—specifically the dialect feature it adds.