code: private int localCompare(
          Attribute left, Attribute right, AgBuffer rightSemantics, List<Attribute> nextLefts, List<Attribute> nextRights)
      {
          State leftState;
          State rightState;
  
          if (left.symbol != right.symbol) {
              throw new IllegalStateException();
          }
          leftState = lookup(left);
          rightState = rightSemantics.lookup(right);
          if (leftState == null && rightState == null) {
              return EQ;
          }
          if (leftState == null || rightState == null) {
              throw new IllegalStateException("different number of productions");
          }
          return leftState.compare(rightState, nextLefts, nextRights);
      }
docs: Adds only states to left and right that are reached by eq states
  Never returns ALT.