IDZEBRA  2.2.7
Data Structures | Macros | Functions | Variables
dfa.h File Reference
#include <bset.h>
#include <dfaset.h>
#include <yaz/yconfig.h>

Go to the source code of this file.

Data Structures

struct  DFA_tran
 
struct  DFA_trans
 
struct  DFA_state
 
struct  DFA
 

Macros

#define L_LP   1
 
#define L_RP   2
 
#define L_CHAR   3
 
#define L_CHARS   4
 
#define L_ANY   5
 
#define L_ALT   6
 
#define L_ANYZ   7
 
#define L_WILD   8
 
#define L_QUEST   9
 
#define L_CLOS1   10
 
#define L_CLOS0   11
 
#define L_END   12
 
#define L_START   13
 
#define DFA_ERR_SYNTAX   1
 
#define DFA_ERR_LP   2
 
#define DFA_ERR_RP   3
 

Functions

struct DFAdfa_init (void)
 
void dfa_anyset_includes_nl (struct DFA *dfa)
 
void dfa_set_cmap (struct DFA *dfa, void *vp, const char **(*cmap)(void *vp, const char **from, int len))
 
int dfa_parse (struct DFA *, const char **)
 
void dfa_mkstate (struct DFA *)
 
void dfa_delete (struct DFA **)
 
int dfa_get_last_rule (struct DFA *)
 
void dfa_parse_cmap_clean (struct DFA *d)
 
void dfa_parse_cmap_new (struct DFA *d, const int *cmap)
 
void dfa_parse_cmap_del (struct DFA *d, int from)
 
void dfa_parse_cmap_add (struct DFA *d, int from, int to)
 

Variables

int debug_dfa_trav
 
int debug_dfa_tran
 
int debug_dfa_followpos
 
int dfa_verbose
 
unsigned short dfa_thompson_chars []
 
unsigned short dfa_ccl_chars []
 

Macro Definition Documentation

◆ DFA_ERR_LP

#define DFA_ERR_LP   2

Definition at line 98 of file dfa.h.

◆ DFA_ERR_RP

#define DFA_ERR_RP   3

Definition at line 99 of file dfa.h.

◆ DFA_ERR_SYNTAX

#define DFA_ERR_SYNTAX   1

Definition at line 97 of file dfa.h.

◆ L_ALT

#define L_ALT   6

Definition at line 88 of file dfa.h.

◆ L_ANY

#define L_ANY   5

Definition at line 87 of file dfa.h.

◆ L_ANYZ

#define L_ANYZ   7

Definition at line 89 of file dfa.h.

◆ L_CHAR

#define L_CHAR   3

Definition at line 85 of file dfa.h.

◆ L_CHARS

#define L_CHARS   4

Definition at line 86 of file dfa.h.

◆ L_CLOS0

#define L_CLOS0   11

Definition at line 93 of file dfa.h.

◆ L_CLOS1

#define L_CLOS1   10

Definition at line 92 of file dfa.h.

◆ L_END

#define L_END   12

Definition at line 94 of file dfa.h.

◆ L_LP

#define L_LP   1

Definition at line 83 of file dfa.h.

◆ L_QUEST

#define L_QUEST   9

Definition at line 91 of file dfa.h.

◆ L_RP

#define L_RP   2

Definition at line 84 of file dfa.h.

◆ L_START

#define L_START   13

Definition at line 95 of file dfa.h.

◆ L_WILD

#define L_WILD   8

Definition at line 90 of file dfa.h.

Function Documentation

◆ dfa_anyset_includes_nl()

void dfa_anyset_includes_nl ( struct DFA dfa)

Definition at line 1104 of file dfa.c.

References add_BSet(), DFA_parse::anyset, DFA_parse::charset, and DFA::parse_info.

Referenced by dict_lookup_grep().

◆ dfa_delete()

void dfa_delete ( struct DFA **  dfap)

◆ dfa_get_last_rule()

int dfa_get_last_rule ( struct DFA dfa)

Definition at line 1116 of file dfa.c.

References DFA::parse_info, and DFA_parse::rule.

◆ dfa_init()

struct DFA* dfa_init ( void  )

◆ dfa_mkstate()

void dfa_mkstate ( struct DFA dfa)

◆ dfa_parse()

int dfa_parse ( struct DFA dfa,
const char **  pattern 
)

◆ dfa_parse_cmap_add()

void dfa_parse_cmap_add ( struct DFA d,
int  from,
int  to 
)

Definition at line 978 of file dfa.c.

References DFA_parse::charMap, DFA_parse::charMapSize, ifree(), imalloc(), and DFA::parse_info.

Referenced by lexSpecDFA().

◆ dfa_parse_cmap_clean()

void dfa_parse_cmap_clean ( struct DFA d)

Definition at line 926 of file dfa.c.

References DFA_parse::charMap, DFA_parse::charMapSize, imalloc(), and DFA::parse_info.

◆ dfa_parse_cmap_del()

void dfa_parse_cmap_del ( struct DFA d,
int  from 
)

Definition at line 960 of file dfa.c.

References DFA_parse::charMap, and DFA::parse_info.

Referenced by lexSpecDFA().

◆ dfa_parse_cmap_new()

void dfa_parse_cmap_new ( struct DFA d,
const int *  cmap 
)

◆ dfa_set_cmap()

void dfa_set_cmap ( struct DFA dfa,
void *  vp,
const char **(*)(void *vp, const char **from, int len)  cmap 
)

Definition at line 1109 of file dfa.c.

References DFA_parse::cmap, DFA_parse::cmap_data, and DFA::parse_info.

Referenced by dict_lookup_grep().

Variable Documentation

◆ debug_dfa_followpos

int debug_dfa_followpos
extern

Definition at line 68 of file dfa.c.

Referenced by agrep_options(), dict_lookup_grep(), lexer_options(), main(), mk_dfas(), and readFileSpec().

◆ debug_dfa_tran

int debug_dfa_tran
extern

◆ debug_dfa_trav

int debug_dfa_trav
extern

Definition at line 66 of file dfa.c.

Referenced by agrep_options(), dfa_trav(), dict_lookup_grep(), lexer_options(), main(), and readFileSpec().

◆ dfa_ccl_chars

unsigned short dfa_ccl_chars[]

Definition at line 81 of file dfa.h.

◆ dfa_thompson_chars

unsigned short dfa_thompson_chars[]
extern

◆ dfa_verbose

int dfa_verbose
extern

Definition at line 69 of file dfa.c.

Referenced by agrep_options(), dict_lookup_grep(), lexer_options(), main(), mk_dfas(), and readFileSpec().