7#include "antlr/BitSet.hpp"
10#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
14BitSet::BitSet(
unsigned int nbits)
17 for (
unsigned int i = 0; i < nbits ; i++ )
21BitSet::BitSet(
const unsigned long* bits_,
unsigned int nlongs )
24 for (
unsigned int i = 0 ; i < (nlongs * 32); i++)
25 storage[i] = (bits_[i>>5] & (1UL << (i&31))) ?
true : false;
32void BitSet::add(
unsigned int el)
34 if( el >= storage.size() )
35 storage.resize( el+1,
false );
40bool BitSet::member(
unsigned int el)
const
42 if ( el >= storage.size())
48ANTLR_USE_NAMESPACE(std)vector<unsigned int> BitSet::toArray()
const
50 ANTLR_USE_NAMESPACE(std)vector<unsigned int> elems;
51 for (
unsigned int i = 0; i < storage.size(); i++)
60#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE