YAZ
5.34.0
|
Simple tokenizer system. More...
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <yaz/log.h>
#include <yaz/wrbuf.h>
#include <yaz/tokenizer.h>
Go to the source code of this file.
Data Structures | |
struct | yaz_tok_parse |
struct | yaz_tok_cfg |
Functions | |
void | yaz_tok_cfg_single_tokens (yaz_tok_cfg_t t, const char *simple) |
yaz_tok_cfg_t | yaz_tok_cfg_create (void) |
void | yaz_tok_cfg_destroy (yaz_tok_cfg_t t) |
static int | read_buf (void **vp) |
yaz_tok_parse_t | yaz_tok_parse_buf (yaz_tok_cfg_t t, const char *buf) |
static int | get_byte (yaz_tok_parse_t tp) |
static void | unget_byte (yaz_tok_parse_t tp, int ch) |
yaz_tok_parse_t | yaz_tok_parse_create (yaz_tok_cfg_t t, yaz_tok_get_byte_t h, void *vp) |
void | yaz_tok_parse_destroy (yaz_tok_parse_t tp) |
int | yaz_tok_move (yaz_tok_parse_t tp) |
const char * | yaz_tok_parse_string (yaz_tok_parse_t tp) |
Simple tokenizer system.
Definition in file tokenizer.c.
|
static |
Definition at line 88 of file tokenizer.c.
References yaz_tok_parse::get_byte_data, yaz_tok_parse::get_byte_func, and yaz_tok_parse::unget_byte.
Referenced by yaz_tok_move().
|
static |
Definition at line 71 of file tokenizer.c.
Referenced by yaz_tok_parse_buf().
|
static |
Definition at line 99 of file tokenizer.c.
References yaz_tok_parse::unget_byte.
Referenced by yaz_tok_move().
yaz_tok_cfg_t yaz_tok_cfg_create | ( | void | ) |
Definition at line 45 of file tokenizer.c.
References yaz_tok_cfg::comment, yaz_tok_cfg::quote_tokens_begin, yaz_tok_cfg::quote_tokens_end, yaz_tok_cfg::ref_count, yaz_tok_cfg::single_tokens, yaz_tok_cfg::white_space, xmalloc, and xstrdup.
Referenced by ccl_qual_add_special(), ccl_qual_field2(), and cql_transform_create().
void yaz_tok_cfg_destroy | ( | yaz_tok_cfg_t | t | ) |
Definition at line 57 of file tokenizer.c.
References yaz_tok_cfg::comment, yaz_tok_cfg::quote_tokens_begin, yaz_tok_cfg::quote_tokens_end, yaz_tok_cfg::ref_count, yaz_tok_cfg::single_tokens, yaz_tok_cfg::white_space, and xfree.
Referenced by ccl_qual_add_special(), ccl_qual_field2(), cql_transform_close(), and yaz_tok_parse_destroy().
void yaz_tok_cfg_single_tokens | ( | yaz_tok_cfg_t | t, |
const char * | simple | ||
) |
Definition at line 39 of file tokenizer.c.
References yaz_tok_cfg::single_tokens, xfree, and xstrdup.
Referenced by ccl_qual_field2(), cql_transform_define_pattern(), and cql_transform_open_FILE().
int yaz_tok_move | ( | yaz_tok_parse_t | tp | ) |
Definition at line 130 of file tokenizer.c.
References yaz_tok_parse::cfg, yaz_tok_cfg::comment, get_byte(), yaz_tok_parse::look, yaz_tok_cfg::quote_tokens_begin, yaz_tok_cfg::quote_tokens_end, yaz_tok_cfg::single_tokens, unget_byte(), yaz_tok_cfg::white_space, yaz_tok_parse::wr_string, wrbuf_putc, wrbuf_rewind(), YAZ_TOK_EOF, YAZ_TOK_ERROR, YAZ_TOK_QSTRING, and YAZ_TOK_STRING.
Referenced by ccl_qual_add_special(), ccl_qual_field2(), cql_transform_open_FILE(), and cql_transform_parse_tok_line().
yaz_tok_parse_t yaz_tok_parse_buf | ( | yaz_tok_cfg_t | t, |
const char * | buf | ||
) |
Definition at line 83 of file tokenizer.c.
References read_buf(), and yaz_tok_parse_create().
Referenced by ccl_qual_add_special(), ccl_qual_field2(), cql_transform_define_pattern(), and cql_transform_open_FILE().
yaz_tok_parse_t yaz_tok_parse_create | ( | yaz_tok_cfg_t | t, |
yaz_tok_get_byte_t | h, | ||
void * | vp | ||
) |
Definition at line 104 of file tokenizer.c.
References yaz_tok_parse::cfg, yaz_tok_parse::get_byte_data, yaz_tok_parse::get_byte_func, yaz_tok_parse::look, yaz_tok_cfg::ref_count, yaz_tok_parse::unget_byte, yaz_tok_parse::wr_string, wrbuf_alloc(), xmalloc, and YAZ_TOK_ERROR.
Referenced by yaz_tok_parse_buf().
void yaz_tok_parse_destroy | ( | yaz_tok_parse_t | tp | ) |
Definition at line 123 of file tokenizer.c.
References yaz_tok_parse::cfg, yaz_tok_parse::wr_string, wrbuf_destroy(), xfree, and yaz_tok_cfg_destroy().
Referenced by ccl_qual_add_special(), ccl_qual_field2(), cql_transform_define_pattern(), and cql_transform_open_FILE().
const char* yaz_tok_parse_string | ( | yaz_tok_parse_t | tp | ) |
Definition at line 174 of file tokenizer.c.
References yaz_tok_parse::wr_string, and wrbuf_cstr().
Referenced by ccl_qual_add_special(), ccl_qual_field2(), cql_transform_open_FILE(), and cql_transform_parse_tok_line().