ANTLR3_TOPO (3) - Linux Manuals
NAME
include/antlr3collections.h -
SYNOPSIS
#include <antlr3defs.h>
#include <antlr3bitset.h>
Data Structures
struct ANTLR3_HASH_BUCKET_struct
Internal structure of a hash table bucket, which tracks all keys that hash to the same bucket.
struct ANTLR3_HASH_ENTRY_struct
Internal structure representing an element in a hash bucket.
struct ANTLR3_HASH_ENUM_struct
Internal structure representing an enumeration of a table.
struct ANTLR3_HASH_KEY_struct
struct ANTLR3_HASH_TABLE_struct
Structure that tracks a hash table.
struct ANTLR3_INT_TRIE_NODE_struct
Structure that defines an element/node in an ANTLR3_INT_TRIE.
struct ANTLR3_INT_TRIE_struct
Structure that defines an ANTLR3_INT_TRIE.
struct ANTLR3_LIST_struct
Structure that represents a LIST collection.
struct ANTLR3_STACK_struct
Structure that represents a Stack collection.
struct ANTLR3_TOPO_struct
A topological sort system that given a set of dependencies of a node m on node n, can sort them in dependency order.
struct ANTLR3_TRIE_ENTRY_struct
Structure that holds the payload entry in an ANTLR3_INT_TRIE or ANTLR3_STRING_TRIE.
struct ANTLR3_VECTOR_ELEMENT_struct
struct ANTLR3_VECTOR_FACTORY_struct
Structure that tracks vectors in a vector and auto deletes the vectors in the vector factory when closed.
struct ANTLR3_VECTOR_struct
Defines
#define ANTLR3_FACTORY_VPOOL_SIZE 256
Default vector pool size if otherwise unspecified.
#define ANTLR3_HASH_TYPE_INT 0
Indicates the hashed file has integer keys.
#define ANTLR3_HASH_TYPE_STR 1
Indicates the hashed file has numeric keys.
#define ANTLR3_VECTOR_INTERNAL_SIZE 16
Typedefs
typedef struct ANTLR3_HASH_BUCKET_struct ANTLR3_HASH_BUCKET
Internal structure of a hash table bucket, which tracks all keys that hash to the same bucket.
typedef struct ANTLR3_HASH_ENTRY_struct ANTLR3_HASH_ENTRY
Internal structure representing an element in a hash bucket.
typedef struct ANTLR3_HASH_ENUM_struct ANTLR3_HASH_ENUM
Internal structure representing an enumeration of a table.
typedef struct ANTLR3_HASH_KEY_struct ANTLR3_HASH_KEY
typedef struct ANTLR3_HASH_TABLE_struct ANTLR3_HASH_TABLE
Structure that tracks a hash table.
typedef struct ANTLR3_INT_TRIE_struct ANTLR3_INT_TRIE
Structure that defines an ANTLR3_INT_TRIE.
typedef struct ANTLR3_INT_TRIE_NODE_struct ANTLR3_INT_TRIE_NODE
Structure that defines an element/node in an ANTLR3_INT_TRIE.
typedef struct ANTLR3_LIST_struct ANTLR3_LIST
Structure that represents a LIST collection.
typedef struct ANTLR3_STACK_struct ANTLR3_STACK
Structure that represents a Stack collection.
typedef struct ANTLR3_TOPO_struct ANTLR3_TOPO
A topological sort system that given a set of dependencies of a node m on node n, can sort them in dependency order.
typedef struct ANTLR3_TRIE_ENTRY_struct ANTLR3_TRIE_ENTRY
Structure that holds the payload entry in an ANTLR3_INT_TRIE or ANTLR3_STRING_TRIE.
typedef struct ANTLR3_VECTOR_struct ANTLR3_VECTOR
typedef struct ANTLR3_VECTOR_ELEMENT_struct ANTLR3_VECTOR_ELEMENT
typedef struct ANTLR3_VECTOR_FACTORY_struct ANTLR3_VECTOR_FACTORY
Structure that tracks vectors in a vector and auto deletes the vectors in the vector factory when closed.
typedef struct ANTLR3_HASH_KEY_struct * pANTLR3_HASH_KEY
typedef struct ANTLR3_INT_TRIE_NODE_struct * pANTLR3_INT_TRIE_NODE
typedef struct ANTLR3_TRIE_ENTRY_struct * pANTLR3_TRIE_ENTRY
typedef struct ANTLR3_VECTOR_ELEMENT_struct * pANTLR3_VECTOR_ELEMENT
Define Documentation
#define ANTLR3_FACTORY_VPOOL_SIZE 256
Default vector pool size if otherwise unspecified.
Referenced by closeVectorFactory(), newPool(), and newVector().
#define ANTLR3_HASH_TYPE_INT 0
Indicates the hashed file has integer keys.
Referenced by antlr3HashPutI(), and memoize().
#define ANTLR3_HASH_TYPE_STR 1
Indicates the hashed file has numeric keys.
Referenced by antlr3HashFree(), antlr3HashPut(), freeIntNode(), getRuleMemoization(), and intTrieAdd().
#define ANTLR3_VECTOR_INTERNAL_SIZE 16
Referenced by antlr3SetVectorApi(), antlr3VectorFactoryNew(), antlr3VectorFree(), antlr3VectorResize(), closeVectorFactory(), and newVector().
Typedef Documentation
typedef struct ANTLR3_HASH_BUCKET_struct
Internal structure of a hash table bucket, which tracks all keys that hash to the same bucket.
typedef struct ANTLR3_HASH_ENTRY_struct
Internal structure representing an element in a hash bucket. Stores the original key so that duplicate keys can be rejected if necessary, and contains function can be supported. If the hash key could be unique I would have invented the perfect compression algorithm ;-)
typedef struct ANTLR3_HASH_ENUM_struct
Internal structure representing an enumeration of a table. This is returned by antlr3Enumeration() Allows the programmer to traverse the table in hash order without knowing what is in the actual table.
Note that it is up to the caller to ensure that the table structure does not change in the hash bucket that is currently being enumerated as this structure just tracks the next pointers in the bucket series.
typedef struct ANTLR3_HASH_KEY_struct ANTLR3_HASH_KEY
typedef struct ANTLR3_HASH_TABLE_struct
Structure that tracks a hash table.
typedef struct ANTLR3_INT_TRIE_struct
Structure that defines an ANTLR3_INT_TRIE. For this particular implementation, as you might expect, the key is turned into a 'string' by looking at bit(key, depth) of the integer key. Using 64 bit keys gives us a depth limit of 64 (or bit 0..63) and potentially a huge trie. This is the algorithm for a Patricia Trie. Note also that this trie [can] accept multiple entries for the same key and is therefore a kind of elastic bucket patricia trie.
If you find this code useful, please feel free to 'steal' it for any purpose as covered by the BSD license under which ANTLR is issued. You can cut the code but as the ANTLR library is only about 50K (Windows Vista), you might find it easier to just link the library. Please keep all comments and licenses and so on in any version of this you create of course.
typedef struct ANTLR3_INT_TRIE_NODE_struct
Structure that defines an element/node in an ANTLR3_INT_TRIE.
typedef struct ANTLR3_LIST_struct
Structure that represents a LIST collection.
typedef struct ANTLR3_STACK_struct
Structure that represents a Stack collection.
typedef struct ANTLR3_TOPO_struct
A topological sort system that given a set of dependencies of a node m on node n, can sort them in dependency order. This is a generally useful utility object that does not care what the things are it is sorting. Generally the set to be sorted will be numeric indexes into some other structure such as an ANTLR3_VECTOR. I have provided a sort method that given ANTLR3_VECTOR as an input will sort the vector entries in place, as well as a sort method that just returns an array of the sorted noded indexes, in case you are not sorting ANTLR3_VECTORS but some set of your own device.
Of the two main algorithms that could be used, I chose to use the depth first search for unvisited nodes as a) This runs in linear time, and b) it is what we used in the ANTLR Tool to perform a topological sort of the input grammar files based on their dependencies.
typedef struct ANTLR3_TRIE_ENTRY_struct
Structure that holds the payload entry in an ANTLR3_INT_TRIE or ANTLR3_STRING_TRIE.
typedef struct ANTLR3_VECTOR_struct
typedef struct ANTLR3_VECTOR_ELEMENT_struct
typedef struct ANTLR3_VECTOR_FACTORY_struct
Structure that tracks vectors in a vector and auto deletes the vectors in the vector factory when closed.
typedef struct ANTLR3_HASH_KEY_struct * pANTLR3_HASH_KEY
typedef struct ANTLR3_INT_TRIE_NODE_struct * pANTLR3_INT_TRIE_NODE
typedef struct ANTLR3_TRIE_ENTRY_struct * pANTLR3_TRIE_ENTRY
typedef struct ANTLR3_VECTOR_ELEMENT_struct * pANTLR3_VECTOR_ELEMENT
Author
Generated automatically by Doxygen for ANTLR3C from the source code.