Lines Matching refs:parser
23 JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer);
29 parser->brace_count++;
32 parser->brace_count--;
35 parser->bracket_count++;
38 parser->bracket_count--;
52 qlist_append(parser->tokens, dict);
54 if (parser->brace_count == 0 &&
55 parser->bracket_count == 0) {
56 parser->emit(parser, parser->tokens);
57 QDECREF(parser->tokens);
58 parser->tokens = qlist_new();
62 void json_message_parser_init(JSONMessageParser *parser,
65 parser->emit = func;
66 parser->brace_count = 0;
67 parser->bracket_count = 0;
68 parser->tokens = qlist_new();
70 json_lexer_init(&parser->lexer, json_message_process_token);
73 int json_message_parser_feed(JSONMessageParser *parser,
76 return json_lexer_feed(&parser->lexer, buffer, size);
79 int json_message_parser_flush(JSONMessageParser *parser)
81 return json_lexer_flush(&parser->lexer);
84 void json_message_parser_destroy(JSONMessageParser *parser)
86 json_lexer_destroy(&parser->lexer);
87 QDECREF(parser->tokens);