Looking at https://llvm.org/docs/TableGen/ProgRef.html I've just added a partially working grammar/parser for tablegen in https://mingodad.github.io/parsertl-playground/playground/ an Yacc/Lex compatible online editor/tester (select "Tablegen-LLVM parser (partially working)" from "Examples" then click "Parse" to see a parser tree for the content in "Input source").
Any feedback is welcome !