/* Returns TRUE if the buffer parses against the core grammar, false otherwise.  */
gboolean cr_statement_does_buf_parses_against_core(const guchar *a_buf, enum CREncoding a_encoding)
/* Returns TRUE if the buffer parses against the core grammar, false otherwise.  */
gboolean cr_statement_does_buf_parses_against_core(const guchar *a_buf, enum CREncoding a_encoding)
{
        CRParser *parser = NULL;
        enum CRStatus status = CR_OK;
        gboolean result = FALSE;
        parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
                                         a_encoding, FALSE);
        g_return_val_if_fail (parser, FALSE);
        status = cr_parser_set_use_core_grammar (parser, TRUE);
        if (status != CR_OK) {
                goto cleanup;
        }
        status = cr_parser_parse_statement_core (parser);
        if (status == CR_OK) {
                result = TRUE;
        }
      cleanup:
        if (parser) {
                cr_parser_destroy (parser);
        }
        return result;
}