YAZ  5.25.0
ccltoken.c File Reference

Implements CCL lexical analyzer (scanner) More...

#include <string.h>
#include <stdlib.h>
#include <yaz/yaz-iconv.h>
#include "cclp.h"

Go to the source code of this file.


static int token_cmp (CCL_parser cclp, const char **kw, struct ccl_token *token)
struct ccl_tokenccl_parser_tokenize (CCL_parser cclp, const char *command)
struct ccl_tokenccl_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)

Detailed Description

Implements CCL lexical analyzer (scanner)

Definition in file ccltoken.c.

Function Documentation

◆ ccl_parser_create()

CCL_parser ccl_parser_create ( CCL_bibset  bibset)

◆ ccl_parser_destroy()

void ccl_parser_destroy ( CCL_parser  p)

◆ ccl_parser_get_error()

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.

◆ ccl_parser_set_case()

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.

◆ ccl_parser_tokenize()

struct ccl_token* ccl_parser_tokenize ( CCL_parser  cclp,
const char *  command 

◆ ccl_token_add()

struct ccl_token* ccl_token_add ( struct ccl_token at)

◆ ccl_token_del()

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().

◆ create_ar()

static const char** create_ar ( const char *  v1,
const char *  v2 

Definition at line 221 of file ccltoken.c.

References xmalloc, and xstrdup.

Referenced by ccl_parser_create().

◆ destroy_ar()

static void destroy_ar ( const char **  a)

Definition at line 235 of file ccltoken.c.

References xfree.

Referenced by ccl_parser_destroy().

◆ token_cmp()

static int token_cmp ( CCL_parser  cclp,
const char **  kw,
struct ccl_token token