json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Go to the documentation of this file.
7 #ifndef STRUCT_PARSE_H_
8 #define STRUCT_PARSE_H_
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
105 #define TOKEN_FLOAT 3
107 #define TOKEN_ERROR -1
146 #endif // STRUCT_PARSE_H_
void * sstr_t
sstr_t are objects that represent sequences of characters.
Definition: sstr.h:73
parser context
Definition: struct_parse.h:85
struct struct_parser * struct_parser_new()
create and init a struct_parser instance.
Definition: struct_parse.c:103
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:606
Definition: hash_map.h:34
sstr_t are objects that represent sequences of characters.
structure to store field list of parsed structs. A struct may have multiple field,...
Definition: struct_parse.h:48
A simple hash_map implementation.
token
Definition: struct_parse.h:113
void struct_parser_free(struct struct_parser *parser)
free a struct_parser instance.
Definition: struct_parse.c:124
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