2022-02-21 12:44:43 +01:00
|
|
|
#ifndef IR_H
|
|
|
|
#define IR_H
|
|
|
|
|
|
|
|
/* This is the tree node structure */
|
|
|
|
typedef struct n {
|
|
|
|
node_index_t type;
|
|
|
|
void *data;
|
|
|
|
struct s *entry;
|
|
|
|
uint64_t n_children;
|
|
|
|
struct n **children;
|
|
|
|
} node_t;
|
|
|
|
|
2022-02-21 13:48:13 +01:00
|
|
|
/**Export the initializer function, it is needed by the parser
|
|
|
|
* @param *nd node to initialize
|
|
|
|
* @param type type of node (see nodetype.h)
|
|
|
|
* @param *data associated data. Declared void to allow any type
|
|
|
|
* @param n_children number of children
|
|
|
|
* @param ... variable argument list of child nodes (node_t *)
|
|
|
|
*
|
|
|
|
* @return Pointer to the initialized node
|
|
|
|
* */
|
|
|
|
node_t* node_init (
|
2022-02-21 12:44:43 +01:00
|
|
|
node_t *nd, node_index_t type, void *data, uint64_t n_children, ...
|
|
|
|
);
|
|
|
|
#endif
|