I actually implemented that in Bison a few years ago, using graphs (DAG) rather than a matrix. You could define groups of totally ordered operators, and they were not (by default) cross comparable.
However, given the low popularity of Bison, and that it's mainly used for its old features, I'm not sure that has ever been used in the wild...