#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include "utils.h"
#include "nsgenbind-ast.h"
#include "options.h"
Go to the source code of this file.
|
| void | nsgenbind_restart (FILE *) |
| |
| int | nsgenbind_parse (char *filename, struct genbind_node **genbind_ast) |
| |
| struct genbind_node * | genbind_node_prepend (struct genbind_node *list, struct genbind_node *inst) |
| |
| struct genbind_node * | genbind_node_add (struct genbind_node *node, struct genbind_node *list) |
| |
| char * | genbind_strapp (char *a, char *b) |
| |
| struct genbind_node * | genbind_node_link (struct genbind_node *tgt, struct genbind_node *src) |
| |
| struct genbind_node * | genbind_new_node (enum genbind_node_type type, struct genbind_node *l, void *r) |
| |
| struct genbind_node * | genbind_new_number_node (enum genbind_node_type type, struct genbind_node *l, int number) |
| |
| int | genbind_node_foreach_type (struct genbind_node *node, enum genbind_node_type type, genbind_callback_t *cb, void *ctx) |
| |
| int | genbind_node_enumerate_type (struct genbind_node *node, enum genbind_node_type type) |
| |
| struct genbind_node * | genbind_node_find (struct genbind_node *node, struct genbind_node *prev, genbind_callback_t *cb, void *ctx) |
| |
| struct genbind_node * | genbind_node_find_type (struct genbind_node *node, struct genbind_node *prev, enum genbind_node_type type) |
| |
| struct genbind_node * | genbind_node_find_type_ident (struct genbind_node *node, struct genbind_node *prev, enum genbind_node_type type, const char *ident) |
| |
| struct genbind_node * | genbind_node_find_method (struct genbind_node *node, struct genbind_node *prev, enum genbind_method_type methodtype) |
| |
| struct genbind_node * | genbind_node_find_method_ident (struct genbind_node *node, struct genbind_node *prev, enum genbind_method_type nodetype, const char *ident) |
| |
| int | genbind_cmp_node_type (struct genbind_node *node, void *ctx) |
| |
| char * | genbind_node_gettext (struct genbind_node *node) |
| |
| struct genbind_node * | genbind_node_getnode (struct genbind_node *node) |
| |
| int * | genbind_node_getint (struct genbind_node *node) |
| |
| int | genbind_dump_ast (struct genbind_node *node) |
| |
| FILE * | genbindopen (const char *filename) |
| |
| int | genbind_parsefile (char *infilename, struct genbind_node **ast) |
| |
| int | genbind_fprintf (FILE *stream, const char *format,...) |
| |
◆ genbind_cmp_node_type()
| int genbind_cmp_node_type |
( |
struct genbind_node * |
node, |
|
|
void * |
ctx |
|
) |
| |
◆ genbind_dump_ast()
Dump the binding AST to file
If the debug flag has been set this causes the binding AST to be written to a binding-ast output file
- Parameters
-
| node | Node of the tree to start dumping from (usually tree root) |
- Returns
- 0 on sucess or non zero on faliure and error message printed.
Definition at line 496 of file nsgenbind-ast.c.
◆ genbind_fprintf()
| int genbind_fprintf |
( |
FILE * |
stream, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ genbind_new_node()
◆ genbind_new_number_node()
create a new number node
Create a node with of number type
Definition at line 136 of file nsgenbind-ast.c.
◆ genbind_node_add()
◆ genbind_node_enumerate_type()
count how many nodes of a specified type.
Enumerate how many nodes of the specified type there are by performing a depth first search for nodes of the given type and counting the number of results.
- Parameters
-
| node | The node to start the search from |
| nodetype | The type of node to count |
- Returns
- The number of nodes found.
Definition at line 183 of file nsgenbind-ast.c.
◆ genbind_node_find()
Depth first left hand search using user provided comparison
- Parameters
-
| node | The node to start the search from |
| prev | The node at which to stop the search, either NULL to search the full tree depth (initial search) or the result of a previous search to continue. |
| cb | Comparison callback |
| ctx | Context for callback |
Definition at line 196 of file nsgenbind-ast.c.
◆ genbind_node_find_method()
Find a method node of a given method type
- Parameters
-
| node | A node of type GENBIND_NODE_TYPE_CLASS to search for methods. |
| prev | The node at which to stop the search, either NULL to search the full tree depth (initial search) or the result of a previous search to continue. |
| methodtype | The type of method to find. |
- Returns
- A node of type GENBIND_NODE_TYPE_METHOD on success or NULL on faliure
Definition at line 279 of file nsgenbind-ast.c.
◆ genbind_node_find_method_ident()
Find a method node of a given method type and identifier
- Parameters
-
| node | A node of type GENBIND_NODE_TYPE_CLASS to search for methods. |
| prev | The node at which to stop the search, either NULL to search the full tree depth (initial search) or the result of a previous search to continue. |
| methodtype | The type of method to find. |
| ident | The identifier to search for |
- Returns
- A node of type GENBIND_NODE_TYPE_METHOD on success or NULL on faliure
Definition at line 312 of file nsgenbind-ast.c.
◆ genbind_node_find_type()
Depth first left hand search returning nodes of the specified type
- Parameters
-
| node | The node to start the search from |
| prev | The node at which to stop the search, either NULL to search the full tree depth (initial search) or the result of a previous search to continue. |
| nodetype | The type of node to seach for |
- Returns
- The found node or NULL for no nodes.
Definition at line 223 of file nsgenbind-ast.c.
◆ genbind_node_find_type_ident()
Depth first left hand search returning nodes of the specified type with an ident child node with matching text
- Parameters
-
| node | The node to start the search from |
| prev | The node at which to stop the search, either NULL to search the full tree depth (initial search) or the result of a previous search to continue. |
| nodetype | The type of node to seach for |
| ident | The text to match the ident child node to |
Definition at line 235 of file nsgenbind-ast.c.
◆ genbind_node_foreach_type()
Iterate all nodes of a certian type from a node with a callback.
Depth first search for nodes of the given type calling the callback with context.
- Parameters
-
| node | The node to start the search from. |
Definition at line 151 of file nsgenbind-ast.c.
◆ genbind_node_getint()
get a nodes integer value
- Parameters
-
| node | The nodes to get integer from |
- Returns
- pointer to the node value or NULL if the node is not of type int or is empty.
Definition at line 389 of file nsgenbind-ast.c.
◆ genbind_node_getnode()
get a nodes node list content
- Parameters
-
| node | The nodes to get node list from |
- Returns
- pointer to the node list or NULL if the node does not contain a list
Definition at line 367 of file nsgenbind-ast.c.
◆ genbind_node_gettext()
get a nodes text content
- Parameters
-
| node | The nodes to get text from |
- Returns
- pointer to the node text or NULL if the node is not of type text or is empty.
Definition at line 348 of file nsgenbind-ast.c.
◆ genbind_node_link()
◆ genbind_node_prepend()
◆ genbind_parsefile()
| int genbind_parsefile |
( |
char * |
infilename, |
|
|
struct genbind_node ** |
ast |
|
) |
| |
◆ genbind_strapp()
| char * genbind_strapp |
( |
char * |
a, |
|
|
char * |
b |
|
) |
| |
◆ genbindopen()
| FILE * genbindopen |
( |
const char * |
filename | ) |
|
◆ nsgenbind_parse()
| int nsgenbind_parse |
( |
char * |
filename, |
|
|
struct genbind_node ** |
genbind_ast |
|
) |
| |
|
extern |
◆ nsgenbind_restart()
| void nsgenbind_restart |
( |
FILE * |
| ) |
|
|
extern |
◆ nsgenbind__flex_debug
| int nsgenbind__flex_debug |
|
extern |
◆ nsgenbind_debug