#include "occurrence.h"
#include <assert.h>

int aka2::unbounded = -1;

using namespace aka2;

bool occurrence::in_range(int count) const {
  assert(count >=0);
  if (maxOccurs_ == aka2::unbounded)
    return count >= minOccurs_;

  assert(minOccurs_ <= maxOccurs_);
  return (minOccurs_ <= count) && (count <= maxOccurs_);
}
