Lines Matching defs:parser
10291 #line 1 "upb/json/parser.rl"
10293 ** upb::json::Parser (upb_json_parser)
10295 ** A parser that uses the Ragel State Machine Compiler to generate
10302 ** This parser can handle the basics, but needs several things to be fleshed
10371 /* Accumulate buffer. See details in parser.rl. */
10377 /* Multi-part text data. See details in parser.rl. */
10381 /* Input capture. See details in parser.rl. */
10592 * Some parts of the parser need an entire value as a contiguous string. For
10814 /* Callbacks from the parser **************************************************/
10816 /* These are the functions called directly from the parser itself.
10817 * We define these in the same order as their declarations in the parser. */
11025 /* Start a new parser frame: parser frames correspond one-to-one with
11051 * current parser frame.
11132 * parser state machine has already decided that this is a string field
11196 * value parser (invoked next) will emit the mapentry's value field and then
11225 * if they see is_mapentry (when invoked by the parser state machine, they
11303 /* Beginning of a map. Start a new parser frame in a repeated-field
11323 /* Beginning of a subobject. Start a new parser frame in the submsg
11422 /* The actual parser **********************************************************/
11424 /* What follows is the Ragel parser itself. The language is specified in Ragel
11440 #line 1245 "upb/json/parser.rl"
11444 #line 1157 "upb/json/parser.c"
11593 #line 1248 "upb/json/parser.rl"
11597 upb_json_parser *parser = closure;
11600 int cs = parser->current_state;
11601 int *stack = parser->parser_stack;
11602 int top = parser->parser_top;
11607 parser->handle = handle;
11612 capture_resume(parser, buf);
11615 #line 1328 "upb/json/parser.c"
11690 #line 1160 "upb/json/parser.rl"
11694 #line 1161 "upb/json/parser.rl"
11698 #line 1165 "upb/json/parser.rl"
11699 { start_text(parser, p); }
11702 #line 1166 "upb/json/parser.rl"
11703 { CHECK_RETURN_TOP(end_text(parser, p)); }
11706 #line 1172 "upb/json/parser.rl"
11707 { start_hex(parser); }
11710 #line 1173 "upb/json/parser.rl"
11711 { hexdigit(parser, p); }
11714 #line 1174 "upb/json/parser.rl"
11715 { CHECK_RETURN_TOP(end_hex(parser)); }
11718 #line 1180 "upb/json/parser.rl"
11719 { CHECK_RETURN_TOP(escape(parser, p)); }
11722 #line 1186 "upb/json/parser.rl"
11726 #line 1189 "upb/json/parser.rl"
11730 #line 1191 "upb/json/parser.rl"
11734 #line 1196 "upb/json/parser.rl"
11735 { start_member(parser); }
11738 #line 1197 "upb/json/parser.rl"
11739 { CHECK_RETURN_TOP(end_membername(parser)); }
11742 #line 1200 "upb/json/parser.rl"
11743 { end_member(parser); }
11746 #line 1206 "upb/json/parser.rl"
11747 { start_object(parser); }
11750 #line 1209 "upb/json/parser.rl"
11751 { end_object(parser); }
11754 #line 1215 "upb/json/parser.rl"
11755 { CHECK_RETURN_TOP(start_array(parser)); }
11758 #line 1219 "upb/json/parser.rl"
11759 { end_array(parser); }
11762 #line 1224 "upb/json/parser.rl"
11763 { start_number(parser, p); }
11766 #line 1225 "upb/json/parser.rl"
11767 { CHECK_RETURN_TOP(end_number(parser, p)); }
11770 #line 1227 "upb/json/parser.rl"
11771 { CHECK_RETURN_TOP(start_stringval(parser)); }
11774 #line 1228 "upb/json/parser.rl"
11775 { CHECK_RETURN_TOP(end_stringval(parser)); }
11778 #line 1230 "upb/json/parser.rl"
11779 { CHECK_RETURN_TOP(parser_putbool(parser, true)); }
11782 #line 1232 "upb/json/parser.rl"
11783 { CHECK_RETURN_TOP(parser_putbool(parser, false)); }
11786 #line 1234 "upb/json/parser.rl"
11790 #line 1236 "upb/json/parser.rl"
11791 { CHECK_RETURN_TOP(start_subobject(parser)); }
11794 #line 1237 "upb/json/parser.rl"
11795 { end_subobject(parser); }
11798 #line 1242 "upb/json/parser.rl"
11801 #line 1514 "upb/json/parser.c"
11814 #line 1269 "upb/json/parser.rl"
11817 upb_status_seterrf(&parser->status, "Parse error at '%.*s'\n", pe - p, p);
11818 upb_env_reporterror(parser->env, &parser->status);
11820 capture_suspend(parser, &p);
11824 /* Save parsing state back to parser. */
11825 parser->current_state = cs;
11826 parser->parser_top = top;
11853 /* Emit Ragel initialization of the parser. */
11855 #line 1568 "upb/json/parser.c"
11861 #line 1309 "upb/json/parser.rl"
11967 /* If this fails, uncomment and increase the value in parser.h. */