include/antlr3bitset.h(3)

πŸ“¦ version 3.4, in fedora 43

πŸ’– 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_struct
  • struct 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_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.

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