Implements CCL lexical analyzer (scanner). More...
#include <string.h>#include <stdlib.h>#include <ctype.h>#include "cclp.h"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 249 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 268 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 285 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 279 of file ccltoken.c.
References ccl_parser::ccl_case_sensitive.
| struct ccl_token* ccl_parser_tokenize | ( | CCL_parser | cclp, | |
| const char * | command | |||
| ) | [read] |
Splits CCL command string into individual tokens using a CCL parser.
Definition at line 56 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::left_trunc, ccl_token::len, ccl_token::name, ccl_token::next, ccl_token::prev, ccl_token::right_trunc, ccl_parser::start_pos, token_cmp(), ccl_token::ws_prefix_buf, ccl_token::ws_prefix_len, and xmalloc.
Referenced by ccl_find_str(), and ccl_parser_find_str().
Add single token after a given onde.
Definition at line 190 of file ccltoken.c.
References ccl_assert, CCL_TOK_TERM, ccl_token::kind, ccl_token::left_trunc, ccl_token::len, ccl_token::name, ccl_token::next, ccl_token::prev, ccl_token::right_trunc, 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 212 of file ccltoken.c.
References ccl_token::next, and xfree.
Referenced by ccl_find_str(), and ccl_parser_find_str().
| static const char** create_ar | ( | const char * | v1, | |
| const char * | v2 | |||
| ) | [static] |
Definition at line 224 of file ccltoken.c.
References xmalloc, and xstrdup.
Referenced by ccl_parser_create().
| static void destroy_ar | ( | const char ** | a | ) | [static] |
| static int token_cmp | ( | CCL_parser | cclp, | |
| const char ** | kw, | |||
| struct ccl_token * | token | |||
| ) | [static] |
Definition at line 23 of file ccltoken.c.
References ccl_parser::bibset, ccl_parser::ccl_case_sensitive, ccl_memicmp(), ccl_qual_search_special(), ccl_token::len, and ccl_token::name.
Referenced by ccl_parser_tokenize().
1.6.3