libsapling  0.8.0
production.h
Go to the documentation of this file.
1 #ifndef _LIBSAPLING_PRODUCTION_H_
2 #define _LIBSAPLING_PRODUCTION_H_
3 
9 #include "libsapling/dm/graph.h"
10 
11 
12 typedef struct production *production_t;
13 
22 production_t new_production(int id, node_t *body);
23 
28 void delete_production(production_t ref);
29 
34 int production__id(production_t ref);
35 
40 int production__len(production_t ref);
41 
48 int *production__get(production_t ref, int pos);
49 
55 void production__print(FILE *stream, const void *data);
56 
57 #endif
Graph implementation.
int * production__get(production_t ref, int pos)
Returns the grammar symbol at the specified position in the production's body.
production_t new_production(int id, node_t *body)
Allocates a new production on the heap.
int production__len(production_t ref)
Returns the length of the production's body.
void delete_production(production_t ref)
Frees the memory previously allocated on the heap for a production with new_production.
void production__print(FILE *stream, const void *data)
Prints a production through the specified stream.
int production__id(production_t ref)
Returns the productions's grammar symbol identifier.