Did you consider using ANTLR instead of tree-sitter parser? Don't know too much about tree-sitter but is seems to be a batteries included approach to building parsers?