Ruby  2.0.0p451(2014-02-24revision45167)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
regparse.c File Reference
#include "regparse.h"
#include "ruby/st.h"
Include dependency graph for regparse.c:

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), ONIG_LAST_CODE_POINT)
 
#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 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_LINEBREAK,
  TK_EXTENDED_GRAPHEME_CLUSTER, TK_KEEP, 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, int ascii_range)
 
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)
 
static int node_str_cat_codepoint (Node *node, OnigEncoding enc, OnigCodePoint 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 minlen, 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 fetch_named_backref_token (OnigCodePoint c, 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, int char_prop, 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 node_linebreak (Node **np, ScanEnv *env)
 
static int node_extended_grapheme_cluster (Node **np, ScanEnv *env)
 
static int countbits (unsigned int bits)
 
static int is_onechar_cclass (CClassNode *cc, OnigCodePoint *code)
 
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 const struct st_hash_type type_type_cclass_hash
 
static st_tableOnigTypeCClassTable
 

Macro Definition Documentation

#define ADD_ALL_MULTI_BYTE_RANGE (   enc,
  mbuf 
)
Value:
do {\
r = SET_ALL_MULTI_BYTE_RANGE(enc, &(mbuf));\
if (r) return r;\
}\
} while (0)
#define SET_ALL_MULTI_BYTE_RANGE(enc, pbuf)
Definition: regparse.c:140
return
Definition: ripper.y:7641
#define ONIGENC_IS_SINGLEBYTE(enc)
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 143 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 132 of file regparse.c.

Referenced by fetch_named_backref_token(), parse_enclose(), and parse_exp().

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

Definition at line 1708 of file regparse.c.

Referenced by add_code_range_to_buf0(), and new_code_range().

#define BITSET_IS_EMPTY (   bs,
  empty 
)
Value:
do {\
int i;\
empty = 1;\
for (i = 0; i < BITSET_SIZE; i++) {\
if ((bs)[i] != 0) {\
empty = 0; break;\
}\
}\
} while (0)
for(i=0;i< args;i++)
Definition: win32ole.c:788
int i
Definition: win32ole.c:784
if(c== ')') lex_state
Definition: ripper.y:7588
#define BITSET_SIZE
Definition: regint.h:394

Definition at line 156 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)
#define BS_BIT(pos)
Definition: regint.h:412
#define BS_ROOM(bs, pos)
Definition: regint.h:411
#define BITSET_AT(bs, pos)
Definition: regint.h:414
#define env
static void CC_DUP_WARN(ScanEnv *env)
Definition: regparse.c:2931
if(c== ')') lex_state
Definition: ripper.y:7588

Definition at line 151 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 412 of file regparse.c.

Referenced by name_add().

#define INIT_SCANENV_MEMNODES_ALLOC_SIZE   16

Definition at line 941 of file regparse.c.

Referenced by scan_env_add_mem_entry().

#define is_invalid_quantifier_target (   node)    0

Definition at line 2186 of file regparse.c.

Referenced by parse_exp().

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

Definition at line 137 of file regparse.c.

Referenced by not_code_range_buf().

#define NEWLINE_CODE   0x0a

Referenced by parse_char_class().

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

Definition at line 135 of file regparse.c.

Referenced by node_extended_grapheme_cluster(), and parse_enclose().

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

Definition at line 264 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)
Win32OLEIDispatch * p
Definition: win32ole.c:786
#define enclen(enc, p, e)
return c
Definition: ripper.y:7591
#define ONIGENC_MBC_TO_CODE(enc, p, end)

Definition at line 278 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)
Win32OLEIDispatch * p
Definition: win32ole.c:786
#define enclen(enc, p, e)

Definition at line 274 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 285 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), ONIG_LAST_CODE_POINT)

Definition at line 140 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

Definition at line 1879 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 5353 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 426 of file regparse.c.

Definition at line 425 of file regparse.c.

Enumeration Type Documentation

enum CCSTATE
Enumerator
CCS_VALUE 
CCS_RANGE 
CCS_COMPLETE 
CCS_START 

Definition at line 4367 of file regparse.c.

enum CCVALTYPE
Enumerator
CCV_SB 
CCV_CODE_POINT 
CCV_CLASS 

Definition at line 4374 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 2247 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_LINEBREAK 
TK_EXTENDED_GRAPHEME_CLUSTER 
TK_KEEP 
TK_CC_CLOSE 
TK_CC_RANGE 
TK_POSIX_BRACKET_OPEN 
TK_CC_AND 
TK_CC_CC_OPEN 

Definition at line 2317 of file regparse.c.

Function Documentation

static int add_code_range ( BBuf **  pbuf,
ScanEnv env,
OnigCodePoint  from,
OnigCodePoint  to 
)
static
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,
int  char_prop,
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 1944 of file regparse.c.

References add_code_range_to_buf(), and i.

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 109 of file regparse.c.

References IS_NOT_NULL, _BBuf::p, and xfree.

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

static void bitset_and ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 199 of file regparse.c.

References BITSET_SIZE, and i.

Referenced by and_cclass().

static void bitset_copy ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 213 of file regparse.c.

References BITSET_SIZE, and i.

Referenced by and_cclass(), and or_cclass().

static void bitset_invert ( BitSetRef  bs)
static

Definition at line 185 of file regparse.c.

References BITSET_SIZE, and i.

Referenced by and_cclass(), and or_cclass().

static void bitset_invert_to ( BitSetRef  from,
BitSetRef  to 
)
static

Definition at line 192 of file regparse.c.

References BITSET_SIZE, and i.

Referenced by and_cclass(), and or_cclass().

static void bitset_or ( BitSetRef  dest,
BitSetRef  bs 
)
static

Definition at line 206 of file regparse.c.

References BITSET_SIZE, and i.

Referenced by or_cclass().

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

Definition at line 167 of file regparse.c.

References BITSET_SET_BIT_CHKDUP, i, and SINGLE_BYTE_SIZE.

Referenced by add_ctype_to_cc(), next_state_val(), and node_linebreak().

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 4479 of file regparse.c.

References 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 countbits ( unsigned int  bits)
static

Definition at line 5684 of file regparse.c.

Referenced by is_onechar_cclass().

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_named_backref_token ( OnigCodePoint  c,
OnigToken tok,
UChar **  src,
UChar end,
ScanEnv env 
)
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 3314 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, OnigToken::base, OnigToken::c, c, OnigToken::call, CLOSE_BRACKET_WITHOUT_ESC_WARN(), OnigToken::code, ScanEnv::enc, enclen, OnigToken::escaped, fetch_escaped_value(), fetch_name(), fetch_named_backref_token(), fetch_range_quantifier(), get_name_end_code_point(), IS_ASCII_RANGE, IS_EXTEND, IS_MC_ESC_CODE, IS_NULL, IS_SINGLELINE, IS_SYNTAX_BV, IS_SYNTAX_OP, IS_SYNTAX_OP2, IS_WORD_BOUND_ALL_RANGE, MC_ANYCHAR, MC_ANYCHAR_ANYTIME, MC_ANYTIME, MC_ESC, MC_ONE_OR_MORE_TIME, MC_ZERO_OR_ONE_TIME, name, ScanEnv::num_mem, ONIG_INEFFECTIVE_META_CHAR, ONIG_MAX_BACKREF_NUM, onig_scan_unsigned_number(), ONIG_SYN_FIXED_INTERVAL_IS_GREEDY_ONLY, ONIG_SYN_OP2_ESC_CAPITAL_K_KEEP, ONIG_SYN_OP2_ESC_CAPITAL_Q_QUOTE, ONIG_SYN_OP2_ESC_CAPITAL_R_LINEBREAK, ONIG_SYN_OP2_ESC_CAPITAL_X_EXTENDED_GRAPHEME_CLUSTER, ONIG_SYN_OP2_ESC_G_BRACE_BACKREF, 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_CAPITAL_P_NAMED_GROUP, ONIG_SYN_OP2_QMARK_GROUP_EFFECT, ONIG_SYN_OP2_QMARK_SUBEXP_CALL, 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_DIGIT, ONIGENC_CTYPE_SPACE, ONIGENC_CTYPE_WORD, ONIGENC_CTYPE_XDIGIT, ONIGENC_IS_CODE_DIGIT, ONIGENC_IS_CODE_NEWLINE, ONIGENC_IS_CODE_XDIGIT, ONIGERR_END_PATTERN_AT_ESCAPE, ONIGERR_END_PATTERN_IN_GROUP, ONIGERR_INVALID_BACKREF, ONIGERR_INVALID_GROUP_NAME, ONIGERR_TOO_BIG_NUMBER, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, ONIGERR_TOO_LONG_WIDE_CHAR_VALUE, ONIGERR_TOO_SHORT_DIGITS, ScanEnv::option, p, ScanEnv::pattern, PEND, PFETCH, PFETCH_READY, PINC, PPEEK, PPEEK_IS, OnigToken::prop, PUNFETCH, OnigToken::repeat, REPEAT_INFINITE, scan_unsigned_hexadecimal_number(), scan_unsigned_octal_number(), SCANENV_MEM_NODES, 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_EXTENDED_GRAPHEME_CLUSTER, TK_INTERVAL, TK_KEEP, TK_LINEBREAK, 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 2950 of file regparse.c.

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

Referenced by parse_exp().

static OnigCodePoint get_name_end_code_point ( OnigCodePoint  start)
static

Definition at line 2558 of file regparse.c.

Referenced by fetch_name(), fetch_name_with_level(), and fetch_token().

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 465 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 5401 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
static int is_onechar_cclass ( CClassNode cc,
OnigCodePoint code 
)
static
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 int node_extended_grapheme_cluster ( Node **  np,
ScanEnv env 
)
static
static int node_linebreak ( Node **  np,
ScanEnv env 
)
static
static Node* node_new ( void  )
static
static Node* node_new_anychar ( void  )
static

Definition at line 1231 of file regparse.c.

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

Referenced by node_extended_grapheme_cluster(), and 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 1355 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,
int  ascii_range 
)
static

Definition at line 1218 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 1561 of file regparse.c.

References node_new_str(), and NULL.

Referenced by parse_enclose(), and 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
static Node* node_new_option ( OnigOptionType  option)
static
static Node* node_new_quantifier ( int  lower,
int  upper,
int  by_number 
)
static
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 1552 of file regparse.c.

References IS_NOT_NULL, node_new_str(), and NSTRING_SET_RAW.

Referenced by node_linebreak(), and node_new_str_raw_char().

static Node* node_new_str_raw_char ( UChar  c)
static

Definition at line 1567 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 1486 of file regparse.c.

References c, onig_node_str_cat(), and UChar.

Referenced by parse_exp().

static int node_str_cat_codepoint ( Node node,
OnigEncoding  enc,
OnigCodePoint  c 
)
static

Definition at line 1495 of file regparse.c.

References buf, onig_node_str_cat(), ONIGENC_CODE_TO_MBC, ONIGENC_CODE_TO_MBC_MAXLEN, 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 1110 of file regparse.c.

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

Referenced by onig_end().

int onig_free_shared_cclass_table ( void  )
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 486 of file regparse.c.

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

Referenced by onig_free_body().

void onig_node_conv_to_str_node ( Node node,
int  flag 
)

Definition at line 1504 of file regparse.c.

References NSTR, NT_STR, and SET_NTYPE.

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 1414 of file regparse.c.

References node_new_enclose().

Referenced by next_setup().

Node* onig_node_new_list ( Node left,
Node right 
)

Definition at line 1253 of file regparse.c.

References node_new_list().

Referenced by expand_case_fold_string_alt(), next_setup(), onig_node_list_add(), and setup_tree().

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 1514 of file regparse.c.

References buf, IS_NOT_NULL, NSTR, and xfree.

Referenced by onig_node_str_set().

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

Definition at line 1479 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 
)
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 101 of file regparse.c.

References f, and onig_verb_warn.

Referenced by Init_Regexp().

void onig_set_warn_func ( OnigWarnFunc  f)

Definition at line 96 of file regparse.c.

References f, and onig_warn.

Referenced by Init_Regexp().

hash_table_type* onig_st_init_strend_table_with_size ( st_index_t  size)
int onig_st_insert_strend ( hash_table_type table,
const UChar str_key,
const UChar end_key,
hash_data_type  value 
)
int onig_st_lookup_strend ( hash_table_type table,
const UChar str_key,
const UChar end_key,
hash_data_type value 
)

Definition at line 379 of file regparse.c.

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

Referenced by name_find().

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

Definition at line 232 of file regparse.c.

References 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 220 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 6177 of file regparse.c.

References IS_NOT_NULL, NCDR, node_new_list(), NT_LIST, NTYPE, NULL, onig_node_free(), parse_exp(), 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

Definition at line 4833 of file regparse.c.

References ANCHOR_LOOK_BEHIND, ANCHOR_LOOK_BEHIND_NOT, ANCHOR_PREC_READ, ANCHOR_PREC_READ_NOT, BACKREF_REL_TO_ABS, BIT_STATUS_BITS_NUM, BIT_STATUS_ON_AT_SIMPLE, c, ScanEnv::capture_history, CHECK_NULL_RETURN_MEMERR, ScanEnv::enc, ENCLOSE_CONDITION, ENCLOSE_MEMORY, ENCLOSE_STOP_BACKTRACK, err, fetch_name(), fetch_token(), i, if(), IS_NOT_NULL, IS_NULL, IS_SYNTAX_BV, IS_SYNTAX_OP2, name, name_add(), NANCHOR, neg, NENCLOSE, node_new_empty(), node_new_enclose(), node_new_enclose_memory(), node_new_option(), NST_NAME_REF, NT_ALT, NT_ANCHOR, NTYPE, NULL, NULL_NODE, ScanEnv::num_mem, ScanEnv::num_named, ONIG_IS_OPTION_ON, onig_name_to_group_numbers(), onig_node_free(), onig_node_new_alt(), onig_node_new_anchor(), ONIG_OPTION_ASCII_RANGE, ONIG_OPTION_DONT_CAPTURE_GROUP, ONIG_OPTION_EXTEND, ONIG_OPTION_IGNORECASE, ONIG_OPTION_MULTILINE, ONIG_OPTION_POSIX_BRACKET_ALL_RANGE, ONIG_OPTION_SINGLELINE, ONIG_OPTION_WORD_BOUND_ALL_RANGE, onig_scan_env_set_error_string(), ONIG_SYN_OP2_ATMARK_CAPTURE_HISTORY, ONIG_SYN_OP2_OPTION_PERL, ONIG_SYN_OP2_OPTION_RUBY, ONIG_SYN_OP2_QMARK_CAPITAL_P_NAMED_GROUP, ONIG_SYN_OP2_QMARK_GROUP_EFFECT, ONIG_SYN_OP2_QMARK_LPAREN_CONDITION, ONIG_SYN_OP2_QMARK_LT_NAMED_GROUP, ONIG_SYN_OP2_QMARK_VBAR_BRANCH_RESET, ONIG_SYN_STRICT_CHECK_BACKREF, ONIGENC_IS_CODE_DIGIT, ONIGERR_END_PATTERN_IN_GROUP, ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS, ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY, ONIGERR_INVALID_BACKREF, ONIGERR_INVALID_CONDITION_PATTERN, ONIGERR_UNDEFINED_GROUP_OPTION, ONIGERR_UNDEFINED_NAME_REFERENCE, ONOFF, ScanEnv::option, p, parse_subexp(), PEND, PFETCH, PFETCH_READY, PINC, PPEEK_IS, PUNFETCH, ScanEnv::reg, scan_env_add_mem_entry(), scan_env_set_mem_node(), SCANENV_MEM_NODES, ScanEnv::syntax, and UChar.

Referenced by parse_exp().

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

Definition at line 5744 of file regparse.c.

References add_ctype_to_cc(), IApplyCaseFoldArg::alt_root, OnigToken::anchor, ANCHOR_KEEP, 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, env, IApplyCaseFoldArg::env, OnigToken::escaped, fetch_token(), find_str_position(), i_apply_case_fold(), if(), IS_ASCII_RANGE, IS_IGNORECASE, is_invalid_quantifier_target, IS_NOT_NULL, IS_NULL, is_onechar_cclass(), IS_SYNTAX_BV, key, MC_ESC, NANCHOR, NCAR, NCCLASS, NCCLASS_SET_NOT, NCCLASS_SET_SHARE, NCDR, NENCLOSE, node_extended_grapheme_cluster(), node_linebreak(), 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_char(), node_str_cat_char(), node_str_cat_codepoint(), type_cclass_key::not, NQTFR, NSTR, NSTRING_CLEAR_RAW, NSTRING_SET_RAW, NULL, NULL_NODE, onig_node_free(), onig_node_new_alt(), onig_node_new_anchor(), onig_node_str_cat(), onig_st_add_direct, onig_st_init_table_with_size, onig_st_lookup, 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_CTYPE_DIGIT, ONIGENC_CTYPE_SPACE, 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, OnigToken::repeat, REPEAT_INFINITE, set_quantifier(), ScanEnv::syntax, 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_EXTENDED_GRAPHEME_CLUSTER, TK_INTERVAL, TK_KEEP, TK_LINEBREAK, 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, 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
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 1008 of file regparse.c.

References ScanEnv::num_mem, ONIGERR_PARSER_BUG, and SCANENV_MEM_NODES.

Referenced by parse_enclose(), and parse_regexp().

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

Definition at line 1648 of file regparse.c.

References c, INT_MAX_LIMIT, ONIGENC_IS_CODE_XDIGIT, p, PEND, PFETCH, PFETCH_READY, PUNFETCH, 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 1680 of file regparse.c.

References c, INT_MAX_LIMIT, ODIGITVAL, ONIGENC_IS_CODE_DIGIT, p, PEND, PFETCH, PFETCH_READY, PUNFETCH, 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 328 of file regparse.c.

References c, st_str_end_key::end, p, 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 352 of file regparse.c.

References 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 2979 of file regparse.c.

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

Referenced by fetch_token_in_cc().

static int str_node_can_be_split ( StrNode sn,
OnigEncoding  enc 
)
static

Definition at line 1594 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 288 of file regparse.c.

References CHECK_NULL_RETURN, onig_strcpy(), 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 305 of file regparse.c.

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

Referenced by onig_node_str_cat().

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

Definition at line 243 of file regparse.c.

References CHECK_NULL_RETURN, i, ONIGENC_MBC_MINLEN, 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 5363 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 5371 of file regparse.c.

References type_cclass_key::enc, i, 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 2943 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 1023 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 93 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 80 of file regparse.c.

const OnigSyntaxType OnigSyntaxRuby

Definition at line 38 of file regparse.c.

st_table* OnigTypeCClassTable
static

Definition at line 5397 of file regparse.c.

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

Definition at line 5252 of file regparse.c.

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

Definition at line 5256 of file regparse.c.

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

Definition at line 2257 of file regparse.c.

const 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:5371
static int type_cclass_cmp(type_cclass_key *x, type_cclass_key *y)
Definition: regparse.c:5363

Definition at line 5392 of file regparse.c.