code: private static int calcOcc(Alternative ab, boolean calcMax, AgBuffer cb) {
          int occ;
          int i;
          int max;
          State state;
  
          occ = 0;
          max = ab.getArgCount();
          for (i = 0; i < max; i++) {
              state = cb.lookup(ab.getArgAttribute(i));
              if (state != null) {
                  occ += (calcMax)? state.maxOcc : state.minOcc;
              } else {
                  occ += 1;
              }
          }
          return occ;
      }
docs: TODO: move to Alternative