this is a C version of the cut down Bitset class provided with the java version of antlr 3.
#include <antlr3defs.h>
#include <antlr3collections.h>
Data Structures | |
struct | ANTLR3_BITSET_LIST_struct |
struct | ANTLR3_BITSET_struct |
Defines | |
#define | ANTLR3_BITSET_BITS 64 |
How many bits in the elements. | |
#define | ANTLR3_BITSET_LOG_BITS 6 |
log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS | |
#define | ANTLR3_BITSET_MOD_MASK ANTLR3_BITSET_BITS - 1 |
We will often need to do a mod operator (i mod nbits). | |
#define | ANTLR3_BITSET_NIBBLE 4 |
How many bits in a nible of bits. | |
Typedefs | |
typedef struct ANTLR3_BITSET_struct | ANTLR3_BITSET |
typedef struct ANTLR3_BITSET_LIST_struct | ANTLR3_BITSET_LIST |
#define ANTLR3_BITSET_BITS 64 |
How many bits in the elements.
Referenced by antlr3BitsetClone(), antlr3BitsetNew(), and antlr3BitsetSize().
#define ANTLR3_BITSET_LOG_BITS 6 |
log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS
Referenced by antlr3BitsetNew(), antlr3BitsetNumBits(), numWordsToHold(), and wordNumber().
#define ANTLR3_BITSET_MOD_MASK ANTLR3_BITSET_BITS - 1 |
We will often need to do a mod operator (i mod nbits).
For powers of two, this mod operation is the same as:
Since mod is relatively slow, we use an easily precomputed mod mask to do the mod instead.
Referenced by bitMask().
#define ANTLR3_BITSET_NIBBLE 4 |
How many bits in a nible of bits.
typedef struct ANTLR3_BITSET_struct ANTLR3_BITSET |
typedef struct ANTLR3_BITSET_LIST_struct ANTLR3_BITSET_LIST |