Also useable by the C programmer for things like symbol tables pointers and so on.
#include <antlr3.h>

Functions | |
| static void | antlr3EnumFree (pANTLR3_HASH_ENUM en) |
| Frees up the memory structures that represent a hash table enumeration. | |
| pANTLR3_HASH_ENUM | antlr3EnumNew (pANTLR3_HASH_TABLE table) |
| Creates an enumeration structure to traverse the hash table. | |
| static int | antlr3EnumNext (pANTLR3_HASH_ENUM en, pANTLR3_HASH_KEY *key, void **data) |
| Return the next entry in the hashtable being traversed by the supplied enumeration. | |
| static void | antlr3EnumNextEntry (pANTLR3_HASH_ENUM en) |
| Local function to advance the entry pointer of an enumeration structure to the next valid entry (if there is one). | |
| ANTLR3_API ANTLR3_UINT32 | antlr3Hash (void *key, ANTLR3_UINT32 keylen) |
| Given an input key of arbitrary length, return a hash value of it. | |
| static void | antlr3HashDelete (pANTLR3_HASH_TABLE table, void *key) |
| Takes the element with the supplied key out of the list, and deletes the data calling the supplied free() routine if any. | |
| static void | antlr3HashDeleteI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) |
| Takes the element with the supplied key out of the list, and deletes the data calling the supplied free() routine if any. | |
| static void | antlr3HashFree (pANTLR3_HASH_TABLE table) |
| static void * | antlr3HashGet (pANTLR3_HASH_TABLE table, void *key) |
| Return the element pointer in the hash table for a particular key value, or NULL if it don't exist (or was itself NULL). | |
| static void * | antlr3HashGetI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) |
| Return the element pointer in the hash table for a particular key value, or NULL if it don't exist (or was itself NULL). | |
| static ANTLR3_INT32 | antlr3HashPut (pANTLR3_HASH_TABLE table, void *key, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| Add the element pointer in to the table, based upon the hash of the provided key. | |
| static ANTLR3_INT32 | antlr3HashPutI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| Add the element pointer in to the table, based upon the hash of the provided key. | |
| static pANTLR3_HASH_ENTRY | antlr3HashRemove (pANTLR3_HASH_TABLE table, void *key) |
| Remove the element in the hash table for a particular key value, if it exists - no error if it does not. | |
| static pANTLR3_HASH_ENTRY | antlr3HashRemoveI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) |
| Remove a numeric keyed entry from a hash table if it exists, no error if it does not exist. | |
| static ANTLR3_UINT32 | antlr3HashSize (pANTLR3_HASH_TABLE table) |
| return the current size of the hash table | |
| pANTLR3_HASH_TABLE | antlr3HashTableNew (ANTLR3_UINT32 sizeHint) |
| pANTLR3_INT_TRIE | antlr3IntTrieNew (ANTLR3_UINT32 depth) |
| static ANTLR3_INT32 | antlr3ListAdd (pANTLR3_LIST list, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| Add the supplied element to the list, at the next available key. | |
| static void | antlr3ListDelete (pANTLR3_LIST list, ANTLR3_INTKEY key) |
| static void | antlr3ListFree (pANTLR3_LIST list) |
| static void * | antlr3ListGet (pANTLR3_LIST list, ANTLR3_INTKEY key) |
| ANTLR3_API pANTLR3_LIST | antlr3ListNew (ANTLR3_UINT32 sizeHint) |
| static ANTLR3_INT32 | antlr3ListPut (pANTLR3_LIST list, ANTLR3_INTKEY key, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| static void * | antlr3ListRemove (pANTLR3_LIST list, ANTLR3_INTKEY key) |
| Remove from the list, but don't free the element, just send it back to the caller. | |
| static ANTLR3_UINT32 | antlr3ListSize (pANTLR3_LIST list) |
| static void | antlr3StackFree (pANTLR3_STACK stack) |
| static void * | antlr3StackGet (pANTLR3_STACK stack, ANTLR3_INTKEY key) |
| ANTLR3_API pANTLR3_STACK | antlr3StackNew (ANTLR3_UINT32 sizeHint) |
| static void * | antlr3StackPeek (pANTLR3_STACK stack) |
| static void * | antlr3StackPop (pANTLR3_STACK stack) |
| static ANTLR3_BOOLEAN | antlr3StackPush (pANTLR3_STACK stack, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| static ANTLR3_UINT32 | antlr3StackSize (pANTLR3_STACK stack) |
| static ANTLR3_UINT32 | antlr3VectorAdd (pANTLR3_VECTOR vector, void *element, void(ANTLR3_CDECL *freeptr)(void *)) |
| Add the supplied pointer and freeing function pointer to the list, expanding the vector if needed. | |
| static void | antlr3VectorClear (pANTLR3_VECTOR vector) |
| static void | antlr3VectorDel (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) |
| ANTLR3_API pANTLR3_VECTOR_FACTORY | antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint) |
| Vector factory creation. | |
| static void ANTLR3_CDECL | antlr3VectorFree (pANTLR3_VECTOR vector) |
| static void * | antlr3VectorGet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) |
| ANTLR3_API pANTLR3_VECTOR | antlr3VectorNew (ANTLR3_UINT32 sizeHint) |
| static void | antlr3VectorResize (pANTLR3_VECTOR vector, ANTLR3_UINT32 hint) |
| static ANTLR3_UINT32 | antlr3VectorSet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry, void *element, void(ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting) |
| Replace the element at the specified entry point with the supplied entry. | |
| static ANTLR3_UINT32 | antlr3VectorSize (pANTLR3_VECTOR vector) |
| static void * | antrl3VectorRemove (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) |
| Remove the entry from the vector, but do not free any entry, even if it has a free pointer. | |
| static void | closeVectorFactory (pANTLR3_VECTOR_FACTORY factory) |
| static void | freeIntNode (pANTLR3_INT_TRIE_NODE node) |
| Release memory allocated to this tree. | |
| static ANTLR3_BOOLEAN | intTrieAdd (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intVal, void *data, void(ANTLR3_CDECL *freeptr)(void *)) |
| Add an entry into the INT trie. | |
| static ANTLR3_BOOLEAN | intTrieDel (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) |
| static void | intTrieFree (pANTLR3_INT_TRIE trie) |
| Called to free all nodes and the structure itself. | |
| static pANTLR3_TRIE_ENTRY | intTrieGet (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) |
| Search the int Trie and return a pointer to the first bucket indexed by the key if it is contained in the trie, otherwise NULL. | |
| static pANTLR3_VECTOR | newVector (pANTLR3_VECTOR_FACTORY factory) |
Variables | |
| static ANTLR3_UINT8 | bitIndex [256] |
| Array of left most significant bit positions for an 8 bit element provides an efficient way to find the highest bit that is set in an n byte value (n>0). | |
| static ANTLR3_UINT64 | bitMask [64] |
| Rather than use the bit index of a trie node to shift 0x01 left that many times, then & with the result, it is faster to use the bit index as an index into this table which holds precomputed masks for any of the 64 bits we need to mask off singly. | |
| static void antlr3EnumFree | ( | pANTLR3_HASH_ENUM | en | ) | [static] |
Frees up the memory structures that represent a hash table enumeration.
| [in] | enum | Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() |
References ANTLR3_FREE.
Referenced by antlr3EnumNew().

| pANTLR3_HASH_ENUM antlr3EnumNew | ( | pANTLR3_HASH_TABLE | table | ) |
Creates an enumeration structure to traverse the hash table.
| table | Table to enumerate |
References ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, antlr3EnumFree(), antlr3EnumNext(), antlr3EnumNextEntry(), ANTLR3_HASH_ENUM_struct::bucket, ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_ENUM_struct::entry, ANTLR3_HASH_ENUM_struct::free, ANTLR3_HASH_ENUM_struct::next, and ANTLR3_HASH_ENUM_struct::table.
Referenced by antlr3BitsetList().


| static int antlr3EnumNext | ( | pANTLR3_HASH_ENUM | en, | |
| pANTLR3_HASH_KEY * | key, | |||
| void ** | data | |||
| ) | [static] |
Return the next entry in the hashtable being traversed by the supplied enumeration.
| [in] | en | Pointer to the enumeration tracking structure |
| key | Pointer to void pointer, where the key pointer is returned. | |
| data | Pointer to void pointer where the data pointer is returned. |
References ANTLR3_FAIL, ANTLR3_SUCCESS, antlr3EnumNextEntry(), ANTLR3_HASH_ENUM_struct::bucket, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_ENUM_struct::entry, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, and ANTLR3_HASH_ENUM_struct::table.
Referenced by antlr3EnumNew().


| static void antlr3EnumNextEntry | ( | pANTLR3_HASH_ENUM | en | ) | [static] |
Local function to advance the entry pointer of an enumeration structure to the next valid entry (if there is one).
| [in] | enum | Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() |
References ANTLR3_HASH_ENUM_struct::bucket, ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_ENUM_struct::entry, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, and ANTLR3_HASH_ENUM_struct::table.
Referenced by antlr3EnumNew(), and antlr3EnumNext().

| ANTLR3_API ANTLR3_UINT32 antlr3Hash | ( | void * | key, | |
| ANTLR3_UINT32 | keylen | |||
| ) |
Given an input key of arbitrary length, return a hash value of it.
This can then be used (with suitable modulo) to index other structures.
Referenced by antlr3HashGet(), antlr3HashPut(), and antlr3HashRemove().

| static void antlr3HashDelete | ( | pANTLR3_HASH_TABLE | table, | |
| void * | key | |||
| ) | [static] |
Takes the element with the supplied key out of the list, and deletes the data calling the supplied free() routine if any.
References ANTLR3_FREE, antlr3HashRemove(), and ANTLR3_HASH_ENTRY_struct::data.
Referenced by antlr3HashTableNew().


| static void antlr3HashDeleteI | ( | pANTLR3_HASH_TABLE | table, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
Takes the element with the supplied key out of the list, and deletes the data calling the supplied free() routine if any.
References ANTLR3_FREE, antlr3HashRemoveI(), and ANTLR3_HASH_ENTRY_struct::data.
Referenced by antlr3HashTableNew().


| static void antlr3HashFree | ( | pANTLR3_HASH_TABLE | table | ) | [static] |
References ANTLR3_FREE, ANTLR3_HASH_TYPE_STR, ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, ANTLR3_HASH_KEY_struct::sKey, and ANTLR3_HASH_KEY_struct::type.
Referenced by antlr3HashTableNew().

| static void * antlr3HashGet | ( | pANTLR3_HASH_TABLE | table, | |
| void * | key | |||
| ) | [static] |
Return the element pointer in the hash table for a particular key value, or NULL if it don't exist (or was itself NULL).
References antlr3Hash(), ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, and ANTLR3_HASH_KEY_struct::sKey.
Referenced by antlr3HashTableNew().


| static void * antlr3HashGetI | ( | pANTLR3_HASH_TABLE | table, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
Return the element pointer in the hash table for a particular key value, or NULL if it don't exist (or was itself NULL).
References ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::iKey, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, and ANTLR3_HASH_ENTRY_struct::nextEntry.
Referenced by antlr3HashTableNew().

| static ANTLR3_INT32 antlr3HashPut | ( | pANTLR3_HASH_TABLE | table, | |
| void * | key, | |||
| void * | element, | |||
| void(ANTLR3_CDECL *freeptr)(void *) | ||||
| ) | [static] |
Add the element pointer in to the table, based upon the hash of the provided key.
References ANTLR3_HASH_TABLE_struct::allowDups, ANTLR3_ERR_HASHDUP, ANTLR3_ERR_NOMEM, ANTLR3_FALSE, ANTLR3_HASH_TYPE_STR, ANTLR3_MALLOC, ANTLR3_STRDUP, ANTLR3_SUCCESS, antlr3Hash(), ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, ANTLR3_HASH_KEY_struct::sKey, and ANTLR3_HASH_KEY_struct::type.
Referenced by antlr3HashTableNew().


| static ANTLR3_INT32 antlr3HashPutI | ( | pANTLR3_HASH_TABLE | table, | |
| ANTLR3_INTKEY | key, | |||
| void * | element, | |||
| void(ANTLR3_CDECL *freeptr)(void *) | ||||
| ) | [static] |
Add the element pointer in to the table, based upon the hash of the provided key.
References ANTLR3_HASH_TABLE_struct::allowDups, ANTLR3_ERR_HASHDUP, ANTLR3_ERR_NOMEM, ANTLR3_FALSE, ANTLR3_HASH_TYPE_INT, ANTLR3_MALLOC, ANTLR3_SUCCESS, ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::iKey, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, and ANTLR3_HASH_KEY_struct::type.
Referenced by antlr3HashTableNew().

| static pANTLR3_HASH_ENTRY antlr3HashRemove | ( | pANTLR3_HASH_TABLE | table, | |
| void * | key | |||
| ) | [static] |
Remove the element in the hash table for a particular key value, if it exists - no error if it does not.
References ANTLR3_FREE, antlr3Hash(), ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_ENTRY_struct::nextEntry, and ANTLR3_HASH_KEY_struct::sKey.
Referenced by antlr3HashDelete(), and antlr3HashTableNew().


| static pANTLR3_HASH_ENTRY antlr3HashRemoveI | ( | pANTLR3_HASH_TABLE | table, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
Remove a numeric keyed entry from a hash table if it exists, no error if it does not exist.
References ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_KEY_struct::iKey, ANTLR3_HASH_KEY_struct::key, ANTLR3_HASH_ENTRY_struct::keybase, ANTLR3_HASH_TABLE_struct::modulo, and ANTLR3_HASH_ENTRY_struct::nextEntry.
Referenced by antlr3HashDeleteI(), and antlr3HashTableNew().

| static ANTLR3_UINT32 antlr3HashSize | ( | pANTLR3_HASH_TABLE | table | ) | [static] |
return the current size of the hash table
References ANTLR3_HASH_TABLE_struct::count.
Referenced by antlr3HashTableNew().

| pANTLR3_HASH_TABLE antlr3HashTableNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_HASH_TABLE_struct::allowDups, ANTLR3_FALSE, ANTLR3_FREE, ANTLR3_MALLOC, antlr3HashDelete(), antlr3HashDeleteI(), antlr3HashFree(), antlr3HashGet(), antlr3HashGetI(), antlr3HashPut(), antlr3HashPutI(), antlr3HashRemove(), antlr3HashRemoveI(), antlr3HashSize(), ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_TABLE_struct::del, ANTLR3_HASH_TABLE_struct::delI, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_TABLE_struct::free, ANTLR3_HASH_TABLE_struct::get, ANTLR3_HASH_TABLE_struct::getI, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_TABLE_struct::put, ANTLR3_HASH_TABLE_struct::putI, ANTLR3_HASH_TABLE_struct::remove, ANTLR3_HASH_TABLE_struct::removeI, and ANTLR3_HASH_TABLE_struct::size.
Referenced by antlr3ListNew().


| pANTLR3_INT_TRIE antlr3IntTrieNew | ( | ANTLR3_UINT32 | depth | ) |
References ANTLR3_INT_TRIE_struct::add, ANTLR3_CALLOC, ANTLR3_ERR_NOMEM, ANTLR3_FREE, ANTLR3_FUNC_PTR, ANTLR3_INT_TRIE_NODE_struct::bitNum, ANTLR3_INT_TRIE_struct::count, ANTLR3_INT_TRIE_struct::del, ANTLR3_INT_TRIE_struct::free, ANTLR3_INT_TRIE_struct::get, intTrieAdd(), intTrieDel(), intTrieFree(), intTrieGet(), ANTLR3_INT_TRIE_NODE_struct::leftN, ANTLR3_INT_TRIE_NODE_struct::rightN, and ANTLR3_INT_TRIE_struct::root.
Referenced by getRuleMemoization(), and reset().


| static ANTLR3_INT32 antlr3ListAdd | ( | pANTLR3_LIST | list, | |
| void * | element, | |||
| void(ANTLR3_CDECL *freeptr)(void *) | ||||
| ) | [static] |
Add the supplied element to the list, at the next available key.
References ANTLR3_LIST_struct::put, ANTLR3_HASH_TABLE_struct::size, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static void antlr3ListDelete | ( | pANTLR3_LIST | list, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
References ANTLR3_HASH_TABLE_struct::delI, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static void antlr3ListFree | ( | pANTLR3_LIST | list | ) | [static] |
References ANTLR3_FREE, ANTLR3_HASH_TABLE_struct::free, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static void * antlr3ListGet | ( | pANTLR3_LIST | list, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
References ANTLR3_HASH_TABLE_struct::getI, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| ANTLR3_API pANTLR3_LIST antlr3ListNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_LIST_struct::add, ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, antlr3HashTableNew(), antlr3ListAdd(), antlr3ListDelete(), antlr3ListFree(), antlr3ListGet(), antlr3ListPut(), antlr3ListRemove(), antlr3ListSize(), ANTLR3_LIST_struct::del, ANTLR3_LIST_struct::free, ANTLR3_LIST_struct::get, ANTLR3_LIST_struct::put, ANTLR3_LIST_struct::remove, ANTLR3_LIST_struct::size, and ANTLR3_LIST_struct::table.

| static ANTLR3_INT32 antlr3ListPut | ( | pANTLR3_LIST | list, | |
| ANTLR3_INTKEY | key, | |||
| void * | element, | |||
| void(ANTLR3_CDECL *freeptr)(void *) | ||||
| ) | [static] |
References ANTLR3_HASH_TABLE_struct::putI, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static void * antlr3ListRemove | ( | pANTLR3_LIST | list, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
Remove from the list, but don't free the element, just send it back to the caller.
References ANTLR3_HASH_ENTRY_struct::data, ANTLR3_HASH_TABLE_struct::removeI, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static ANTLR3_UINT32 antlr3ListSize | ( | pANTLR3_LIST | list | ) | [static] |
References ANTLR3_HASH_TABLE_struct::size, and ANTLR3_LIST_struct::table.
Referenced by antlr3ListNew().

| static void antlr3StackFree | ( | pANTLR3_STACK | stack | ) | [static] |
References ANTLR3_FREE, ANTLR3_STACK_struct::top, and ANTLR3_STACK_struct::vector.
Referenced by antlr3StackNew().

| static void * antlr3StackGet | ( | pANTLR3_STACK | stack, | |
| ANTLR3_INTKEY | key | |||
| ) | [static] |
References ANTLR3_VECTOR_struct::get, and ANTLR3_STACK_struct::vector.
Referenced by antlr3StackNew().

| ANTLR3_API pANTLR3_STACK antlr3StackNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC,