Skip to content
Authors

File production_store.h

FileList > production_store > src > production_store.h

Go to the source code of this file

Describes the storage used for productions of a language. More...

  • #include <stddef.h>
  • #include <stdbool.h>

Classes

Type Name
struct prodstr_obj_s
A production object to be placed in the production store.
struct prodstr_store_t
Storage type for a production store.

Public Types

Type Name
typedef struct prodstr_obj_s prodstr_obj_t
A production object to be placed in the production store.
typedef const char *(* resolve_funptr_t
Function pointer type for a resolution function.
typedef const char *(* terminate_funptr_t
Function pointer type for a termination function.

Public Functions

Type Name
bool prodstr_add (prodstr_store_t * store, prodstr_obj_t * prd)
Add a production to the given store.
const prodstr_obj_t * prodstr_find (const prodstr_store_t * store, const char * name)
Find a production with the given name in the given store.

Macros

Type Name
define PRODSTR_TABLE_SIZE (200u)
The size of the production store hash table.

Detailed Description

Author:

Joe Starr

Public Types Documentation

typedef prodstr_obj_t

A production object to be placed in the production store.

typedef struct prodstr_obj_s prodstr_obj_t;

Separated to make Doxygen happy.


typedef resolve_funptr_t

Function pointer type for a resolution function.

typedef const char *(* resolve_funptr_t) (const void *config);


typedef terminate_funptr_t

Function pointer type for a termination function.

typedef const char *(* terminate_funptr_t) (const void *config);


Public Functions Documentation

function prodstr_add

Add a production to the given store.

bool prodstr_add (
    prodstr_store_t * store,
    prodstr_obj_t * prd
) 

Add the given production to the given store. Indicate success with true and failure with false.

Parameters:

  • store The store to add to.
  • prd The production to add.

Returns:

The success or failure of the addition.


function prodstr_find

Find a production with the given name in the given store.

const prodstr_obj_t * prodstr_find (
    const prodstr_store_t * store,
    const char * name
) 

Search the store for a production with the given name. Indicate success with a pointer to a production. Indicate failure with a NULL pointer.

Parameters:

  • store The store to search.
  • name The name to find.

Returns:

A pointer to a production on success. A NULL pointer on failure.


Macro Definition Documentation

define PRODSTR_TABLE_SIZE

The size of the production store hash table.

#define PRODSTR_TABLE_SIZE `(200u)`



The documentation for this class was generated from the following file source/production_store/src/production_store.h