include/antlr3bitset.h(3)
π include/antlr3bitset.h β ANTLR3C manual page π
okay bestie, sit down, hydrate, because we're reading a C header manpage and honestly? it's giving iconic. this is include/antlr3bitset.h(3) from the ANTLR3C manual, and we're gonna get through it together, no cap. π¦
β¨ NAME β¨
include/antlr3bitset.h β Defines the basic structures of an ANTLR3 bitset.
like. that's the whole name section. it does what it says on the tin, and it does it beautifully. π
πΈ SYNOPSIS πΈ
#include <antlr3defs.h>
#include <antlr3collections.h>
yes bestie, that's literally all you need to pull this header in. two includes, zero drama. periodt. β¨
π Data Structures
struct ANTLR3_BITSET_LIST_structstruct ANTLR3_BITSET_struct
two structs, both serving absolute main character energy. π
π§ Macros
#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_BITSETtypedef 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.
ngl, "it's a C version of the cut down Java Bitset class" is such a vibe. lowkey a glow-up, highkey a port. β¨
π Macro Definition Documentation π
β #define ANTLR3_BITSET_BITS 64
How many bits in the elements.
Referenced by antlr3BitsetClone(), antlr3BitsetNew(), and antlr3BitsetSize().
64 bits, bestie. that's the whole unit of measurement here. everyone else is just visiting her house. π
β #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().
like, it's the log base 2 of the bit count, and yes the math checks out: 2 to the power of ANTLR3_BITSET_LOG_BITS equals ANTLR3_BITSET_BITS. ate. π₯
β #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.
Referenced by bitMask().
okay so this is the girlboss optimization moment. mod is slow, bitwise AND is fast, and since nbits is a power of two they're mathematically the same thing. we precompute the mask and we move on. slay. π
β #define ANTLR3_BITSET_NIBBLE 4
How many bits in a nible of bits.
(yes, "nible." we don't ask questions, we just respect the spelling. π)
π Typedef Documentation π
π¦ typedef struct ANTLR3_BITSET_struct ANTLR3_BITSET
π¦ typedef struct ANTLR3_BITSET_LIST_struct ANTLR3_BITSET_LIST
both of these are just typedefs pointing at their respective structs. simple, clean, no notes. β¨
π Author π
Generated automatically by Doxygen for ANTLR3C from the source code.
aaaand that's the whole page, bestie!! this was Version 3.3.1, dated Tue Jul 29 2025 00:00:00, and honestly, a Doxygen-generated header doc about bitsets has no business being this cute. go forth and bitset responsibly. ππβ¨ππ¦
π¦ where this page comes from
- fedora 43: antlr3-C-devel 1:3.4-3.5.3.14.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms