ANTLR3C  3.3.1
antlr3bitset.h File Reference

Defines the basic structures of an ANTLR3 bitset. More...

#include <antlr3defs.h>
#include <antlr3collections.h>
Include dependency graph for antlr3bitset.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  ANTLR3_BITSET_LIST_struct
 
struct  ANTLR3_BITSET_struct
 

Macros

#define ANTLR3_BITSET_BITS   64
 How many bits in the elements. More...
 
#define ANTLR3_BITSET_LOG_BITS   6
 log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS More...
 
#define ANTLR3_BITSET_MOD_MASK   ANTLR3_BITSET_BITS - 1
 We will often need to do a mod operator (i mod nbits). More...
 
#define ANTLR3_BITSET_NIBBLE   4
 How many bits in a nible of bits. More...
 

Typedefs

typedef struct ANTLR3_BITSET_struct ANTLR3_BITSET
 
typedef struct ANTLR3_BITSET_LIST_struct ANTLR3_BITSET_LIST
 

Detailed Description

Defines the basic structures of an ANTLR3 bitset.

this is a C version of the cut down Bitset class provided with the java version of antlr 3.

Macro Definition Documentation

◆ ANTLR3_BITSET_BITS

#define ANTLR3_BITSET_BITS   64

How many bits in the elements.

◆ ANTLR3_BITSET_LOG_BITS

#define ANTLR3_BITSET_LOG_BITS   6

log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS

◆ ANTLR3_BITSET_MOD_MASK

#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:

  • (i & (nbits-1)).

Since mod is relatively slow, we use an easily precomputed mod mask to do the mod instead.

◆ ANTLR3_BITSET_NIBBLE

#define ANTLR3_BITSET_NIBBLE   4

How many bits in a nible of bits.

Typedef Documentation

◆ ANTLR3_BITSET

◆ ANTLR3_BITSET_LIST