+/**
+ * search_term: Parse CCL search term.
+ * cclp: CCL Parser
+ * qa: Qualifier attributes already applied.
+ * term_list: tokens we accept as terms in context
+ * multi: whether we accept "multiple" tokens
+ * return: pointer to node(s); NULL on error.
+ */
+static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
+ ccl_qualifier_t *qa,
+ int *term_list, int multi)
+{
+ struct ccl_rpn_node *p_top = 0;
+ struct ccl_token *lookahead = cclp->look_token;
+ int and_list = 0;
+ int auto_group = 0;
+ int or_list = 0;
+ const char **truncation_aliases;
+ const char *t_default[2];
+ const char **mask_aliases;
+ const char *m_default[2];
+
+ truncation_aliases =
+ ccl_qual_search_special(cclp->bibset, "truncation");
+ if (!truncation_aliases)
+ {
+ truncation_aliases = t_default;
+ t_default[0] = "?";
+ t_default[1] = 0;
+ }
+
+ mask_aliases =
+ ccl_qual_search_special(cclp->bibset, "mask");
+ if (!mask_aliases)
+ {
+ mask_aliases = m_default;
+ m_default[0] = "#";
+ m_default[1] = 0;
+ }
+
+
+ if (qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_AND_LIST, 0))
+ and_list = 1;
+ if (qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_AUTO_GROUP, 0))
+ auto_group = 1;
+ if (qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_OR_LIST, 0))
+ or_list = 1;
+ while (1)
+ {
+ struct ccl_rpn_node *p = 0;
+ size_t no, i;
+ int len = 0;
+ int is_phrase = 0;
+ int is_ccl_masked = 0;
+ size_t max = 200;
+ if (and_list || or_list || !multi)
+ max = 1;
+
+ /* ignore commas when dealing with and-lists .. */
+ if (and_list && lookahead && lookahead->kind == CCL_TOK_COMMA)