library/src/javascript/JSON/BP-JSON.cc
// display the current parse state in terms of path queries
display the current parse state in terms of path queries
display the current parse state in terms of path queries
BP_ERROR_T BP_JSONDisplayParseStatePathsQueriesOnly(P_BP_JSON_PARSE_STATE parse_state)
{
	if(!parse_state)
		return ERR_FAILURE;
	if(!parse_state->token_element_stack)
		return ERR_FAILURE;
	if(!parse_state->token_element_stack_items_allocated_n)
		return ERR_FAILURE;
	size_t element_iter = 0;
	P_BP_JSON_PARSE_TOKEN_ELEMENT curr_element = NULL;
	for(; element_iter < parse_state->current_token_element_index; element_iter++)
	{
		curr_element = &parse_state->token_element_stack[element_iter];
		printf("\n %s", curr_element->path_query_to_current);
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_JSONDisplayParseStatePathsQueriesOnly ( P_BP_JSON_PARSE_STATE parse_state ) { if ( ! parse_state ) return ERR_FAILURE ; if ( ! parse_state -> token_element_stack ) return ERR_FAILURE ; if ( ! parse_state -> token_element_stack_items_allocated_n ) return ERR_FAILURE ; size_t element_iter = 0 ; P_BP_JSON_PARSE_TOKEN_ELEMENT curr_element = NULL ; for ( ; element_iter < parse_state -> current_token_element_index ; element_iter ++ ) { curr_element = & parse_state -> token_element_stack [ element_iter ] ; printf ( " \n " , curr_element -> path_query_to_current ) ; } return ERR_SUCCESS ; }
display the current parse state in terms of path queries
display the current parse state in terms of path queries
// run basic null checks // set element iter to zero // set current element // top level is always going to be the current parsed element index // set current element // display path query to current // return indicating success