YAZ
5.34.0
|
Implements CCL lexical analyzer (scanner) More...
Go to the source code of this file.
Functions | |
static int | token_cmp (CCL_parser cclp, const char **kw, struct ccl_token *token) |
struct ccl_token * | ccl_parser_tokenize (CCL_parser cclp, const char *command) |
struct ccl_token * | ccl_token_add (struct ccl_token *at) |
void | ccl_token_del (struct ccl_token *list) |
static const char ** | create_ar (const char *v1, const char *v2) |
static void | destroy_ar (const char **a) |
CCL_parser | ccl_parser_create (CCL_bibset bibset) |
void | ccl_parser_destroy (CCL_parser p) |
void | ccl_parser_set_case (CCL_parser p, int case_sensitivity_flag) |
int | ccl_parser_get_error (CCL_parser cclp, int *pos) |
Implements CCL lexical analyzer (scanner)
Definition in file ccltoken.c.
CCL_parser ccl_parser_create | ( | CCL_bibset | bibset | ) |
Create CCL parser
Definition at line 246 of file ccltoken.c.
References ccl_parser::bibset, ccl_parser::ccl_case_sensitive, ccl_parser::ccl_token_and, ccl_parser::ccl_token_not, ccl_parser::ccl_token_or, ccl_parser::ccl_token_set, create_ar(), ccl_parser::error_code, ccl_parser::error_pos, ccl_parser::look_token, and xmalloc.
Referenced by ccl_find_str().
void ccl_parser_destroy | ( | CCL_parser | p | ) |
Destroy CCL parser
Definition at line 265 of file ccltoken.c.
References ccl_parser::ccl_token_and, ccl_parser::ccl_token_not, ccl_parser::ccl_token_or, ccl_parser::ccl_token_set, destroy_ar(), and xfree.
Referenced by ccl_find_str().
int ccl_parser_get_error | ( | CCL_parser | cclp, |
int * | pos | ||
) |
Definition at line 282 of file ccltoken.c.
References ccl_parser::error_code, ccl_parser::error_pos, and ccl_parser::start_pos.
void ccl_parser_set_case | ( | CCL_parser | p, |
int | case_sensitivity_flag | ||
) |
Set case sensitivity for parser
Definition at line 276 of file ccltoken.c.
References ccl_parser::ccl_case_sensitive.
struct ccl_token* ccl_parser_tokenize | ( | CCL_parser | cclp, |
const char * | command | ||
) |
Splits CCL command string into individual tokens using a CCL parser.
Definition at line 58 of file ccltoken.c.
References ccl_parser::bibset, ccl_assert, ccl_qual_search_special(), CCL_TOK_AND, CCL_TOK_COMMA, CCL_TOK_EOL, CCL_TOK_EQ, CCL_TOK_LP, CCL_TOK_NOT, CCL_TOK_OR, CCL_TOK_PROX, CCL_TOK_REL, CCL_TOK_RP, CCL_TOK_SET, CCL_TOK_TERM, ccl_parser::ccl_token_and, ccl_parser::ccl_token_not, ccl_parser::ccl_token_or, ccl_parser::ccl_token_set, ccl_token::kind, ccl_token::len, ccl_token::name, ccl_token::next, ccl_token::prev, ccl_parser::start_pos, token_cmp(), ccl_token::ws_prefix_buf, ccl_token::ws_prefix_len, xmalloc, and yaz_isdigit.
Referenced by ccl_find_str(), and ccl_parser_find_str().
Add single token after a given onde.
Definition at line 188 of file ccltoken.c.
References ccl_assert, CCL_TOK_TERM, ccl_token::kind, ccl_token::len, ccl_token::name, ccl_token::next, ccl_token::prev, ccl_token::ws_prefix_buf, ccl_token::ws_prefix_len, and xmalloc.
Referenced by qualifiers_order().
void ccl_token_del | ( | struct ccl_token * | list | ) |
Deletes token list
Definition at line 209 of file ccltoken.c.
References ccl_token::next, and xfree.
Referenced by ccl_find_str(), and ccl_parser_find_str().
|
static |
Definition at line 221 of file ccltoken.c.
References xmalloc, and xstrdup.
Referenced by ccl_parser_create().
|
static |
|
static |
Definition at line 25 of file ccltoken.c.
References ccl_parser::bibset, ccl_parser::ccl_case_sensitive, ccl_memicmp(), ccl_qual_search_special(), and token::len.
Referenced by ccl_parser_tokenize().