#include <assert.h>#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Classes | |
| struct | re_node_set |
| struct | re_token_t |
| struct | re_string_t |
| struct | bin_tree_t |
| struct | re_dfastate_t |
| struct | re_subexp_t |
| struct | re_state_table_entry |
| struct | state_array_t |
| struct | re_sub_match_last_t |
| struct | re_sub_match_top_t |
| struct | re_backref_cache_entry |
| struct | re_match_context_t |
| struct | re_sift_context_t |
| struct | re_fail_stack_ent_t |
| struct | re_fail_stack_t |
| struct | re_dfa_t |
| struct | bracket_elem_t |
Defines | |
| #define | _REGEX_INTERNAL_H 1 |
| #define | isblank(ch) ((ch) == ' ' || (ch) == '\t') |
| #define | gettext(msgid) (msgid) |
| #define | gettext_noop(String) String |
| #define | BE(expr, val) (expr) |
| #define | inline |
| #define | BYTE_BITS 8 |
| #define | SBC_MAX 256 |
| #define | COLL_ELEM_LEN_MAX 8 |
| #define | NEWLINE_CHAR '\n' |
| #define | WIDE_NEWLINE_CHAR L'\n' |
| #define | __wctype wctype |
| #define | __iswctype iswctype |
| #define | __btowc btowc |
| #define | __wcrtomb wcrtomb |
| #define | attribute_hidden _nl_default_default_domain |
| #define | __thread |
| #define | UINT_BITS (sizeof (unsigned int) * BYTE_BITS) |
| #define | BITSET_UINTS ((SBC_MAX + UINT_BITS - 1) / UINT_BITS) |
| #define | bitset_set(set, i) (set[i / UINT_BITS] |= 1UL << i % UINT_BITS) |
| #define | bitset_clear(set, i) (set[i / UINT_BITS] &= ~(1UL << i % UINT_BITS)) |
| #define | bitset_contain(set, i) (set[i / UINT_BITS] & (1UL << i % UINT_BITS)) |
| #define | bitset_empty(set) memset (set, 0, sizeof (unsigned int) * BITSET_UINTS) |
| #define | bitset_set_all(set) memset (set, 255, sizeof (unsigned int) * BITSET_UINTS) |
| #define | bitset_copy(dest, src) memcpy (dest, src, sizeof (unsigned int) * BITSET_UINTS) |
| #define | PREV_WORD_CONSTRAINT 0x0001 |
| #define | PREV_NOTWORD_CONSTRAINT 0x0002 |
| #define | NEXT_WORD_CONSTRAINT 0x0004 |
| #define | NEXT_NOTWORD_CONSTRAINT 0x0008 |
| #define | PREV_NEWLINE_CONSTRAINT 0x0010 |
| #define | NEXT_NEWLINE_CONSTRAINT 0x0020 |
| #define | PREV_BEGBUF_CONSTRAINT 0x0040 |
| #define | NEXT_ENDBUF_CONSTRAINT 0x0080 |
| #define | DUMMY_CONSTRAINT 0x0100 |
| #define | IS_EPSILON_NODE(type) |
| #define | ACCEPT_MB_NODE(type) ((type) == COMPLEX_BRACKET || (type) == OP_PERIOD) |
| #define | MBS_ALLOCATED(pstr) (pstr->icase) |
| #define | MBS_CASE_ALLOCATED(pstr) (pstr->trans != NULL) |
| #define | re_string_peek_byte(pstr, offset) ((pstr)->mbs[(pstr)->cur_idx + offset]) |
| #define | re_string_peek_byte_case(pstr, offset) ((pstr)->mbs_case[(pstr)->cur_idx + offset]) |
| #define | re_string_fetch_byte(pstr) ((pstr)->mbs[(pstr)->cur_idx++]) |
| #define | re_string_fetch_byte_case(pstr) ((pstr)->mbs_case[(pstr)->cur_idx++]) |
| #define | re_string_first_byte(pstr, idx) ((idx) == (pstr)->len || (pstr)->wcs[idx] != WEOF) |
| #define | re_string_is_single_byte_char(pstr, idx) |
| #define | re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx) |
| #define | re_string_cur_idx(pstr) ((pstr)->cur_idx) |
| #define | re_string_get_buffer(pstr) ((pstr)->mbs) |
| #define | re_string_length(pstr) ((pstr)->len) |
| #define | re_string_byte_at(pstr, idx) ((pstr)->mbs[idx]) |
| #define | re_string_skip_bytes(pstr, idx) ((pstr)->cur_idx += (idx)) |
| #define | re_string_set_index(pstr, idx) ((pstr)->cur_idx = (idx)) |
| #define | re_malloc(t, n) ((t *) malloc ((n) * sizeof (t))) |
| #define | re_realloc(p, t, n) ((t *) realloc (p, (n) * sizeof (t))) |
| #define | re_free(p) free (p) |
| #define | CONTEXT_WORD 1 |
| #define | CONTEXT_NEWLINE (CONTEXT_WORD << 1) |
| #define | CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1) |
| #define | CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1) |
| #define | IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD) |
| #define | IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE) |
| #define | IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF) |
| #define | IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF) |
| #define | IS_ORDINARY_CONTEXT(c) ((c) == 0) |
| #define | IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_') |
| #define | IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR) |
| #define | IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_') |
| #define | IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR) |
| #define | NOT_SATISFY_PREV_CONSTRAINT(constraint, context) |
| #define | NOT_SATISFY_NEXT_CONSTRAINT(constraint, context) |
| #define | re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set)) |
| #define | re_node_set_remove(set, id) (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1)) |
| #define | re_node_set_empty(p) ((p)->nelem = 0) |
| #define | re_node_set_free(set) re_free ((set)->elems) |
Typedefs | |
| typedef unsigned int | bitset [BITSET_UINTS] |
| typedef unsigned int * | re_bitset_ptr_t |
| typedef re_string_t | re_string_t |
| typedef bin_tree_t | bin_tree_t |
| typedef re_dfastate_t | re_dfastate_t |
| typedef re_dfa_t | re_dfa_t |
Enumerations | |
| enum | re_context_type { INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT, WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT, LINE_FIRST = PREV_NEWLINE_CONSTRAINT, LINE_LAST = NEXT_NEWLINE_CONSTRAINT, BUF_FIRST = PREV_BEGBUF_CONSTRAINT, BUF_LAST = NEXT_ENDBUF_CONSTRAINT, WORD_DELIM = DUMMY_CONSTRAINT } |
| enum | re_token_type_t { NON_TYPE = 0, OP_OPEN_BRACKET, OP_CLOSE_BRACKET, OP_CHARSET_RANGE, OP_OPEN_DUP_NUM, OP_CLOSE_DUP_NUM, OP_NON_MATCH_LIST, OP_OPEN_COLL_ELEM, OP_CLOSE_COLL_ELEM, OP_OPEN_EQUIV_CLASS, OP_CLOSE_EQUIV_CLASS, OP_OPEN_CHAR_CLASS, OP_CLOSE_CHAR_CLASS, OP_WORD, OP_NOTWORD, BACK_SLASH, CONCAT, ALT, SUBEXP, SIMPLE_BRACKET, OP_OPEN_SUBEXP, OP_CLOSE_SUBEXP, OP_PERIOD, CHARACTER, END_OF_RE, OP_ALT, OP_DUP_ASTERISK, OP_DUP_PLUS, OP_DUP_QUESTION, OP_BACK_REF, ANCHOR, END_OF_RE_TOKEN_T } |
| enum | bracket_elem_type { SB_CHAR, MB_CHAR, EQUIV_CLASS, COLL_SYM, CHAR_CLASS } |
Functions | |
| static void bitset_not | _RE_ARGS ((bitset set)) |
| static void | bitset_not (set) bitset set |
Variables | |
| const bitset | src |
|
|
Definition at line 110 of file regex_internal.h. Referenced by build_range_exp(), build_word_op(), parse_bracket_exp(), and re_compile_fastmap_iter(). |
|
|
Definition at line 109 of file regex_internal.h. |
|
|
Definition at line 113 of file regex_internal.h. |
|
|
Definition at line 111 of file regex_internal.h. Referenced by re_compile_fastmap_iter(). |
|
|
Definition at line 108 of file regex_internal.h. Referenced by build_charclass(). |
|
|
Definition at line 22 of file regex_internal.h. |
|
|
Definition at line 302 of file regex_internal.h. Referenced by check_arrival_add_next_nodes(), proceed_next_node(), and sift_states_backward(). |
|
|
Definition at line 112 of file regex_internal.h. |
|
|
|
Definition at line 138 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Definition at line 139 of file regex_internal.h. Referenced by build_trtable(), check_node_accept(), and group_nodes_into_DFAstates(). |
|
|
Definition at line 143 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Definition at line 140 of file regex_internal.h. Referenced by build_trtable(), and group_nodes_into_DFAstates(). |
|
|
Definition at line 137 of file regex_internal.h. Referenced by build_collating_symbol(), build_equiv_class(), build_range_exp(), build_word_op(), group_nodes_into_DFAstates(), and parse_bracket_exp(). |
|
|
Definition at line 141 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Definition at line 133 of file regex_internal.h. Referenced by build_trtable(), build_word_op(), group_nodes_into_DFAstates(), init_word_char(), parse_bracket_exp(), and re_compile_fastmap_iter(). |
|
|
Definition at line 96 of file regex_internal.h. |
|
|
Definition at line 100 of file regex_internal.h. |
|
|
Definition at line 422 of file regex_internal.h. Referenced by create_initial_state(), re_search_internal(), and re_string_reconstruct(). |
|
|
Definition at line 423 of file regex_internal.h. Referenced by re_string_context_at(). |
|
|
Definition at line 421 of file regex_internal.h. Referenced by build_trtable(), create_initial_state(), re_search_internal(), re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 420 of file regex_internal.h. Referenced by build_trtable(), create_initial_state(), re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 157 of file regex_internal.h. |
|
|
Definition at line 75 of file regex_internal.h. |
|
|
Definition at line 81 of file regex_internal.h. |
|
|
Definition at line 120 of file regex_internal.h. |
|
|
Definition at line 427 of file regex_internal.h. Referenced by acquire_init_state_context(). |
|
|
Definition at line 428 of file regex_internal.h. |
|
|
Value: ((type) == OP_ALT || (type) == OP_DUP_ASTERISK || (type) == OP_DUP_PLUS \ || (type) == OP_DUP_QUESTION || (type) == ANCHOR \ || (type) == OP_OPEN_SUBEXP || (type) == OP_CLOSE_SUBEXP) Definition at line 297 of file regex_internal.h. Referenced by calc_eclosure_iter(), check_arrival_add_next_nodes(), proceed_next_node(), sift_states_backward(), and sub_epsilon_src_nodes(). |
|
|
Definition at line 432 of file regex_internal.h. Referenced by re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 426 of file regex_internal.h. Referenced by acquire_init_state_context(). |
|
|
Definition at line 429 of file regex_internal.h. Referenced by acquire_init_state_context(). |
|
|
Definition at line 434 of file regex_internal.h. Referenced by re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 433 of file regex_internal.h. Referenced by re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 431 of file regex_internal.h. Referenced by build_trtable(), re_string_context_at(), and re_string_reconstruct(). |
|
|
Definition at line 425 of file regex_internal.h. Referenced by acquire_init_state_context(). |
|
|
Definition at line 54 of file regex_internal.h. Referenced by build_charclass(). |
|
|
Definition at line 350 of file regex_internal.h. Referenced by re_string_allocate(), re_string_construct(), re_string_destruct(), re_string_realloc_buffers(), and re_string_reconstruct(). |
|
|
Definition at line 353 of file regex_internal.h. Referenced by re_string_allocate(), re_string_construct(), re_string_destruct(), re_string_realloc_buffers(), and re_string_reconstruct(). |
|
|
Definition at line 103 of file regex_internal.h. Referenced by build_trtable(), and group_nodes_into_DFAstates(). |
|
|
Definition at line 156 of file regex_internal.h. |
|
|
Definition at line 154 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Definition at line 152 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Definition at line 151 of file regex_internal.h. Referenced by group_nodes_into_DFAstates(). |
|
|
Value: ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \ || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \ || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \ || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context))) Definition at line 442 of file regex_internal.h. Referenced by check_halt_node_context(), check_node_accept(), and transit_state_bkref(). |
|
|
Value: ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \ || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \ || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\ || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context))) Definition at line 436 of file regex_internal.h. Referenced by create_cd_newstate(). |
|
|
Definition at line 155 of file regex_internal.h. |
|
|
Definition at line 153 of file regex_internal.h. |
|
|
Definition at line 150 of file regex_internal.h. |
|
|
Definition at line 149 of file regex_internal.h. |
|
|
|
|
Definition at line 636 of file regex_internal.h. Referenced by build_trtable(), check_arrival(), check_arrival_add_next_nodes(), duplicate_node_closure(), proceed_next_node(), and sift_states_backward(). |
|
|
|
Definition at line 620 of file regex_internal.h. Referenced by analyze(), check_arrival(), check_arrival_add_next_nodes(), create_tree(), duplicate_node(), re_node_set_init_copy(), re_node_set_init_union(), re_search_internal(), set_regs(), sift_ctx_init(), and sub_epsilon_src_nodes(). |
|
|
Definition at line 634 of file regex_internal.h. Referenced by sift_states_bkref(). |
|
|
|
Definition at line 394 of file regex_internal.h. Referenced by check_node_accept(), re_search_internal(), and re_string_context_at(). |
|
|
Definition at line 391 of file regex_internal.h. Referenced by check_matching(), parse_bracket_element(), parse_dup_op(), parse_expression(), peek_token(), peek_token_bracket(), sift_states_bkref(), transit_state(), transit_state_bkref(), and transit_state_sb(). |
|
|
Definition at line 390 of file regex_internal.h. Referenced by check_matching(), parse_bracket_symbol(), parse_expression(), peek_token(), and peek_token_bracket(). |
|
|
Definition at line 381 of file regex_internal.h. Referenced by parse_bracket_symbol(), and transit_state(). |
|
|
Definition at line 383 of file regex_internal.h. Referenced by parse_bracket_symbol(). |
|
|
Definition at line 385 of file regex_internal.h. Referenced by check_matching(), parse_expression(), peek_token(), peek_token_bracket(), and re_search_internal(). |
|
|
Definition at line 392 of file regex_internal.h. Referenced by get_subexp(), and proceed_next_node(). |
|
|
Value: ((pstr)->wcs[idx] != WEOF && ((pstr)->len == (idx) \
|| (pstr)->wcs[(idx) + 1] != WEOF))
Definition at line 387 of file regex_internal.h. |
|
|
Definition at line 393 of file regex_internal.h. Referenced by peek_token(). |
|
|
Definition at line 377 of file regex_internal.h. Referenced by parse_bracket_symbol(), peek_token(), and peek_token_bracket(). |
|
|
Definition at line 379 of file regex_internal.h. Referenced by peek_token(). |
|
|
Definition at line 396 of file regex_internal.h. Referenced by parse_dup_op(). |
|
|
Definition at line 395 of file regex_internal.h. Referenced by fetch_token(), parse_bracket_element(), parse_bracket_exp(), parse_bracket_symbol(), peek_token(), peek_token_bracket(), transit_state(), and transit_state_sb(). |
|
|
Definition at line 98 of file regex_internal.h. Referenced by build_equiv_class(), build_range_exp(), build_trtable(), build_word_op(), parse_bracket_exp(), re_compile_fastmap(), re_compile_fastmap_iter(), and regcomp(). |
|
|
Definition at line 131 of file regex_internal.h. Referenced by build_trtable(), init_word_char(), and re_compile_fastmap_iter(). |
|