/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/* bison parser for CQL grammar. */
int last_pos;
struct cql_node *top;
NMEM nmem;
+ int strict;
};
#define YYSTYPE token
-#define YYPARSE_PARAM parm
-#define YYLEX_PARAM parm
+int yylex(YYSTYPE *lval, void *vp);
+int yyerror(void *lval, char *msg);
- int yylex(YYSTYPE *lval, void *vp);
- int yyerror(char *s);
%}
-%pure_parser
+
+%name-prefix "cql_"
+%lex-param {void *parm}
+%parse-param {void *parm}
+%pure-parser
%token PREFIX_NAME SIMPLE_STRING AND OR NOT PROX GE LE NE EXACT SORTBY
%%
%%
-int yyerror(char *s)
+int yyerror(void *locp, char *s)
{
return 0;
}
lval->buf = "sortby";
return SORTBY;
}
+ if (cp->strict)
+ return PREFIX_NAME;
if (!cql_strcmp(lval->buf, "all"))
relation_like = 1;
if (!cql_strcmp(lval->buf, "any"))
cp->last_error = 0;
cp->last_pos = 0;
cp->nmem = nmem_create();
+ cp->strict = 0;
return cp;
}
return cp->top;
}
+void cql_parser_strict(CQL_parser cp, int mode)
+{
+ cp->strict = mode;
+}
+
/*
* Local variables:
* c-basic-offset: 4