Moved my files into project
This commit is contained in:
@@ -10,21 +10,42 @@ typedef struct n {
|
||||
struct n **children;
|
||||
} node_t;
|
||||
|
||||
// Export the initializer function, it is needed by the parser
|
||||
void node_init (
|
||||
node_t *nd, node_index_t type, void *data, uint64_t n_children, ...
|
||||
/**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 (
|
||||
node_t* nd,
|
||||
node_index_t type,
|
||||
void* data,
|
||||
uint64_t n_children,
|
||||
...
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
SYM_GLOBAL_VAR, SYM_FUNCTION, SYM_PARAMETER, SYM_LOCAL_VAR
|
||||
SYM_GLOBAL_VAR,
|
||||
SYM_FUNCTION,
|
||||
SYM_PARAMETER,
|
||||
SYM_LOCAL_VAR
|
||||
} symtype_t;
|
||||
|
||||
typedef struct s {
|
||||
char *name;
|
||||
symtype_t type;
|
||||
node_t *node;
|
||||
size_t seq;
|
||||
size_t nparms;
|
||||
tlhash_t *locals;
|
||||
char* name;
|
||||
symtype_t type;
|
||||
node_t* node;
|
||||
size_t seq;
|
||||
size_t nparms;
|
||||
tlhash_t* locals;
|
||||
} symbol_t;
|
||||
#endif
|
||||
|
||||
#define GLOBAL_BUCKET_SIZE 32
|
||||
#define LOCAL_BUCKET_SIZE 16
|
||||
|
||||
#define DEFAULT_STRING_LIST_SIZE 8
|
||||
#define DEFAULT_NO_SCOPES 1
|
||||
|
||||
@@ -25,6 +25,7 @@ int yyerror ( const char *error );
|
||||
/* These are defined in the parser generated by bison */
|
||||
extern int yylineno;
|
||||
extern int yylex ( void );
|
||||
extern int yylex_destroy( void );
|
||||
extern char yytext[];
|
||||
|
||||
/* Global state */
|
||||
|
||||
Reference in New Issue
Block a user