eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis‿token‿dictionary Struct Reference

a dictionary of tokens More...

#include <ellipsis-tdict.h>

Collaboration diagram for ellipsis‿token‿dictionary:

Public Member Functions

void ellipsis‿token‿dictionary‿destroy (ellipsis‿token‿dictionary *dict)
 destroy the whole dictionary
 
tokenellipsis‿token‿dictionary‿find (ellipsis‿token‿dictionary *dict, ellipsis‿str32 const *s)
 Find token with contents s, or return null pointer.
 
void ellipsis‿token‿dictionary‿fputs (ellipsis‿token‿dictionary dict[static 1], FILE *, char const prefix[static 1])
 print the whole dictionary
 
void ellipsis‿token‿dictionary‿init (ellipsis‿token‿dictionary *const d, size_t len)
 Initialize dictionary pointed-to by D with S slots.
 
bool ellipsis‿token‿dictionary‿insert (ellipsis‿token‿dictionary *dict, token *t)
 Insert token into dictionary.
 
void ellipsis‿token‿dictionary‿remove (ellipsis‿token‿dictionary *dict, ellipsis‿str32 const *s)
 mark token with contents s for removal, if it exists
 

Data Fields

size_t comparisons
 
size_t fibfac
 
size_t keys
 
ellipsis‿token‿arraytab
 
size_t tries
 
size_t xeys
 

Detailed Description

a dictionary of tokens

This uses the contents member of each token as key.

Do not use any of the members directly.

This implementation uses lazy deletion to avoid quick insertion and deletion cycles of elements.

The hashing uses a Fibonacci factor that is computed on the fly for the current length of the table.

Member Function Documentation

◆ ellipsis‿token‿dictionary‿destroy()

void ellipsis‿token‿dictionary‿destroy ( ellipsis‿token‿dictionary dict)

destroy the whole dictionary

References ellipsis‿token‿array::array, ellipsis‿token‿array‿delete(), ellipsis‿token‿array::length, and tab.

Here is the call graph for this function:

◆ ellipsis‿token‿dictionary‿find()

token * ellipsis‿token‿dictionary‿find ( ellipsis‿token‿dictionary dict,
ellipsis‿str32 const *  s 
)

Find token with contents s, or return null pointer.

References ellipsis‿token‿array::array, ellipsis‿token::cat, ellipsis‿token‿dictionary‿find_pos(), removed, and tab.

Here is the call graph for this function:

◆ ellipsis‿token‿dictionary‿fputs()

◆ ellipsis‿token‿dictionary‿init()

void ellipsis‿token‿dictionary‿init ( ellipsis‿token‿dictionary *const  d,
size_t  len 
)

Initialize dictionary pointed-to by D with S slots.

References φ, ellipsis‿token‿dictionary‿inverse_inplace(), and ellipsis_init.

Here is the call graph for this function:

◆ ellipsis‿token‿dictionary‿insert()

bool ellipsis‿token‿dictionary‿insert ( ellipsis‿token‿dictionary dict,
token t 
)

Insert token into dictionary.

Return true if that was successful, false if any of the arguments is null or if a token with that contents exists already.

References ellipsis‿token‿array::array, ellipsis‿token::cat, ellipsis‿token::contents, ellipsis‿error‿verb, ellipsis‿str32‿fputs(), ellipsis‿token‿dictionary‿find_pos(), ellipsis‿token‿dictionary‿maintain(), ELLIPSIS_DIAGNOSTIC, keys, removed, and tab.

Here is the call graph for this function:

◆ ellipsis‿token‿dictionary‿remove()

void ellipsis‿token‿dictionary‿remove ( ellipsis‿token‿dictionary dict,
ellipsis‿str32 const *  s 
)

mark token with contents s for removal, if it exists

References ellipsis‿token‿dictionary‿catch(), ELLIPSIS_CONTRACT, ellipsis‿token::is_undefinable, keys, and xeys.

Here is the call graph for this function:

Field Documentation

◆ comparisons

◆ fibfac

◆ keys

◆ tab

◆ tries

◆ xeys


The documentation for this struct was generated from the following file: