Ruby  1.9.3p551(2014-11-13revision48407)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
regparse.c File Reference
#include "regparse.h"
#include "ruby/st.h"

Go to the source code of this file.

Data Structures

struct  st_str_end_key
 
struct  NameEntry
 
struct  INamesArg
 
struct  _FreeNode
 
struct  OnigToken
 
struct  type_cclass_key
 
struct  IApplyCaseFoldArg
 

Macros

#define WARN_BUFSIZE   256
 
#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS
 
#define BACKREF_REL_TO_ABS(rel_no, env)   ((env)->num_mem + 1 + (rel_no))
 
#define ONOFF(v, f, negative)   (negative) ? ((v) &= ~(f)) : ((v) |= (f))
 
#define MBCODE_START_POS(enc)   (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)
 
#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf)   add_code_range_to_buf(pbuf, env, MBCODE_START_POS(enc), ~((OnigCodePoint )0))
 
#define ADD_ALL_MULTI_BYTE_RANGE(enc, mbuf)
 
#define BITSET_SET_BIT_CHKDUP(bs, pos)
 
#define BITSET_IS_EMPTY(bs, empty)
 
#define PEND_VALUE   0
 
#define PFETCH_READY   UChar* pfetch_prev
 
#define PEND   (p < end ? 0 : 1)
 
#define PUNFETCH   p = pfetch_prev
 
#define PINC
 
#define PFETCH(c)
 
#define PPEEK   (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
 
#define PPEEK_IS(c)   (PPEEK == (OnigCodePoint )c)
 
#define INIT_NAME_BACKREFS_ALLOC_NUM   8
 
#define NAMEBUF_SIZE   24
 
#define NAMEBUF_SIZE_1   25
 
#define INIT_SCANENV_MEMNODES_ALLOC_SIZE   16
 
#define BBUF_WRITE_CODE_POINT(bbuf, pos, code)   BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT)
 
#define INIT_MULTI_BYTE_RANGE_SIZE   (SIZE_CODE_POINT * 5)
 
#define SWAP_BBUF_NOT(bbuf1, not1, bbuf2, not2)
 
#define is_invalid_quantifier_target(node)   0
 
#define POSIX_BRACKET_CHECK_LIMIT_LENGTH   20
 
#define POSIX_BRACKET_NAME_MIN_LEN   4
 
#define NEWLINE_CODE   0x0a
 
#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS   8
 

Typedefs

typedef st_table NameTable
 
typedef st_data_t HashDataType
 
typedef struct _FreeNode FreeNode
 

Enumerations

enum  ReduceType {
  RQ_ASIS = 0, RQ_DEL = 1, RQ_A, RQ_AQ,
  RQ_QQ, RQ_P_QQ, RQ_PQ_Q
}
 
enum  TokenSyms {
  TK_EOT = 0, TK_RAW_BYTE = 1, TK_CHAR, TK_STRING,
  TK_CODE_POINT, TK_ANYCHAR, TK_CHAR_TYPE, TK_BACKREF,
  TK_CALL, TK_ANCHOR, TK_OP_REPEAT, TK_INTERVAL,
  TK_ANYCHAR_ANYTIME, TK_ALT, TK_SUBEXP_OPEN, TK_SUBEXP_CLOSE,
  TK_CC_OPEN, TK_QUOTE_OPEN, TK_CHAR_PROPERTY, TK_CC_CLOSE,
  TK_CC_RANGE, TK_POSIX_BRACKET_OPEN, TK_CC_AND, TK_CC_CC_OPEN
}
 
enum  CCSTATE { CCS_VALUE, CCS_RANGE, CCS_COMPLETE, CCS_START }
 
enum  CCVALTYPE { CCV_SB, CCV_CODE_POINT, CCV_CLASS }
 

Functions

void onig_null_warn (const char *s ARG_UNUSED)
 
void onig_set_warn_func (OnigWarnFunc f)
 
void onig_set_verb_warn_func (OnigWarnFunc f)
 
static void CC_DUP_WARN (ScanEnv *env)
 
static void bbuf_free (BBuf *bbuf)
 
static int bbuf_clone (BBuf **rto, BBuf *from)
 
static void bitset_set_range (ScanEnv *env, BitSetRef bs, int from, int to)
 
static void bitset_invert (BitSetRef bs)
 
static void bitset_invert_to (BitSetRef from, BitSetRef to)
 
static void bitset_and (BitSetRef dest, BitSetRef bs)
 
static void bitset_or (BitSetRef dest, BitSetRef bs)
 
static void bitset_copy (BitSetRef dest, BitSetRef bs)
 
int onig_strncmp (const UChar *s1, const UChar *s2, int n)
 
void onig_strcpy (UChar *dest, const UChar *src, const UChar *end)
 
static UCharstrdup_with_null (OnigEncoding enc, UChar *s, UChar *end)
 
static UCharstrcat_capa (UChar *dest, UChar *dest_end, const UChar *src, const UChar *src_end, size_t capa)
 
static UCharstrcat_capa_from_static (UChar *dest, UChar *dest_end, const UChar *src, const UChar *src_end, size_t capa)
 
static int str_end_cmp (st_data_t xp, st_data_t yp)
 
static st_index_t str_end_hash (st_data_t xp)
 
hash_table_typeonig_st_init_strend_table_with_size (st_index_t size)
 
int onig_st_lookup_strend (hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type *value)
 
int onig_st_insert_strend (hash_table_type *table, const UChar *str_key, const UChar *end_key, hash_data_type value)
 
static int i_free_name_entry (UChar *key, NameEntry *e, void *arg ARG_UNUSED)
 
static int names_clear (regex_t *reg)
 
int onig_names_free (regex_t *reg)
 
static NameEntryname_find (regex_t *reg, const UChar *name, const UChar *name_end)
 
static int i_names (UChar *key ARG_UNUSED, NameEntry *e, INamesArg *arg)
 
int onig_foreach_name (regex_t *reg, int(*func)(const UChar *, const UChar *, int, int *, regex_t *, void *), void *arg)
 
static int i_renumber_name (UChar *key ARG_UNUSED, NameEntry *e, GroupNumRemap *map)
 
int onig_renumber_name_table (regex_t *reg, GroupNumRemap *map)
 
int onig_number_of_names (regex_t *reg)
 
static int name_add (regex_t *reg, UChar *name, UChar *name_end, int backref, ScanEnv *env)
 
int onig_name_to_group_numbers (regex_t *reg, const UChar *name, const UChar *name_end, int **nums)
 
int onig_name_to_backref_number (regex_t *reg, const UChar *name, const UChar *name_end, OnigRegion *region)
 
int onig_noname_group_capture_is_active (regex_t *reg)
 
static void scan_env_clear (ScanEnv *env)
 
static int scan_env_add_mem_entry (ScanEnv *env)
 
static int scan_env_set_mem_node (ScanEnv *env, int num, Node *node)
 
void onig_node_free (Node *node)
 
int onig_free_node_list (void)
 
static Nodenode_new (void)
 
static void initialize_cclass (CClassNode *cc)
 
static Nodenode_new_cclass (void)
 
static Nodenode_new_cclass_by_codepoint_range (int not, OnigCodePoint sb_out, const OnigCodePoint ranges[])
 
static Nodenode_new_ctype (int type, int not)
 
static Nodenode_new_anychar (void)
 
static Nodenode_new_list (Node *left, Node *right)
 
Nodeonig_node_new_list (Node *left, Node *right)
 
Nodeonig_node_list_add (Node *list, Node *x)
 
Nodeonig_node_new_alt (Node *left, Node *right)
 
Nodeonig_node_new_anchor (int type)
 
static Nodenode_new_backref (int back_num, int *backrefs, int by_name, int exist_level, int nest_level, ScanEnv *env)
 
static Nodenode_new_call (UChar *name, UChar *name_end, int gnum)
 
static Nodenode_new_quantifier (int lower, int upper, int by_number)
 
static Nodenode_new_enclose (int type)
 
Nodeonig_node_new_enclose (int type)
 
static Nodenode_new_enclose_memory (OnigOptionType option, int is_named)
 
static Nodenode_new_option (OnigOptionType option)
 
int onig_node_str_cat (Node *node, const UChar *s, const UChar *end)
 
int onig_node_str_set (Node *node, const UChar *s, const UChar *end)
 
static int node_str_cat_char (Node *node, UChar c)
 
void onig_node_conv_to_str_node (Node *node, int flag)
 
void onig_node_str_clear (Node *node)
 
static Nodenode_new_str (const UChar *s, const UChar *end)
 
Nodeonig_node_new_str (const UChar *s, const UChar *end)
 
static Nodenode_new_str_raw (UChar *s, UChar *end)
 
static Nodenode_new_empty (void)
 
static Nodenode_new_str_raw_char (UChar c)
 
static Nodestr_node_split_last_char (StrNode *sn, OnigEncoding enc)
 
static int str_node_can_be_split (StrNode *sn, OnigEncoding enc)
 
int onig_scan_unsigned_number (UChar **src, const UChar *end, OnigEncoding enc)
 
static int scan_unsigned_hexadecimal_number (UChar **src, UChar *end, int maxlen, OnigEncoding enc)
 
static int scan_unsigned_octal_number (UChar **src, UChar *end, int maxlen, OnigEncoding enc)
 
static int new_code_range (BBuf **pbuf)
 
static int add_code_range_to_buf0 (BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to, int checkdup)
 
static int add_code_range_to_buf (BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to)
 
static int add_code_range0 (BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to, int checkdup)
 
static int add_code_range (BBuf **pbuf, ScanEnv *env, OnigCodePoint from, OnigCodePoint to)
 
static int not_code_range_buf (OnigEncoding enc, BBuf *bbuf, BBuf **pbuf, ScanEnv *env)
 
static int or_code_range_buf (OnigEncoding enc, BBuf *bbuf1, int not1, BBuf *bbuf2, int not2, BBuf **pbuf, ScanEnv *env)
 
static int and_code_range1 (BBuf **pbuf, ScanEnv *env, OnigCodePoint from1, OnigCodePoint to1, OnigCodePoint *data, int n)
 
static int and_code_range_buf (BBuf *bbuf1, int not1, BBuf *bbuf2, int not2, BBuf **pbuf, ScanEnv *env)
 
static int and_cclass (CClassNode *dest, CClassNode *cc, ScanEnv *env)
 
static int or_cclass (CClassNode *dest, CClassNode *cc, ScanEnv *env)
 
static void UNKNOWN_ESC_WARN (ScanEnv *env, int c)
 
static int conv_backslash_value (int c, ScanEnv *env)
 
static int popular_quantifier_num (QtfrNode *q)
 
void onig_reduce_nested_quantifier (Node *pnode, Node *cnode)
 
static int fetch_range_quantifier (UChar **src, UChar *end, OnigToken *tok, ScanEnv *env)
 
static int fetch_escaped_value (UChar **src, UChar *end, ScanEnv *env)
 
static int fetch_token (OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
 
static OnigCodePoint get_name_end_code_point (OnigCodePoint start)
 
static int fetch_name_with_level (OnigCodePoint start_code, UChar **src, UChar *end, UChar **rname_end, ScanEnv *env, int *rback_num, int *rlevel)
 
static int fetch_name (OnigCodePoint start_code, UChar **src, UChar *end, UChar **rname_end, ScanEnv *env, int *rback_num, int ref)
 
void onig_vsnprintf_with_pattern (UChar buf[], int bufsize, OnigEncoding enc, UChar *pat, UChar *pat_end, const UChar *fmt, va_list args)
 
static void onig_syntax_warn (ScanEnv *env, const char *fmt,...)
 
static void CC_ESC_WARN (ScanEnv *env, UChar *c)
 
static void CLOSE_BRACKET_WITHOUT_ESC_WARN (ScanEnv *env, UChar *c)
 
static UCharfind_str_position (OnigCodePoint s[], int n, UChar *from, UChar *to, UChar **next, OnigEncoding enc)
 
static int str_exist_check_with_esc (OnigCodePoint s[], int n, UChar *from, UChar *to, OnigCodePoint bad, OnigEncoding enc, const OnigSyntaxType *syn)
 
static int fetch_token_in_cc (OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
 
static int add_ctype_to_cc_by_range (CClassNode *cc, int ctype ARG_UNUSED, int not, ScanEnv *env, OnigCodePoint sb_out, const OnigCodePoint mbr[])
 
static int add_ctype_to_cc (CClassNode *cc, int ctype, int not, ScanEnv *env)
 
static int parse_posix_bracket (CClassNode *cc, UChar **src, UChar *end, ScanEnv *env)
 
static int fetch_char_property_to_ctype (UChar **src, UChar *end, ScanEnv *env)
 
static int parse_char_property (Node **np, OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
 
static int next_state_class (CClassNode *cc, OnigCodePoint *vs, enum CCVALTYPE *type, enum CCSTATE *state, ScanEnv *env)
 
static int next_state_val (CClassNode *cc, OnigCodePoint *vs, OnigCodePoint v, int *vs_israw, int v_israw, enum CCVALTYPE intype, enum CCVALTYPE *type, enum CCSTATE *state, ScanEnv *env)
 
static int code_exist_check (OnigCodePoint c, UChar *from, UChar *end, int ignore_escaped, ScanEnv *env)
 
static int parse_char_class (Node **np, OnigToken *tok, UChar **src, UChar *end, ScanEnv *env)
 
static int parse_subexp (Node **top, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
 
static int parse_enclose (Node **np, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
 
static int set_quantifier (Node *qnode, Node *target, int group, ScanEnv *env)
 
static int type_cclass_cmp (type_cclass_key *x, type_cclass_key *y)
 
static st_index_t type_cclass_hash (type_cclass_key *key)
 
static int i_free_shared_class (type_cclass_key *key, Node *node, void *arg ARG_UNUSED)
 
int onig_free_shared_cclass_table (void)
 
static int i_apply_case_fold (OnigCodePoint from, OnigCodePoint to[], int to_len, void *arg)
 
static int parse_exp (Node **np, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
 
static int parse_branch (Node **top, OnigToken *tok, int term, UChar **src, UChar *end, ScanEnv *env)
 
static int parse_regexp (Node **top, UChar **src, UChar *end, ScanEnv *env)
 
int onig_parse_make_tree (Node **root, const UChar *pattern, const UChar *end, regex_t *reg, ScanEnv *env)
 
void onig_scan_env_set_error_string (ScanEnv *env, int ecode ARG_UNUSED, UChar *arg, UChar *arg_end)
 

Variables

const OnigSyntaxType OnigSyntaxRuby
 
const OnigSyntaxTypeOnigDefaultSyntax = ONIG_SYNTAX_RUBY
 
static OnigWarnFunc onig_warn = onig_null_warn
 
static OnigWarnFunc onig_verb_warn = onig_null_warn
 
static FreeNodeFreeNodeList = (FreeNode* )NULL
 
static enum ReduceType const ReduceTypeTable [6][6]
 
static const char *const PopularQStr []
 
static const char *const ReduceQStr []
 
static struct st_hash_type type_type_cclass_hash
 
static st_tableOnigTypeCClassTable
 

Macro Definition Documentation

#define ADD_ALL_MULTI_BYTE_RANGE (   enc,
  mbuf 
)
Value:
do {\
}\
} while (0)
#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf)
Definition: regparse.c:135
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
VALUE enc
Definition: tcltklib.c:10402
r
Definition: bigdecimal.c:1154
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:4978
return
Definition: name2ctype.h:23857
#define ONIGENC_IS_SINGLEBYTE(enc)
Definition: oniguruma.h:220

Definition at line 138 of file regparse.c.

Referenced by add_ctype_to_cc().

#define BACKREF_REL_TO_ABS (   rel_no,
  env 
)    ((env)->num_mem + 1 + (rel_no))

Definition at line 127 of file regparse.c.

Referenced by fetch_token(), and parse_exp().

#define BBUF_WRITE_CODE_POINT (   bbuf,
  pos,
  code 
)    BBUF_WRITE(bbuf, pos, &(code), SIZE_CODE_POINT)

Definition at line 1681 of file regparse.c.

Referenced by add_code_range_to_buf0(), and new_code_range().

#define BITSET_IS_EMPTY (   bs,
  empty 
)
Value:
do {\
empty = 1;\
for (i = 0; i < (int )BITSET_SIZE; i++) {\
if ((bs)[i] != 0) {\
empty = 0; break;\
}\
}\
} while (0)
VP_EXPORT int
Definition: bigdecimal.c:4911
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
for(v/=shifter=1)
Definition: bigdecimal.c:5541
ssize_t i
Definition: bigdecimal.c:5519
#define BITSET_SIZE
Definition: regint.h:348

Definition at line 151 of file regparse.c.

Referenced by parse_char_class().

#define BITSET_SET_BIT_CHKDUP (   bs,
  pos 
)
Value:
do { \
if (BITSET_AT(bs, pos)) CC_DUP_WARN(env); \
BS_ROOM(bs, pos) |= BS_BIT(pos); \
} while (0)
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
#define BS_BIT(pos)
Definition: regint.h:366
while(a->frac[0]/shift==0)
Definition: bigdecimal.c:4978
#define BS_ROOM(bs, pos)
Definition: regint.h:365
#define BITSET_AT(bs, pos)
Definition: regint.h:368
#define env
static void CC_DUP_WARN(ScanEnv *env)
Definition: regparse.c:2892

Definition at line 146 of file regparse.c.

Referenced by add_ctype_to_cc(), add_ctype_to_cc_by_range(), bitset_set_range(), next_state_class(), next_state_val(), and parse_char_class().

#define CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS

Definition at line 35 of file regparse.c.

Referenced by i_apply_case_fold().

#define INIT_MULTI_BYTE_RANGE_SIZE   (SIZE_CODE_POINT * 5)

Referenced by new_code_range().

#define INIT_NAME_BACKREFS_ALLOC_NUM   8

Definition at line 402 of file regparse.c.

Referenced by name_add().

#define INIT_SCANENV_MEMNODES_ALLOC_SIZE   16

Definition at line 930 of file regparse.c.

Referenced by scan_env_add_mem_entry().

#define is_invalid_quantifier_target (   node)    0

Definition at line 2187 of file regparse.c.

Referenced by parse_exp().

#define MBCODE_START_POS (   enc)    (OnigCodePoint )(ONIGENC_MBC_MINLEN(enc) > 1 ? 0 : 0x80)

Definition at line 132 of file regparse.c.

Referenced by not_code_range_buf().

#define NAMEBUF_SIZE   24

Definition at line 418 of file regparse.c.

#define NAMEBUF_SIZE_1   25

Definition at line 419 of file regparse.c.

#define NEWLINE_CODE   0x0a

Referenced by parse_char_class().

#define ONOFF (   v,
  f,
  negative 
)    (negative) ? ((v) &= ~(f)) : ((v) |= (f))

Definition at line 130 of file regparse.c.

Referenced by parse_enclose().

#define PEND   (p < end ? 0 : 1)
#define PEND_VALUE   0

Definition at line 259 of file regparse.c.

#define PFETCH (   c)
Value:
do { \
c = ((enc->max_enc_len == 1) ? *p : ONIGENC_MBC_TO_CODE(enc, p, end)); \
pfetch_prev = p; \
p += enclen(enc, p, end); \
} while (0)
SYMID SyckParser * p
Definition: yaml2byte.c:119
VALUE enc
Definition: tcltklib.c:10402
#define enclen(enc, p, e)
#define ONIGENC_MBC_TO_CODE(enc, p, end)
Definition: oniguruma.h:264
VpDivd * c
Definition: bigdecimal.c:1163
gz end
Definition: zlib.c:2033

Definition at line 268 of file regparse.c.

Referenced by code_exist_check(), fetch_char_property_to_ctype(), fetch_escaped_value(), fetch_name(), fetch_name_with_level(), fetch_range_quantifier(), fetch_token(), fetch_token_in_cc(), onig_scan_unsigned_number(), parse_enclose(), parse_posix_bracket(), scan_unsigned_hexadecimal_number(), and scan_unsigned_octal_number().

#define PFETCH_READY   UChar* pfetch_prev
#define PINC
Value:
do { \
pfetch_prev = p; \
p += enclen(enc, p, end); \
} while (0)
SYMID SyckParser * p
Definition: yaml2byte.c:119
VALUE enc
Definition: tcltklib.c:10402
#define enclen(enc, p, e)
gz end
Definition: zlib.c:2033

Definition at line 264 of file regparse.c.

Referenced by fetch_token(), fetch_token_in_cc(), parse_enclose(), and parse_posix_bracket().

#define POSIX_BRACKET_CHECK_LIMIT_LENGTH   20

Referenced by parse_posix_bracket().

#define POSIX_BRACKET_NAME_MIN_LEN   4

Referenced by parse_posix_bracket().

#define PPEEK   (p < end ? ONIGENC_MBC_TO_CODE(enc, p, end) : PEND_VALUE)
#define PPEEK_IS (   c)    (PPEEK == (OnigCodePoint )c)

Definition at line 275 of file regparse.c.

Referenced by fetch_token(), fetch_token_in_cc(), parse_enclose(), and parse_posix_bracket().

#define PUNFETCH   p = pfetch_prev
#define SET_ALL_MULTI_BYTE_RANGE (   enc,
  pbuf 
)    add_code_range_to_buf(pbuf, env, MBCODE_START_POS(enc), ~((OnigCodePoint )0))

Definition at line 135 of file regparse.c.

Referenced by not_code_range_buf(), and or_code_range_buf().

#define SWAP_BBUF_NOT (   bbuf1,
  not1,
  bbuf2,
  not2 
)
Value:
do {\
BBuf *tbuf; \
int tnot; \
tnot = not1; not1 = not2; not2 = tnot; \
tbuf = bbuf1; bbuf1 = bbuf2; bbuf2 = tbuf; \
} while (0)
struct _BBuf BBuf
VP_EXPORT int
Definition: bigdecimal.c:4911

Definition at line 1848 of file regparse.c.

Referenced by and_code_range_buf(), and or_code_range_buf().

#define THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS   8

Definition at line 4954 of file regparse.c.

Referenced by parse_exp().

#define WARN_BUFSIZE   256

Definition at line 33 of file regparse.c.

Referenced by onig_syntax_warn(), and set_quantifier().

Typedef Documentation

typedef struct _FreeNode FreeNode

Definition at line 416 of file regparse.c.

Definition at line 415 of file regparse.c.

Enumeration Type Documentation

enum CCSTATE
Enumerator
CCS_VALUE 
CCS_RANGE 
CCS_COMPLETE 
CCS_START 

Definition at line 4143 of file regparse.c.

enum CCVALTYPE
Enumerator
CCV_SB 
CCV_CODE_POINT 
CCV_CLASS 

Definition at line 4150 of file regparse.c.

enum ReduceType
Enumerator
RQ_ASIS 
RQ_DEL 
RQ_A 
RQ_AQ 
RQ_QQ 
RQ_P_QQ 
RQ_PQ_Q 

Definition at line 2216 of file regparse.c.

enum TokenSyms
Enumerator
TK_EOT 
TK_RAW_BYTE 
TK_CHAR 
TK_STRING 
TK_CODE_POINT 
TK_ANYCHAR 
TK_CHAR_TYPE 
TK_BACKREF 
TK_CALL 
TK_ANCHOR 
TK_OP_REPEAT 
TK_INTERVAL 
TK_ANYCHAR_ANYTIME 
TK_ALT 
TK_SUBEXP_OPEN 
TK_SUBEXP_CLOSE 
TK_CC_OPEN 
TK_QUOTE_OPEN 
TK_CHAR_PROPERTY 
TK_CC_CLOSE 
TK_CC_RANGE 
TK_POSIX_BRACKET_OPEN 
TK_CC_AND 
TK_CC_CC_OPEN 

Definition at line 2286 of file regparse.c.

Function Documentation

static int add_code_range ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from,
OnigCodePoint  to 
)
static

Definition at line 1808 of file regparse.c.

References add_code_range0().

Referenced by next_state_class(), next_state_val(), and parse_char_class().

static int add_code_range0 ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from,
OnigCodePoint  to,
int  checkdup 
)
static
static int add_code_range_to_buf ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from,
OnigCodePoint  to 
)
static
static int add_code_range_to_buf0 ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from,
OnigCodePoint  to,
int  checkdup 
)
static
static int add_ctype_to_cc ( CClassNode cc,
int  ctype,
int  not,
ScanEnv env 
)
static
static int add_ctype_to_cc_by_range ( CClassNode cc,
int ctype  ARG_UNUSED,
int  not,
ScanEnv env,
OnigCodePoint  sb_out,
const OnigCodePoint  mbr[] 
)
static
static int and_cclass ( CClassNode dest,
CClassNode cc,
ScanEnv env 
)
static
static int and_code_range1 ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from1,
OnigCodePoint  to1,
OnigCodePoint data,
int  n 
)
static

Definition at line 1913 of file regparse.c.

References add_code_range_to_buf(), i, n, and r.

Referenced by and_code_range_buf().

static int and_code_range_buf ( BBuf bbuf1,
int  not1,
BBuf bbuf2,
int  not2,
BBuf **  pbuf,
ScanEnv env 
)
static
static int bbuf_clone ( BBuf **  rto,
BBuf from 
)
static
static void bbuf_free ( BBuf bbuf)
static

Definition at line 104 of file regparse.c.

References IS_NOT_NULL, _BBuf::p, and xfree.

Referenced by and_cclass(), onig_node_free(), or_cclass(), and parse_char_class().

static void bitset_and ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 194 of file regparse.c.

References BITSET_SIZE, i, and int.

Referenced by and_cclass().

static void bitset_copy ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 208 of file regparse.c.

References BITSET_SIZE, i, and int.

Referenced by and_cclass(), and or_cclass().

static void bitset_invert ( BitSetRef  bs)
static

Definition at line 180 of file regparse.c.

References BITSET_SIZE, i, and int.

Referenced by and_cclass(), and or_cclass().

static void bitset_invert_to ( BitSetRef  from,
BitSetRef  to 
)
static

Definition at line 187 of file regparse.c.

References BITSET_SIZE, i, and int.

Referenced by and_cclass(), and or_cclass().

static void bitset_or ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 201 of file regparse.c.

References BITSET_SIZE, i, and int.

Referenced by or_cclass().

static void bitset_set_range ( ScanEnv env,
BitSetRef  bs,
int  from,
int  to 
)
static

Definition at line 162 of file regparse.c.

References BITSET_SET_BIT_CHKDUP, i, and SINGLE_BYTE_SIZE.

Referenced by next_state_val().

static void CC_DUP_WARN ( ScanEnv env)
static
static void CC_ESC_WARN ( ScanEnv env,
UChar c 
)
static
static void CLOSE_BRACKET_WITHOUT_ESC_WARN ( ScanEnv env,
UChar c 
)
static
static int code_exist_check ( OnigCodePoint  c,
UChar from,
UChar end,
int  ignore_escaped,
ScanEnv env 
)
static

Definition at line 4255 of file regparse.c.

References code, ScanEnv::enc, MC_ESC, PEND, PFETCH, PFETCH_READY, ScanEnv::syntax, and UChar.

Referenced by parse_char_class().

static int conv_backslash_value ( int  c,
ScanEnv env 
)
static
static int fetch_char_property_to_ctype ( UChar **  src,
UChar end,
ScanEnv env 
)
static
static int fetch_escaped_value ( UChar **  src,
UChar end,
ScanEnv env 
)
static
static int fetch_name ( OnigCodePoint  start_code,
UChar **  src,
UChar end,
UChar **  rname_end,
ScanEnv env,
int rback_num,
int  ref 
)
static
static int fetch_name_with_level ( OnigCodePoint  start_code,
UChar **  src,
UChar end,
UChar **  rname_end,
ScanEnv env,
int rback_num,
int rlevel 
)
static
static int fetch_range_quantifier ( UChar **  src,
UChar end,
OnigToken tok,
ScanEnv env 
)
static
static int fetch_token ( OnigToken tok,
UChar **  src,
UChar end,
ScanEnv env 
)
static

Definition at line 3199 of file regparse.c.

References OnigToken::anchor, ANCHOR_BEGIN_BUF, ANCHOR_BEGIN_LINE, ANCHOR_BEGIN_POSITION, ANCHOR_END_BUF, ANCHOR_END_LINE, ANCHOR_NOT_WORD_BOUND, ANCHOR_SEMI_END_BUF, ANCHOR_WORD_BEGIN, ANCHOR_WORD_BOUND, ANCHOR_WORD_END, OnigToken::backp, OnigToken::backref, BACKREF_REL_TO_ABS, OnigToken::base, c, OnigToken::c, OnigToken::call, CLOSE_BRACKET_WITHOUT_ESC_WARN(), OnigToken::code, ScanEnv::enc, enclen, OnigToken::escaped, fetch_escaped_value(), fetch_name(), fetch_name_with_level(), fetch_range_quantifier(), i, IS_EXTEND, IS_MC_ESC_CODE, IS_NULL, IS_SINGLELINE, IS_SYNTAX_BV, IS_SYNTAX_OP, IS_SYNTAX_OP2, MC_ANYCHAR, MC_ANYCHAR_ANYTIME, MC_ANYTIME, MC_ESC, MC_ONE_OR_MORE_TIME, MC_ZERO_OR_ONE_TIME, NULL_UCHARP, ScanEnv::num_mem, ONIG_INEFFECTIVE_META_CHAR, ONIG_MAX_BACKREF_NUM, onig_name_to_group_numbers(), onig_scan_env_set_error_string(), onig_scan_unsigned_number(), ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE, ONIG_SYN_OP2_ESC_G_SUBEXP_CALL, ONIG_SYN_OP2_ESC_GNU_BUF_ANCHOR, ONIG_SYN_OP2_ESC_H_XDIGIT, ONIG_SYN_OP2_ESC_K_NAMED_BACKREF, ONIG_SYN_OP2_ESC_P_BRACE_CHAR_PROPERTY, ONIG_SYN_OP2_ESC_P_BRACE_CIRCUMFLEX_NOT, ONIG_SYN_OP2_ESC_U_HEX4, ONIG_SYN_OP2_PLUS_POSSESSIVE_INTERVAL, ONIG_SYN_OP2_PLUS_POSSESSIVE_REPEAT, ONIG_SYN_OP2_QMARK_GROUP_EFFECT, ONIG_SYN_OP_ASTERISK_ZERO_INF, ONIG_SYN_OP_BRACE_INTERVAL, ONIG_SYN_OP_BRACKET_CC, ONIG_SYN_OP_DECIMAL_BACKREF, ONIG_SYN_OP_DOT_ANYCHAR, ONIG_SYN_OP_ESC_ASTERISK_ZERO_INF, ONIG_SYN_OP_ESC_AZ_BUF_ANCHOR, ONIG_SYN_OP_ESC_B_WORD_BOUND, ONIG_SYN_OP_ESC_BRACE_INTERVAL, ONIG_SYN_OP_ESC_CAPITAL_G_BEGIN_ANCHOR, ONIG_SYN_OP_ESC_D_DIGIT, ONIG_SYN_OP_ESC_LPAREN_SUBEXP, ONIG_SYN_OP_ESC_LTGT_WORD_BEGIN_END, ONIG_SYN_OP_ESC_OCTAL3, ONIG_SYN_OP_ESC_PLUS_ONE_INF, ONIG_SYN_OP_ESC_QMARK_ZERO_ONE, ONIG_SYN_OP_ESC_S_WHITE_SPACE, ONIG_SYN_OP_ESC_VBAR_ALT, ONIG_SYN_OP_ESC_W_WORD, ONIG_SYN_OP_ESC_X_BRACE_HEX8, ONIG_SYN_OP_ESC_X_HEX2, ONIG_SYN_OP_LINE_ANCHOR, ONIG_SYN_OP_LPAREN_SUBEXP, ONIG_SYN_OP_PLUS_ONE_INF, ONIG_SYN_OP_QMARK_NON_GREEDY, ONIG_SYN_OP_QMARK_ZERO_ONE, ONIG_SYN_OP_VARIABLE_META_CHARACTERS, ONIG_SYN_OP_VBAR_ALT, ONIG_SYN_STRICT_CHECK_BACKREF, onig_syntax_warn(), ONIGENC_CTYPE_D, ONIGENC_CTYPE_S, ONIGENC_CTYPE_W, ONIGENC_CTYPE_XDIGIT, ONIGENC_IS_CODE_NEWLINE, ONIGENC_IS_CODE_XDIGIT, ONIGERR_END_PATTERN_AT_ESCAPE, ONIGERR_END_PATTERN_IN_GROUP, ONIGERR_INVALID_BACKREF, ONIGERR_TOO_BIG_NUMBER, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, ONIGERR_TOO_LONG_WIDE_CHAR_VALUE, ONIGERR_UNDEFINED_NAME_REFERENCE, ScanEnv::option, out, p, ScanEnv::pattern, PEND, PFETCH, PFETCH_READY, PINC, PPEEK, PPEEK_IS, OnigToken::prop, PUNFETCH, r, ScanEnv::reg, OnigToken::repeat, REPEAT_INFINITE, scan_unsigned_hexadecimal_number(), scan_unsigned_octal_number(), SCANENV_MEM_NODES, src, start, OnigToken::subtype, ScanEnv::syntax, TK_ALT, TK_ANCHOR, TK_ANYCHAR, TK_ANYCHAR_ANYTIME, TK_BACKREF, TK_CALL, TK_CC_OPEN, TK_CHAR_PROPERTY, TK_CHAR_TYPE, TK_CODE_POINT, TK_EOT, TK_INTERVAL, TK_OP_REPEAT, TK_QUOTE_OPEN, TK_RAW_BYTE, TK_STRING, TK_SUBEXP_CLOSE, TK_SUBEXP_OPEN, OnigToken::type, OnigToken::u, and UChar.

Referenced by parse_enclose(), parse_exp(), parse_regexp(), and parse_subexp().

static int fetch_token_in_cc ( OnigToken tok,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static UChar* find_str_position ( OnigCodePoint  s[],
int  n,
UChar from,
UChar to,
UChar **  next,
OnigEncoding  enc 
)
static

Definition at line 2911 of file regparse.c.

References enclen, i, IS_NOT_NULL, NULL_UCHARP, ONIGENC_MBC_TO_CODE, p, q, and UChar.

Referenced by parse_exp().

static OnigCodePoint get_name_end_code_point ( OnigCodePoint  start)
static

Definition at line 2521 of file regparse.c.

Referenced by fetch_name(), and fetch_name_with_level().

static int i_apply_case_fold ( OnigCodePoint  from,
OnigCodePoint  to[],
int  to_len,
void arg 
)
static
static int i_free_name_entry ( UChar key,
NameEntry e,
void *arg  ARG_UNUSED 
)
static

Definition at line 458 of file regparse.c.

References NameEntry::back_refs, IS_NOT_NULL, NameEntry::name, ST_DELETE, and xfree.

Referenced by names_clear().

static int i_free_shared_class ( type_cclass_key key,
Node node,
void *arg  ARG_UNUSED 
)
static

Definition at line 5002 of file regparse.c.

References IS_NOT_NULL, CClassNode::mbuf, NCCLASS, ST_DELETE, and xfree.

Referenced by onig_free_shared_cclass_table().

static int i_names ( UChar *key  ARG_UNUSED,
NameEntry e,
INamesArg arg 
)
static
static int i_renumber_name ( UChar *key  ARG_UNUSED,
NameEntry e,
GroupNumRemap map 
)
static
static void initialize_cclass ( CClassNode cc)
static

Definition at line 1137 of file regparse.c.

References BITSET_CLEAR, CClassNode::bs, CClassNode::flags, CClassNode::mbuf, and NULL.

Referenced by node_new_cclass(), and parse_char_class().

static int name_add ( regex_t reg,
UChar name,
UChar name_end,
int  backref,
ScanEnv env 
)
static
static NameEntry* name_find ( regex_t reg,
const UChar name,
const UChar name_end 
)
static
static int names_clear ( regex_t reg)
static
static int new_code_range ( BBuf **  pbuf)
static
static int next_state_class ( CClassNode cc,
OnigCodePoint vs,
enum CCVALTYPE type,
enum CCSTATE state,
ScanEnv env 
)
static
static int next_state_val ( CClassNode cc,
OnigCodePoint vs,
OnigCodePoint  v,
int vs_israw,
int  v_israw,
enum CCVALTYPE  intype,
enum CCVALTYPE type,
enum CCSTATE state,
ScanEnv env 
)
static
static Node* node_new ( void  )
static
static Node* node_new_anychar ( void  )
static

Definition at line 1219 of file regparse.c.

References CHECK_NULL_RETURN, node_new(), NT_CANY, and SET_NTYPE.

Referenced by parse_exp().

static Node* node_new_backref ( int  back_num,
int backrefs,
int  by_name,
int  exist_level,
int  nest_level,
ScanEnv env 
)
static
static Node* node_new_call ( UChar name,
UChar name_end,
int  gnum 
)
static

Definition at line 1342 of file regparse.c.

References CHECK_NULL_RETURN, name, NCALL, node_new(), NT_CALL, NULL_NODE, and SET_NTYPE.

Referenced by parse_exp().

static Node* node_new_cclass ( void  )
static
static Node* node_new_cclass_by_codepoint_range ( int  not,
OnigCodePoint  sb_out,
const OnigCodePoint  ranges[] 
)
static
static Node* node_new_ctype ( int  type,
int  not 
)
static

Definition at line 1207 of file regparse.c.

References CHECK_NULL_RETURN, NCTYPE, node_new(), NT_CTYPE, SET_NTYPE, and type.

Referenced by parse_exp().

static Node* node_new_empty ( void  )
static

Definition at line 1538 of file regparse.c.

References node_new_str(), and NULL.

Referenced by parse_exp().

static Node* node_new_enclose ( int  type)
static
static Node* node_new_enclose_memory ( OnigOptionType  option,
int  is_named 
)
static
static Node* node_new_list ( Node left,
Node right 
)
static

Definition at line 1229 of file regparse.c.

References CHECK_NULL_RETURN, NCAR, NCDR, node_new(), NT_LIST, and SET_NTYPE.

Referenced by onig_node_new_list(), parse_branch(), and parse_exp().

static Node* node_new_option ( OnigOptionType  option)
static

Definition at line 1421 of file regparse.c.

References CHECK_NULL_RETURN, ENCLOSE_OPTION, NENCLOSE, and node_new_enclose().

Referenced by parse_enclose().

static Node* node_new_quantifier ( int  lower,
int  upper,
int  by_number 
)
static

Definition at line 1358 of file regparse.c.

References CHECK_NULL_RETURN, node_new(), NQ_TARGET_ISNOT_EMPTY, NQTFR, NST_BY_NUMBER, NT_QTFR, NULL, NULL_NODE, and SET_NTYPE.

Referenced by parse_exp().

static Node* node_new_str ( const UChar s,
const UChar end 
)
static
static Node* node_new_str_raw ( UChar s,
UChar end 
)
static

Definition at line 1530 of file regparse.c.

References node_new_str(), and NSTRING_SET_RAW.

Referenced by node_new_str_raw_char(), and parse_exp().

static Node* node_new_str_raw_char ( UChar  c)
static

Definition at line 1544 of file regparse.c.

References c, node_new_str_raw(), p, and UChar.

Referenced by parse_exp().

static int node_str_cat_char ( Node node,
UChar  c 
)
static

Definition at line 1473 of file regparse.c.

References c, onig_node_str_cat(), s, and UChar.

Referenced by parse_exp().

static int not_code_range_buf ( OnigEncoding  enc,
BBuf bbuf,
BBuf **  pbuf,
ScanEnv env 
)
static
int onig_foreach_name ( regex_t reg,
int(*)(const UChar *, const UChar *, int, int *, regex_t *, void *)  func,
void arg 
)
int onig_free_node_list ( void  )

Definition at line 1099 of file regparse.c.

References FreeNodeList, IS_NOT_NULL, n, _FreeNode::next, and xfree.

Referenced by onig_end().

int onig_free_shared_cclass_table ( void  )

Definition at line 5015 of file regparse.c.

References i_free_shared_class(), IS_NOT_NULL, NULL, THREAD_ATOMIC_END, and THREAD_ATOMIC_START.

Referenced by onig_end().

int onig_name_to_backref_number ( regex_t reg,
const UChar name,
const UChar name_end,
OnigRegion region 
)
int onig_name_to_group_numbers ( regex_t reg,
const UChar name,
const UChar name_end,
int **  nums 
)
int onig_names_free ( regex_t reg)

Definition at line 479 of file regparse.c.

References if(), IS_NOT_NULL, re_pattern_buffer::name_table, names_clear(), NULL, r, and t.

Referenced by onig_free_body().

void onig_node_conv_to_str_node ( Node node,
int  flag 
)

Definition at line 1482 of file regparse.c.

References flag, NSTR, NT_STR, and SET_NTYPE.

Referenced by setup_tree().

void onig_node_free ( Node node)
Node* onig_node_list_add ( Node list,
Node x 
)
Node* onig_node_new_alt ( Node left,
Node right 
)
Node* onig_node_new_anchor ( int  type)
Node* onig_node_new_enclose ( int  type)

Definition at line 1401 of file regparse.c.

References node_new_enclose().

Referenced by next_setup().

Node* onig_node_new_list ( Node left,
Node right 
)

Definition at line 1241 of file regparse.c.

References node_new_list().

Referenced by expand_case_fold_string_alt(), and onig_node_list_add().

Node* onig_node_new_str ( const UChar s,
const UChar end 
)
int onig_node_str_cat ( Node node,
const UChar s,
const UChar end 
)
void onig_node_str_clear ( Node node)

Definition at line 1492 of file regparse.c.

References buf, IS_NOT_NULL, NSTR, s, and xfree.

Referenced by onig_node_str_set().

int onig_node_str_set ( Node node,
const UChar s,
const UChar end 
)

Definition at line 1466 of file regparse.c.

References onig_node_str_cat(), and onig_node_str_clear().

Referenced by update_string_node_case_fold().

int onig_noname_group_capture_is_active ( regex_t reg)
void onig_null_warn ( const char *s  ARG_UNUSED)
int onig_number_of_names ( regex_t reg)
int onig_parse_make_tree ( Node **  root,
const UChar pattern,
const UChar end,
regex_t reg,
ScanEnv env 
)
void onig_reduce_nested_quantifier ( Node pnode,
Node cnode 
)
int onig_renumber_name_table ( regex_t reg,
GroupNumRemap map 
)

Definition at line 565 of file regparse.c.

References i_renumber_name(), if(), IS_NOT_NULL, and re_pattern_buffer::name_table.

void onig_scan_env_set_error_string ( ScanEnv env,
int ecode  ARG_UNUSED,
UChar arg,
UChar arg_end 
)
int onig_scan_unsigned_number ( UChar **  src,
const UChar end,
OnigEncoding  enc 
)
void onig_set_verb_warn_func ( OnigWarnFunc  f)

Definition at line 96 of file regparse.c.

References onig_verb_warn.

Referenced by Init_Regexp().

void onig_set_warn_func ( OnigWarnFunc  f)

Definition at line 91 of file regparse.c.

References onig_warn.

Referenced by Init_Regexp().

hash_table_type* onig_st_init_strend_table_with_size ( st_index_t  size)

Definition at line 357 of file regparse.c.

References str_end_cmp(), and str_end_hash().

Referenced by name_add(), and onigenc_property_list_add_property().

int onig_st_insert_strend ( hash_table_type table,
const UChar str_key,
const UChar end_key,
hash_data_type  value 
)

Definition at line 381 of file regparse.c.

References st_str_end_key::end, key, result, st_str_end_key::s, UChar, xfree, and xmalloc.

Referenced by name_add(), and onigenc_property_list_add_property().

int onig_st_lookup_strend ( hash_table_type table,
const UChar str_key,
const UChar end_key,
hash_data_type value 
)

Definition at line 369 of file regparse.c.

References st_str_end_key::end, key, st_str_end_key::s, and UChar.

Referenced by name_find(), and property_name_to_ctype().

void onig_strcpy ( UChar dest,
const UChar src,
const UChar end 
)

Definition at line 227 of file regparse.c.

References len, src, UChar, and xmemcpy.

Referenced by onig_node_str_cat(), strcat_capa(), and strcat_capa_from_static().

int onig_strncmp ( const UChar s1,
const UChar s2,
int  n 
)

Definition at line 215 of file regparse.c.

static void onig_syntax_warn ( ScanEnv env,
const char *  fmt,
  ... 
)
static
void onig_vsnprintf_with_pattern ( UChar  buf[],
int  bufsize,
OnigEncoding  enc,
UChar pat,
UChar pat_end,
const UChar fmt,
va_list  args 
)
static int or_cclass ( CClassNode dest,
CClassNode cc,
ScanEnv env 
)
static
static int or_code_range_buf ( OnigEncoding  enc,
BBuf bbuf1,
int  not1,
BBuf bbuf2,
int  not2,
BBuf **  pbuf,
ScanEnv env 
)
static
static int parse_branch ( Node **  top,
OnigToken tok,
int  term,
UChar **  src,
UChar end,
ScanEnv env 
)
static

Definition at line 5550 of file regparse.c.

References IS_NOT_NULL, NCDR, node_new_list(), NT_LIST, NTYPE, NULL, onig_node_free(), parse_exp(), r, TK_ALT, and TK_EOT.

Referenced by parse_subexp().

static int parse_char_class ( Node **  np,
OnigToken tok,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static int parse_char_property ( Node **  np,
OnigToken tok,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static int parse_enclose ( Node **  np,
OnigToken tok,
int  term,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static int parse_exp ( Node **  np,
OnigToken tok,
int  term,
UChar **  src,
UChar end,
ScanEnv env 
)
static

Definition at line 5144 of file regparse.c.

References add_ctype_to_cc(), IApplyCaseFoldArg::alt_root, OnigToken::anchor, OnigToken::backp, OnigToken::backref, BACKREF_REL_TO_ABS, OnigToken::c, OnigToken::call, ScanEnv::case_fold_flag, IApplyCaseFoldArg::cc, CHECK_NULL_RETURN_MEMERR, OnigToken::code, ScanEnv::enc, type_cclass_key::enc, enclen, ENCLOSE_STOP_BACKTRACK, end, env, IApplyCaseFoldArg::env, OnigToken::escaped, fetch_token(), find_str_position(), i_apply_case_fold(), IS_IGNORECASE, is_invalid_quantifier_target, IS_NOT_NULL, IS_NULL, IS_SYNTAX_BV, key, len, MC_ESC, NCAR, NCCLASS, NCCLASS_SET_NOT, NCCLASS_SET_SHARE, NCDR, NENCLOSE, node_new_anychar(), node_new_backref(), node_new_call(), node_new_cclass(), node_new_cclass_by_codepoint_range(), node_new_ctype(), node_new_empty(), node_new_enclose(), node_new_list(), node_new_quantifier(), node_new_str(), node_new_str_raw(), node_new_str_raw_char(), node_str_cat_char(), type_cclass_key::not, NQTFR, NSTR, NSTRING_CLEAR_RAW, NULL, NULL_NODE, onig_node_free(), onig_node_new_alt(), onig_node_new_anchor(), onig_node_str_cat(), ONIG_SYN_ALLOW_UNMATCHED_CLOSE_SUBEXP, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS, ONIGENC_APPLY_ALL_CASE_FOLD, ONIGENC_CODE_RANGE_NUM, ONIGENC_CODE_TO_MBC, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGENC_CTYPE_D, ONIGENC_CTYPE_DIGIT, ONIGENC_CTYPE_S, ONIGENC_CTYPE_SPACE, ONIGENC_CTYPE_W, ONIGENC_CTYPE_WORD, ONIGENC_CTYPE_XDIGIT, ONIGENC_GET_CTYPE_CODE_RANGE, ONIGENC_MBC_MINLEN, ONIGERR_INVALID_BACKREF, ONIGERR_MEMORY, ONIGERR_PARSER_BUG, ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID, ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED, ONIGERR_TOO_SHORT_MULTI_BYTE_STRING, ONIGERR_UNMATCHED_CLOSE_PARENTHESIS, ScanEnv::option, parse_char_class(), parse_char_property(), parse_enclose(), parse_subexp(), OnigToken::prop, IApplyCaseFoldArg::ptail, r, OnigToken::repeat, REPEAT_INFINITE, set_quantifier(), src, ScanEnv::syntax, target, THREAD_ATOMIC_END, THREAD_ATOMIC_START, THRESHOLD_RANGE_NUM_FOR_SHARE_CCLASS, TK_ALT, TK_ANCHOR, TK_ANYCHAR, TK_ANYCHAR_ANYTIME, TK_BACKREF, TK_CALL, TK_CC_OPEN, TK_CHAR_PROPERTY, TK_CHAR_TYPE, TK_CODE_POINT, TK_EOT, TK_INTERVAL, TK_OP_REPEAT, TK_QUOTE_OPEN, TK_RAW_BYTE, TK_STRING, TK_SUBEXP_CLOSE, TK_SUBEXP_OPEN, OnigToken::type, type_cclass_key::type, OnigToken::u, UChar, USE_BACKREF_WITH_LEVEL, void, xmalloc, and xmemcpy.

Referenced by parse_branch().

static int parse_posix_bracket ( CClassNode cc,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static int parse_regexp ( Node **  top,
UChar **  src,
UChar end,
ScanEnv env 
)
static

Definition at line 5641 of file regparse.c.

References fetch_token(), parse_subexp(), r, TK_EOT, and tok.

Referenced by onig_parse_make_tree().

static int parse_subexp ( Node **  top,
OnigToken tok,
int  term,
UChar **  src,
UChar end,
ScanEnv env 
)
static
static int popular_quantifier_num ( QtfrNode q)
static
static int scan_env_add_mem_entry ( ScanEnv env)
static
static void scan_env_clear ( ScanEnv env)
static
static int scan_env_set_mem_node ( ScanEnv env,
int  num,
Node node 
)
static

Definition at line 997 of file regparse.c.

References ScanEnv::num_mem, ONIGERR_PARSER_BUG, and SCANENV_MEM_NODES.

Referenced by parse_enclose().

static int scan_unsigned_hexadecimal_number ( UChar **  src,
UChar end,
int  maxlen,
OnigEncoding  enc 
)
static

Definition at line 1625 of file regparse.c.

References c, int, INT_MAX_LIMIT, ONIGENC_IS_CODE_XDIGIT, p, PEND, PFETCH, PFETCH_READY, PUNFETCH, src, UChar, val, and XDIGITVAL.

Referenced by fetch_token(), and fetch_token_in_cc().

static int scan_unsigned_octal_number ( UChar **  src,
UChar end,
int  maxlen,
OnigEncoding  enc 
)
static

Definition at line 1653 of file regparse.c.

References c, INT_MAX_LIMIT, ODIGITVAL, ONIGENC_IS_CODE_DIGIT, p, PEND, PFETCH, PFETCH_READY, PUNFETCH, src, UChar, and val.

Referenced by fetch_token(), and fetch_token_in_cc().

static int set_quantifier ( Node qnode,
Node target,
int  group,
ScanEnv env 
)
static
static int str_end_cmp ( st_data_t  xp,
st_data_t  yp 
)
static

Definition at line 318 of file regparse.c.

References c, st_str_end_key::end, end, int, p, q, st_str_end_key::s, and UChar.

Referenced by onig_st_init_strend_table_with_size().

static st_index_t str_end_hash ( st_data_t  xp)
static

Definition at line 342 of file regparse.c.

References end, int, p, st_str_end_key::s, UChar, and val.

Referenced by onig_st_init_strend_table_with_size().

static int str_exist_check_with_esc ( OnigCodePoint  s[],
int  n,
UChar from,
UChar to,
OnigCodePoint  bad,
OnigEncoding  enc,
const OnigSyntaxType syn 
)
static

Definition at line 2940 of file regparse.c.

References enclen, i, MC_ESC, ONIGENC_MBC_TO_CODE, q, and UChar.

Referenced by fetch_token_in_cc().

static int str_node_can_be_split ( StrNode sn,
OnigEncoding  enc 
)
static

Definition at line 1571 of file regparse.c.

References enclen, StrNode::end, and StrNode::s.

Referenced by set_quantifier().

static Node* str_node_split_last_char ( StrNode sn,
OnigEncoding  enc 
)
static
static UChar* strcat_capa ( UChar dest,
UChar dest_end,
const UChar src,
const UChar src_end,
size_t  capa 
)
static

Definition at line 278 of file regparse.c.

References CHECK_NULL_RETURN, onig_strcpy(), r, UChar, xmalloc, and xrealloc.

Referenced by onig_node_str_cat().

static UChar* strcat_capa_from_static ( UChar dest,
UChar dest_end,
const UChar src,
const UChar src_end,
size_t  capa 
)
static

Definition at line 295 of file regparse.c.

References CHECK_NULL_RETURN, onig_strcpy(), r, UChar, and xmalloc.

Referenced by onig_node_str_cat().

static UChar* strdup_with_null ( OnigEncoding  enc,
UChar s,
UChar end 
)
static

Definition at line 238 of file regparse.c.

References CHECK_NULL_RETURN, i, ONIGENC_MBC_MINLEN, r, s, UChar, xmalloc, and xmemcpy.

Referenced by name_add().

static int type_cclass_cmp ( type_cclass_key x,
type_cclass_key y 
)
static

Definition at line 4964 of file regparse.c.

References type_cclass_key::enc, type_cclass_key::not, and type_cclass_key::type.

static st_index_t type_cclass_hash ( type_cclass_key key)
static

Definition at line 4972 of file regparse.c.

References type_cclass_key::enc, i, int, type_cclass_key::not, p, type_cclass_key::type, UChar, and val.

static void UNKNOWN_ESC_WARN ( ScanEnv env,
int  c 
)
static

Definition at line 2904 of file regparse.c.

References onig_null_warn(), onig_syntax_warn(), onig_warn, return, RTEST, and ruby_verbose.

Referenced by conv_backslash_value().

Variable Documentation

FreeNode* FreeNodeList = (FreeNode* )NULL
static

Definition at line 1012 of file regparse.c.

Referenced by onig_free_node_list(), and onig_node_free().

OnigWarnFunc onig_verb_warn = onig_null_warn
static

Definition at line 88 of file regparse.c.

Referenced by onig_set_verb_warn_func(), and set_quantifier().

OnigWarnFunc onig_warn = onig_null_warn
static
const OnigSyntaxType* OnigDefaultSyntax = ONIG_SYNTAX_RUBY

Definition at line 75 of file regparse.c.

const OnigSyntaxType OnigSyntaxRuby

Definition at line 38 of file regparse.c.

st_table* OnigTypeCClassTable
static

Definition at line 4998 of file regparse.c.

const char* const PopularQStr[]
static
Initial value:
= {
"?", "*", "+", "??", "*?", "+?"
}

Definition at line 4853 of file regparse.c.

const char* const ReduceQStr[]
static
Initial value:
= {
"", "", "*", "*?", "??", "+ and ??", "+? and ?"
}

Definition at line 4857 of file regparse.c.

enum ReduceType const ReduceTypeTable[6][6]
static
Initial value:

Definition at line 2226 of file regparse.c.

struct st_hash_type type_type_cclass_hash
static
Initial value:
= {
}
static st_index_t type_cclass_hash(type_cclass_key *key)
Definition: regparse.c:4972
static int type_cclass_cmp(type_cclass_key *x, type_cclass_key *y)
Definition: regparse.c:4964

Definition at line 4993 of file regparse.c.