libsapling
0.8.0
|
Production implementation. More...
#include "libsapling/dm/graph.h"
Go to the source code of this file.
Typedefs | |
typedef struct production * | production_t |
Functions | |
production_t | new_production (int id, node_t *body) |
Allocates a new production on the heap. More... | |
void | delete_production (production_t ref) |
Frees the memory previously allocated on the heap for a production with new_production. | |
int | production__id (production_t ref) |
Returns the productions's grammar symbol identifier. More... | |
int | production__len (production_t ref) |
Returns the length of the production's body. More... | |
int * | production__get (production_t ref, int pos) |
Returns the grammar symbol at the specified position in the production's body. More... | |
void | production__print (FILE *stream, const void *data) |
Prints a production through the specified stream. More... | |
Production implementation.
production_t new_production | ( | int | id, |
node_t * | body | ||
) |
Allocates a new production on the heap.
id | The production's gramar symbol identifier. |
body | The production's body. |
int* production__get | ( | production_t | ref, |
int | pos | ||
) |
Returns the grammar symbol at the specified position in the production's body.
int production__id | ( | production_t | ref | ) |
Returns the productions's grammar symbol identifier.
int production__len | ( | production_t | ref | ) |
Returns the length of the production's body.
void production__print | ( | FILE * | stream, |
const void * | data | ||
) |
Prints a production through the specified stream.
data | A production_t object |