ANTLR Support Libraries 2.7.1+
|
00001 #ifndef INC_BitSet_hpp__ 00002 #define INC_BitSet_hpp__ 00003 00004 /* ANTLR Translator Generator 00005 * Project led by Terence Parr at http://www.jGuru.com 00006 * Software rights: http://www.antlr.org/license.html 00007 * 00008 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/BitSet.hpp#2 $ 00009 */ 00010 00011 #include <antlr/config.hpp> 00012 #include <vector> 00013 #include <stdexcept> 00014 00015 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00016 namespace antlr { 00017 #endif 00018 00040 class ANTLR_API BitSet { 00041 private: 00042 ANTLR_USE_NAMESPACE(std)vector<bool> storage; 00043 00044 public: 00045 BitSet( unsigned int nbits=64 ); 00046 BitSet( const unsigned long* bits_, unsigned int nlongs); 00047 ~BitSet(); 00048 00049 void add( unsigned int el ); 00050 00051 bool member( unsigned int el ) const; 00052 00053 ANTLR_USE_NAMESPACE(std)vector<unsigned int> toArray() const; 00054 }; 00055 00056 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00057 } 00058 #endif 00059 00060 #endif //INC_BitSet_hpp__