Lines Matching defs:parser
3975 * output of upbc, and to improve search speed for the table parser. */
8962 #line 1 "upb/json/parser.rl"
8966 ** A parser that uses the Ragel State Machine Compiler to generate
8973 ** This parser can handle the basics, but needs several things to be fleshed
9124 upb_json_parser *parser;
9213 /* Accumulate buffer. See details in parser.rl. */
9219 /* Multi-part text data. See details in parser.rl. */
9223 /* Input capture. See details in parser.rl. */
9270 frame->parser = NULL;
9292 /* Initialize parser. */
9295 frame->parser =
9308 return frame->parser != NULL;
9330 if (frame->parser == NULL) {
9535 * Some parts of the parser need an entire value as a contiguous string. For
9753 /* Callbacks from the parser **************************************************/
9755 /* These are the functions called directly from the parser itself.
9756 * We define these in the same order as their declarations in the parser. */
10205 /* Start a new parser frame: parser frames correspond one-to-one with
10229 * current parser frame. These values must accmulate so we can convert
10745 /* Start a new parser frame: parser frames correspond one-to-one with
10805 * parser state machine has already decided that this is a string field
10866 * value parser (invoked next) will emit the mapentry's value field and then
10893 * if they see is_mapentry (when invoked by the parser state machine, they
11011 /* Beginning of a map. Start a new parser frame in a repeated-field
11028 /* Beginning of a subobject. Start a new parser frame in the submsg
11236 if (upb_msgdef_wellknowntype(p->top->any_frame->parser->top->m) !=
11267 if (!parse(p->top->any_frame->parser, NULL,
11275 if (!parse(p->top->any_frame->parser, NULL, "{", 1, NULL)) {
11283 if (!parse(p->top->any_frame->parser, NULL, ",", 1, NULL)) {
11289 if (!parse(p->top->any_frame->parser, NULL,
11296 if (!parse(p->top->any_frame->parser, NULL, "}", 1, NULL)) {
11302 if (!end(p->top->any_frame->parser, NULL)) {
11517 /* The actual parser **********************************************************/
11519 /* What follows is the Ragel parser itself. The language is specified in Ragel
11535 #line 2780 "upb/json/parser.rl"
11539 #line 2583 "upb/json/parser.c"
11794 #line 2783 "upb/json/parser.rl"
11798 upb_json_parser *parser = closure;
11801 int cs = parser->current_state;
11802 int *stack = parser->parser_stack;
11803 int top = parser->parser_top;
11809 parser->handle = handle;
11814 capture_resume(parser, buf);
11817 #line 2861 "upb/json/parser.c"
11892 #line 2588 "upb/json/parser.rl"
11896 #line 2590 "upb/json/parser.rl"
11900 #line 2594 "upb/json/parser.rl"
11901 { start_text(parser, p); }
11904 #line 2595 "upb/json/parser.rl"
11905 { CHECK_RETURN_TOP(end_text(parser, p)); }
11908 #line 2601 "upb/json/parser.rl"
11909 { start_hex(parser); }
11912 #line 2602 "upb/json/parser.rl"
11913 { hexdigit(parser, p); }
11916 #line 2603 "upb/json/parser.rl"
11917 { CHECK_RETURN_TOP(end_hex(parser)); }
11920 #line 2609 "upb/json/parser.rl"
11921 { CHECK_RETURN_TOP(escape(parser, p)); }
11924 #line 2615 "upb/json/parser.rl"
11928 #line 2620 "upb/json/parser.rl"
11929 { start_year(parser, p); }
11932 #line 2621 "upb/json/parser.rl"
11933 { CHECK_RETURN_TOP(end_year(parser, p)); }
11936 #line 2625 "upb/json/parser.rl"
11937 { start_month(parser, p); }
11940 #line 2626 "upb/json/parser.rl"
11941 { CHECK_RETURN_TOP(end_month(parser, p)); }
11944 #line 2630 "upb/json/parser.rl"
11945 { start_day(parser, p); }
11948 #line 2631 "upb/json/parser.rl"
11949 { CHECK_RETURN_TOP(end_day(parser, p)); }
11952 #line 2635 "upb/json/parser.rl"
11953 { start_hour(parser, p); }
11956 #line 2636 "upb/json/parser.rl"
11957 { CHECK_RETURN_TOP(end_hour(parser, p)); }
11960 #line 2640 "upb/json/parser.rl"
11961 { start_minute(parser, p); }
11964 #line 2641 "upb/json/parser.rl"
11965 { CHECK_RETURN_TOP(end_minute(parser, p)); }
11968 #line 2645 "upb/json/parser.rl"
11969 { start_second(parser, p); }
11972 #line 2646 "upb/json/parser.rl"
11973 { CHECK_RETURN_TOP(end_second(parser, p)); }
11976 #line 2651 "upb/json/parser.rl"
11977 { start_duration_base(parser, p); }
11980 #line 2652 "upb/json/parser.rl"
11981 { CHECK_RETURN_TOP(end_duration_base(parser, p)); }
11984 #line 2654 "upb/json/parser.rl"
11988 #line 2659 "upb/json/parser.rl"
11989 { start_timestamp_base(parser); }
11992 #line 2661 "upb/json/parser.rl"
11993 { start_timestamp_fraction(parser, p); }
11996 #line 2662 "upb/json/parser.rl"
11997 { CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
12000 #line 2664 "upb/json/parser.rl"
12001 { start_timestamp_zone(parser, p); }
12004 #line 2665 "upb/json/parser.rl"
12005 { CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
12008 #line 2667 "upb/json/parser.rl"
12012 #line 2672 "upb/json/parser.rl"
12013 { start_fieldmask_path_text(parser, p); }
12016 #line 2673 "upb/json/parser.rl"
12017 { end_fieldmask_path_text(parser, p); }
12020 #line 2678 "upb/json/parser.rl"
12021 { start_fieldmask_path(parser); }
12024 #line 2679 "upb/json/parser.rl"
12025 { end_fieldmask_path(parser); }
12028 #line 2685 "upb/json/parser.rl"
12032 #line 2690 "upb/json/parser.rl"
12034 if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
12036 } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_DURATION)) {
12038 } else if (is_wellknown_msg(parser, UPB_WELLKNOWN_FIELDMASK)) {
12046 #line 2703 "upb/json/parser.rl"
12050 #line 2708 "upb/json/parser.rl"
12052 if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
12053 start_any_member(parser, p);
12055 start_member(parser);
12060 #line 2715 "upb/json/parser.rl"
12061 { CHECK_RETURN_TOP(end_membername(parser)); }
12064 #line 2718 "upb/json/parser.rl"
12066 if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
12067 end_any_member(parser, p);
12069 end_member(parser);
12074 #line 2729 "upb/json/parser.rl"
12076 if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
12077 start_any_object(parser, p);
12079 start_object(parser);
12084 #line 2738 "upb/json/parser.rl"
12086 if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
12087 CHECK_RETURN_TOP(end_any_object(parser, p));
12089 end_object(parser);
12094 #line 2750 "upb/json/parser.rl"
12095 { CHECK_RETURN_TOP(start_array(parser)); }
12098 #line 2754 "upb/json/parser.rl"
12099 { end_array(parser); }
12102 #line 2759 "upb/json/parser.rl"
12103 { CHECK_RETURN_TOP(start_number(parser, p)); }
12106 #line 2760 "upb/json/parser.rl"
12107 { CHECK_RETURN_TOP(end_number(parser, p)); }
12110 #line 2762 "upb/json/parser.rl"
12111 { CHECK_RETURN_TOP(start_stringval(parser)); }
12114 #line 2763 "upb/json/parser.rl"
12115 { CHECK_RETURN_TOP(end_stringval(parser)); }
12118 #line 2765 "upb/json/parser.rl"
12119 { CHECK_RETURN_TOP(end_bool(parser, true)); }
12122 #line 2767 "upb/json/parser.rl"
12123 { CHECK_RETURN_TOP(end_bool(parser, false)); }
12126 #line 2769 "upb/json/parser.rl"
12127 { CHECK_RETURN_TOP(end_null(parser)); }
12130 #line 2771 "upb/json/parser.rl"
12131 { CHECK_RETURN_TOP(start_subobject_full(parser)); }
12134 #line 2772 "upb/json/parser.rl"
12135 { end_subobject_full(parser); }
12138 #line 2777 "upb/json/parser.rl"
12141 #line 3185 "upb/json/parser.c"
12158 #line 2586 "upb/json/parser.rl"
12164 #line 2760 "upb/json/parser.rl"
12165 { CHECK_RETURN_TOP(end_number(parser, p)); }
12168 #line 2765 "upb/json/parser.rl"
12169 { CHECK_RETURN_TOP(end_bool(parser, true)); }
12172 #line 2767 "upb/json/parser.rl"
12173 { CHECK_RETURN_TOP(end_bool(parser, false)); }
12176 #line 2769 "upb/json/parser.rl"
12177 { CHECK_RETURN_TOP(end_null(parser)); }
12180 #line 2772 "upb/json/parser.rl"
12181 { end_subobject_full(parser); }
12183 #line 3227 "upb/json/parser.c"
12191 #line 2805 "upb/json/parser.rl"
12194 upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
12196 capture_suspend(parser, &p);
12200 /* Save parsing state back to parser. */
12201 parser->current_state = cs;
12202 parser->parser_top = top;
12208 upb_json_parser *parser = closure;
12220 parse(parser, hd, &eof_ch, 0, NULL);
12222 return parser->current_state >= 106;
12232 /* Emit Ragel initialization of the parser. */
12234 #line 3278 "upb/json/parser.c"
12240 #line 2847 "upb/json/parser.rl"
12326 /* If this fails, uncomment and increase the value in parser.h. */
12378 /* Populate parser methods for all submessages, so the name tables will