Lines Matching refs:parser

34 #define PHP_JSON_DEPTH_DEC --parser->depth
36 if (parser->max_depth && parser->depth >= parser->max_depth) { \
37 parser->scanner.errcode = PHP_JSON_ERROR_DEPTH; \
40 ++parser->depth
46 %param { php_json_parser *parser }
69 static int php_json_yylex(union YYSTYPE *value, php_json_parser *parser);
70 static void php_json_yyerror(php_json_parser *parser, char const *msg);
71 static int php_json_parser_array_create(php_json_parser *parser, zval *array);
72 static int php_json_parser_object_create(php_json_parser *parser, zval *array);
82 ZVAL_COPY_VALUE(parser->return_value, &$1);
92 if (parser->methods.object_start && FAILURE == parser->methods.object_start(parser)) {
100 if (parser->methods.object_end && FAILURE == parser->methods.object_end(parser, &$$)) {
110 parser->scanner.errcode = PHP_JSON_ERROR_STATE_MISMATCH;
118 …if ((parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) && parser->methods.object_create == php_j…
121 parser->methods.object_create(parser, &$$);
130 parser->methods.object_create(parser, &$$);
131 if (parser->methods.object_update(parser, &$$, Z_STR($1), &$3) == FAILURE) {
137 if (parser->methods.object_update(parser, &$1, Z_STR($3), &$5) == FAILURE) {
148 if (parser->methods.array_start && FAILURE == parser->methods.array_start(parser)) {
156 if (parser->methods.array_end && FAILURE == parser->methods.array_end(parser, &$$)) {
166 parser->scanner.errcode = PHP_JSON_ERROR_STATE_MISMATCH;
174 if (parser->methods.array_create == php_json_parser_array_create) {
177 parser->methods.array_create(parser, &$$);
186 parser->methods.array_create(parser, &$$);
187 parser->methods.array_append(parser, &$$, &$1);
191 parser->methods.array_append(parser, &$1, &$3);
215 static int php_json_parser_array_create(php_json_parser *parser, zval *array)
221 static int php_json_parser_array_append(php_json_parser *parser, zval *array, zval *zvalue) in php_json_parser_array_append() argument
227 static int php_json_parser_object_create(php_json_parser *parser, zval *object) in php_json_parser_object_create() argument
229 if (parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) { in php_json_parser_object_create()
237 static int php_json_parser_object_update(php_json_parser *parser, zval *object, zend_string *key, z… in php_json_parser_object_update() argument
244 parser->scanner.errcode = PHP_JSON_ERROR_INVALID_PROPERTY_NAME; in php_json_parser_object_update()
258 static int php_json_yylex(union YYSTYPE *value, php_json_parser *parser) in php_json_yylex() argument
260 int token = php_json_scan(&parser->scanner); in php_json_yylex()
261 value->value = parser->scanner.value; in php_json_yylex()
265 static void php_json_yyerror(php_json_parser *parser, char const *msg) in php_json_yyerror() argument
267 if (!parser->scanner.errcode) { in php_json_yyerror()
268 parser->scanner.errcode = PHP_JSON_ERROR_SYNTAX; in php_json_yyerror()
272 PHP_JSON_API php_json_error_code php_json_parser_error_code(const php_json_parser *parser) in php_json_parser_error_code() argument
274 return parser->scanner.errcode; in php_json_parser_error_code()
289 PHP_JSON_API void php_json_parser_init_ex(php_json_parser *parser, in php_json_parser_init_ex() argument
297 memset(parser, 0, sizeof(php_json_parser)); in php_json_parser_init_ex()
298 php_json_scanner_init(&parser->scanner, str, str_len, options); in php_json_parser_init_ex()
299 parser->depth = 1; in php_json_parser_init_ex()
300 parser->max_depth = max_depth; in php_json_parser_init_ex()
301 parser->return_value = return_value; in php_json_parser_init_ex()
302 memcpy(&parser->methods, parser_methods, sizeof(php_json_parser_methods)); in php_json_parser_init_ex()
305 PHP_JSON_API void php_json_parser_init(php_json_parser *parser, in php_json_parser_init() argument
313 parser, in php_json_parser_init()
322 PHP_JSON_API int php_json_parse(php_json_parser *parser) in php_json_parse() argument
324 return php_json_yyparse(parser); in php_json_parse()