22#define FIELD_TYPE_INT 0
23#define FIELD_TYPE_LONG 1
24#define FIELD_TYPE_FLOAT 2
25#define FIELD_TYPE_DOUBLE 3
26#define FIELD_TYPE_SSTR 4
27#define FIELD_TYPE_STRUCT 6
28#define FIELD_TYPE_BOOL 7
30#define TYPE_NAME_INT "int"
31#define TYPE_NAME_BOOL "bool"
32#define TYPE_NAME_SSTR "sstr_t"
33#define TYPE_NAME_LONG "long"
34#define TYPE_NAME_FLOAT "float"
35#define TYPE_NAME_DOUBLE "double"
41#define STRUCT_MAP_BUCKET_SIZE 4096
96#define TOKEN_LEFT_BRACE '{'
97#define TOKEN_RIGHT_BRACE '}'
98#define TOKEN_LEFT_BRACKET '['
99#define TOKEN_RIGHT_BRACKET ']'
100#define TOKEN_SEMICOLON ';'
101#define TOKEN_SHARPE '#'
102#define TOKEN_STRING 4
103#define TOKEN_IDENTIFY 1
104#define TOKEN_INTEGER 2
107#define TOKEN_ERROR -1
A simple hash_map implementation.
sstr_t are objects that represent sequences of characters.
void * sstr_t
sstr_t are objects that represent sequences of characters.
Definition sstr.h:73
int struct_parser_parse(struct struct_parser *parser, sstr_t content)
parse a struct definition file, and store the parsed structs in struct_parser.
Definition struct_parse.c:638
struct struct_parser * struct_parser_new()
create and init a struct_parser instance.
Definition struct_parse.c:104
void struct_parser_free(struct struct_parser *parser)
free a struct_parser instance.
Definition struct_parse.c:125
position of string
Definition struct_parse.h:75
structure to store parsed structs. A struct may have multiple fields, we put fields in a linked list.
Definition struct_parse.h:65
structure to store field list of parsed structs. A struct may have multiple field,...
Definition struct_parse.h:48
parser context
Definition struct_parse.h:85
token
Definition struct_parse.h:113