Was this https://ctan.org/pkg/expex ?
Not quite relevant, but we actually composed our grammars in a variant of DocBook XML, then converted them automagically to XeLaTeX for typesetting. Andy Black has a similar toolset that starts with his own document-oriented XML and converts this to XeLaTeX. I stole (with his permission) the code to convert XML interlinear into a LaTeX interlinear format.