Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions
regparse.h File Reference
#include "regint.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StrNode
struct  QuantifierNode
struct  EffectNode
struct  UnsetAddr
struct  UnsetAddrList
struct  CallNode
struct  BackrefNode
struct  AnchorNode
struct  _Node
struct  ScanEnv
struct  GroupNumRemap
union  _Node.u
struct  _Node.u.cons
struct  _Node.u.ctype

Defines

#define N_STRING   (1<< 0)
#define N_CCLASS   (1<< 1)
#define N_CTYPE   (1<< 2)
#define N_ANYCHAR   (1<< 3)
#define N_BACKREF   (1<< 4)
#define N_QUANTIFIER   (1<< 5)
#define N_EFFECT   (1<< 6)
#define N_ANCHOR   (1<< 7)
#define N_LIST   (1<< 8)
#define N_ALT   (1<< 9)
#define N_CALL   (1<<10)
#define IS_NODE_TYPE_SIMPLE(type)   (((type) & (N_STRING | N_CCLASS | N_CTYPE | N_ANYCHAR | N_BACKREF)) != 0)
#define NTYPE(node)   ((node)->type)
#define NCONS(node)   ((node)->u.cons)
#define NSTRING(node)   ((node)->u.str)
#define NCCLASS(node)   ((node)->u.cclass)
#define NCTYPE(node)   ((node)->u.ctype)
#define NQUANTIFIER(node)   ((node)->u.quantifier)
#define NANCHOR(node)   ((node)->u.anchor)
#define NBACKREF(node)   ((node)->u.backref)
#define NEFFECT(node)   ((node)->u.effect)
#define NCALL(node)   ((node)->u.call)
#define CTYPE_WORD   (1<<0)
#define CTYPE_NOT_WORD   (1<<1)
#define CTYPE_WHITE_SPACE   (1<<2)
#define CTYPE_NOT_WHITE_SPACE   (1<<3)
#define CTYPE_DIGIT   (1<<4)
#define CTYPE_NOT_DIGIT   (1<<5)
#define CTYPE_XDIGIT   (1<<6)
#define CTYPE_NOT_XDIGIT   (1<<7)
#define ANCHOR_ANYCHAR_STAR_MASK   (ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML)
#define ANCHOR_END_BUF_MASK   (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF)
#define EFFECT_MEMORY   (1<<0)
#define EFFECT_OPTION   (1<<1)
#define EFFECT_STOP_BACKTRACK   (1<<2)
#define NODE_STR_MARGIN   16
#define NODE_STR_BUF_SIZE   24 /* sizeof(CClassNode) - sizeof(int)*4 */
#define NODE_BACKREFS_SIZE   6
#define NSTR_RAW   (1<<0) /* by backslashed number */
#define NSTR_AMBIG   (1<<1)
#define NSTR_AMBIG_REDUCE   (1<<2)
#define NSTRING_LEN(node)   ((node)->u.str.end - (node)->u.str.s)
#define NSTRING_SET_RAW(node)   (node)->u.str.flag |= NSTR_RAW
#define NSTRING_CLEAR_RAW(node)   (node)->u.str.flag &= ~NSTR_RAW
#define NSTRING_SET_AMBIG(node)   (node)->u.str.flag |= NSTR_AMBIG
#define NSTRING_SET_AMBIG_REDUCE(node)   (node)->u.str.flag |= NSTR_AMBIG_REDUCE
#define NSTRING_IS_RAW(node)   (((node)->u.str.flag & NSTR_RAW) != 0)
#define NSTRING_IS_AMBIG(node)   (((node)->u.str.flag & NSTR_AMBIG) != 0)
#define NSTRING_IS_AMBIG_REDUCE(node)   (((node)->u.str.flag & NSTR_AMBIG_REDUCE) != 0)
#define BACKREFS_P(br)   (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static);
#define NQ_TARGET_ISNOT_EMPTY   0
#define NQ_TARGET_IS_EMPTY   1
#define NQ_TARGET_IS_EMPTY_MEM   2
#define NQ_TARGET_IS_EMPTY_REC   3
#define NST_MIN_FIXED   (1<<0)
#define NST_MAX_FIXED   (1<<1)
#define NST_CLEN_FIXED   (1<<2)
#define NST_MARK1   (1<<3)
#define NST_MARK2   (1<<4)
#define NST_MEM_BACKREFED   (1<<5)
#define NST_STOP_BT_SIMPLE_REPEAT   (1<<6)
#define NST_RECURSION   (1<<7)
#define NST_CALLED   (1<<8)
#define NST_ADDR_FIXED   (1<<9)
#define NST_NAMED_GROUP   (1<<10)
#define NST_NAME_REF   (1<<11)
#define NST_IN_REPEAT   (1<<12) /* STK_REPEAT is nested in stack. */
#define NST_NEST_LEVEL   (1<<13)
#define NST_BY_NUMBER   (1<<14) /* {n,m} */
#define SET_EFFECT_STATUS(node, f)   (node)->u.effect.state |= (f)
#define CLEAR_EFFECT_STATUS(node, f)   (node)->u.effect.state &= ~(f)
#define IS_EFFECT_CALLED(en)   (((en)->state & NST_CALLED) != 0)
#define IS_EFFECT_ADDR_FIXED(en)   (((en)->state & NST_ADDR_FIXED) != 0)
#define IS_EFFECT_RECURSION(en)   (((en)->state & NST_RECURSION) != 0)
#define IS_EFFECT_MARK1(en)   (((en)->state & NST_MARK1) != 0)
#define IS_EFFECT_MARK2(en)   (((en)->state & NST_MARK2) != 0)
#define IS_EFFECT_MIN_FIXED(en)   (((en)->state & NST_MIN_FIXED) != 0)
#define IS_EFFECT_MAX_FIXED(en)   (((en)->state & NST_MAX_FIXED) != 0)
#define IS_EFFECT_CLEN_FIXED(en)   (((en)->state & NST_CLEN_FIXED) != 0)
#define IS_EFFECT_STOP_BT_SIMPLE_REPEAT(en)   (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0)
#define IS_EFFECT_NAMED_GROUP(en)   (((en)->state & NST_NAMED_GROUP) != 0)
#define SET_CALL_RECURSION(node)   (node)->u.call.state |= NST_RECURSION
#define IS_CALL_RECURSION(cn)   (((cn)->state & NST_RECURSION) != 0)
#define IS_CALL_NAME_REF(cn)   (((cn)->state & NST_NAME_REF) != 0)
#define IS_BACKREF_NAME_REF(bn)   (((bn)->state & NST_NAME_REF) != 0)
#define IS_BACKREF_NEST_LEVEL(bn)   (((bn)->state & NST_NEST_LEVEL) != 0)
#define IS_QUANTIFIER_IN_REPEAT(qn)   (((qn)->state & NST_IN_REPEAT) != 0)
#define IS_QUANTIFIER_BY_NUMBER(qn)   (((qn)->state & NST_BY_NUMBER) != 0)
#define CALLNODE_REFNUM_UNDEF   -1
#define NULL_NODE   ((Node* )0)
#define SCANENV_MEMNODES_SIZE   8
#define SCANENV_MEM_NODES(senv)
#define IS_SYNTAX_OP(syn, opm)   (((syn)->op & (opm)) != 0)
#define IS_SYNTAX_OP2(syn, opm)   (((syn)->op2 & (opm)) != 0)
#define IS_SYNTAX_BV(syn, bvm)   (((syn)->behavior & (bvm)) != 0)

Typedefs

typedef struct _Node Node

Functions

int onig_renumber_name_table P_ ((regex_t *reg, GroupNumRemap *map))
int onig_strncmp P_ ((const UChar *s1, const UChar *s2, int n))
void onig_scan_env_set_error_string P_ ((ScanEnv *env, int ecode, UChar *arg, UChar *arg_end))
int onig_scan_unsigned_number P_ ((UChar **src, const UChar *end, OnigEncoding enc))
void onig_reduce_nested_quantifier P_ ((Node *pnode, Node *cnode))
void onig_node_conv_to_str_node P_ ((Node *node, int raw))
int onig_node_str_cat P_ ((Node *node, const UChar *s, const UChar *end))
void onig_node_free P_ ((Node *node))
Node *onig_node_new_effect P_ ((int type))
Node *onig_node_new_str P_ ((const UChar *s, const UChar *end))
Node *onig_node_new_list P_ ((Node *left, Node *right))
int onig_free_node_list P_ ((void))
int onig_names_free P_ ((regex_t *reg))
int onig_parse_make_tree P_ ((Node **root, const UChar *pattern, const UChar *end, regex_t *reg, ScanEnv *env))

Class Documentation

struct StrNode

Definition at line 104 of file regparse.h.

Class Members
UChar buf
int capa
UChar * end
unsigned int flag
UChar * s
struct QuantifierNode

Definition at line 121 of file regparse.h.

Collaboration diagram for QuantifierNode:
Class Members
int comb_exp_check_num
int greedy
struct _Node * head_exact
int is_refered
int lower
struct _Node * next_head_exact
int state
struct _Node * target
int target_empty_info
int upper
struct EffectNode

Definition at line 176 of file regparse.h.

Collaboration diagram for EffectNode:
Class Members
AbsAddrType call_addr
int char_len
OnigDistance max_len
OnigDistance min_len
int opt_count
OnigOptionType option
int regnum
int state
struct _Node * target
int type
struct UnsetAddr

Definition at line 194 of file regparse.h.

Collaboration diagram for UnsetAddr:
Class Members
int offset
struct _Node * target
struct UnsetAddrList

Definition at line 199 of file regparse.h.

Collaboration diagram for UnsetAddrList:
Class Members
int alloc
int num
UnsetAddr * us
struct CallNode

Definition at line 205 of file regparse.h.

Collaboration diagram for CallNode:
Class Members
UChar * name
UChar * name_end
int ref_num
int state
struct _Node * target
UnsetAddrList * unset_addr_list
struct BackrefNode

Definition at line 216 of file regparse.h.

Class Members
int * back_dynamic
int back_num
int back_static
int nest_level
int state
struct AnchorNode

Definition at line 224 of file regparse.h.

Collaboration diagram for AnchorNode:
Class Members
int char_len
struct _Node * target
int type
struct _Node

Definition at line 230 of file regparse.h.

Class Members
int type
union _Node u
struct ScanEnv

Definition at line 259 of file regparse.h.

Collaboration diagram for ScanEnv:
Class Members
OnigAmbigType ambig_flag
BitStatusType backrefed_mem
BitStatusType bt_mem_end
BitStatusType bt_mem_start
BitStatusType capture_history
int comb_exp_max_regnum
int curr_max_regnum
OnigEncoding enc
UChar * error
UChar * error_end
int has_recursion
int mem_alloc
Node ** mem_nodes_dynamic
Node * mem_nodes_static
int num_call
int num_comb_exp_check
int num_mem
int num_named
OnigOptionType option
UChar * pattern
UChar * pattern_end
regex_t * reg
OnigSyntaxType * syntax
UnsetAddrList * unset_addr_list
struct GroupNumRemap

Definition at line 299 of file regparse.h.

Class Members
int new_val
union _Node.u

Definition at line 232 of file regparse.h.

Class Members
AnchorNode anchor
BackrefNode backref
CallNode call
CClassNode cclass
u cons
u ctype
EffectNode effect
QuantifierNode quantifier
StrNode str
struct _Node.u.cons

Definition at line 242 of file regparse.h.

Class Members
struct _Node * left
struct _Node * right
struct _Node.u.ctype

Definition at line 246 of file regparse.h.

Class Members
int type

Define Documentation

Definition at line 70 of file regparse.h.

Definition at line 71 of file regparse.h.

#define BACKREFS_P (   br)    (IS_NOT_NULL((br)->back_dynamic) ? (br)->back_dynamic : (br)->back_static);

Definition at line 95 of file regparse.h.

#define CALLNODE_REFNUM_UNDEF   -1

Definition at line 190 of file regparse.h.

#define CLEAR_EFFECT_STATUS (   node,
 
)    (node)->u.effect.state &= ~(f)

Definition at line 154 of file regparse.h.

#define CTYPE_DIGIT   (1<<4)

Definition at line 65 of file regparse.h.

#define CTYPE_NOT_DIGIT   (1<<5)

Definition at line 66 of file regparse.h.

#define CTYPE_NOT_WHITE_SPACE   (1<<3)

Definition at line 64 of file regparse.h.

#define CTYPE_NOT_WORD   (1<<1)

Definition at line 62 of file regparse.h.

#define CTYPE_NOT_XDIGIT   (1<<7)

Definition at line 68 of file regparse.h.

#define CTYPE_WHITE_SPACE   (1<<2)

Definition at line 63 of file regparse.h.

#define CTYPE_WORD   (1<<0)

Definition at line 61 of file regparse.h.

#define CTYPE_XDIGIT   (1<<6)

Definition at line 67 of file regparse.h.

#define EFFECT_MEMORY   (1<<0)

Definition at line 73 of file regparse.h.

#define EFFECT_OPTION   (1<<1)

Definition at line 74 of file regparse.h.

#define EFFECT_STOP_BACKTRACK   (1<<2)

Definition at line 75 of file regparse.h.

#define IS_BACKREF_NAME_REF (   bn)    (((bn)->state & NST_NAME_REF) != 0)

Definition at line 171 of file regparse.h.

#define IS_BACKREF_NEST_LEVEL (   bn)    (((bn)->state & NST_NEST_LEVEL) != 0)

Definition at line 172 of file regparse.h.

#define IS_CALL_NAME_REF (   cn)    (((cn)->state & NST_NAME_REF) != 0)

Definition at line 170 of file regparse.h.

#define IS_CALL_RECURSION (   cn)    (((cn)->state & NST_RECURSION) != 0)

Definition at line 169 of file regparse.h.

#define IS_EFFECT_ADDR_FIXED (   en)    (((en)->state & NST_ADDR_FIXED) != 0)

Definition at line 157 of file regparse.h.

#define IS_EFFECT_CALLED (   en)    (((en)->state & NST_CALLED) != 0)

Definition at line 156 of file regparse.h.

#define IS_EFFECT_CLEN_FIXED (   en)    (((en)->state & NST_CLEN_FIXED) != 0)

Definition at line 163 of file regparse.h.

#define IS_EFFECT_MARK1 (   en)    (((en)->state & NST_MARK1) != 0)

Definition at line 159 of file regparse.h.

#define IS_EFFECT_MARK2 (   en)    (((en)->state & NST_MARK2) != 0)

Definition at line 160 of file regparse.h.

#define IS_EFFECT_MAX_FIXED (   en)    (((en)->state & NST_MAX_FIXED) != 0)

Definition at line 162 of file regparse.h.

#define IS_EFFECT_MIN_FIXED (   en)    (((en)->state & NST_MIN_FIXED) != 0)

Definition at line 161 of file regparse.h.

#define IS_EFFECT_NAMED_GROUP (   en)    (((en)->state & NST_NAMED_GROUP) != 0)

Definition at line 166 of file regparse.h.

#define IS_EFFECT_RECURSION (   en)    (((en)->state & NST_RECURSION) != 0)

Definition at line 158 of file regparse.h.

#define IS_EFFECT_STOP_BT_SIMPLE_REPEAT (   en)    (((en)->state & NST_STOP_BT_SIMPLE_REPEAT) != 0)

Definition at line 164 of file regparse.h.

#define IS_NODE_TYPE_SIMPLE (   type)    (((type) & (N_STRING | N_CCLASS | N_CTYPE | N_ANYCHAR | N_BACKREF)) != 0)

Definition at line 47 of file regparse.h.

#define IS_QUANTIFIER_BY_NUMBER (   qn)    (((qn)->state & NST_BY_NUMBER) != 0)

Definition at line 174 of file regparse.h.

#define IS_QUANTIFIER_IN_REPEAT (   qn)    (((qn)->state & NST_IN_REPEAT) != 0)

Definition at line 173 of file regparse.h.

#define IS_SYNTAX_BV (   syn,
  bvm 
)    (((syn)->behavior & (bvm)) != 0)

Definition at line 295 of file regparse.h.

#define IS_SYNTAX_OP (   syn,
  opm 
)    (((syn)->op & (opm)) != 0)

Definition at line 293 of file regparse.h.

#define IS_SYNTAX_OP2 (   syn,
  opm 
)    (((syn)->op2 & (opm)) != 0)

Definition at line 294 of file regparse.h.

#define N_ALT   (1<< 9)

Definition at line 44 of file regparse.h.

#define N_ANCHOR   (1<< 7)

Definition at line 42 of file regparse.h.

#define N_ANYCHAR   (1<< 3)

Definition at line 38 of file regparse.h.

#define N_BACKREF   (1<< 4)

Definition at line 39 of file regparse.h.

#define N_CALL   (1<<10)

Definition at line 45 of file regparse.h.

#define N_CCLASS   (1<< 1)

Definition at line 36 of file regparse.h.

#define N_CTYPE   (1<< 2)

Definition at line 37 of file regparse.h.

#define N_EFFECT   (1<< 6)

Definition at line 41 of file regparse.h.

#define N_LIST   (1<< 8)

Definition at line 43 of file regparse.h.

#define N_QUANTIFIER   (1<< 5)

Definition at line 40 of file regparse.h.

#define N_STRING   (1<< 0)

Definition at line 35 of file regparse.h.

#define NANCHOR (   node)    ((node)->u.anchor)

Definition at line 56 of file regparse.h.

#define NBACKREF (   node)    ((node)->u.backref)

Definition at line 57 of file regparse.h.

#define NCALL (   node)    ((node)->u.call)

Definition at line 59 of file regparse.h.

#define NCCLASS (   node)    ((node)->u.cclass)

Definition at line 53 of file regparse.h.

#define NCONS (   node)    ((node)->u.cons)

Definition at line 51 of file regparse.h.

#define NCTYPE (   node)    ((node)->u.ctype)

Definition at line 54 of file regparse.h.

#define NEFFECT (   node)    ((node)->u.effect)

Definition at line 58 of file regparse.h.

#define NODE_BACKREFS_SIZE   6

Definition at line 79 of file regparse.h.

#define NODE_STR_BUF_SIZE   24 /* sizeof(CClassNode) - sizeof(int)*4 */

Definition at line 78 of file regparse.h.

#define NODE_STR_MARGIN   16

Definition at line 77 of file regparse.h.

#define NQ_TARGET_IS_EMPTY   1

Definition at line 99 of file regparse.h.

#define NQ_TARGET_IS_EMPTY_MEM   2

Definition at line 100 of file regparse.h.

#define NQ_TARGET_IS_EMPTY_REC   3

Definition at line 101 of file regparse.h.

#define NQ_TARGET_ISNOT_EMPTY   0

Definition at line 98 of file regparse.h.

#define NQUANTIFIER (   node)    ((node)->u.quantifier)

Definition at line 55 of file regparse.h.

#define NST_ADDR_FIXED   (1<<9)

Definition at line 146 of file regparse.h.

#define NST_BY_NUMBER   (1<<14) /* {n,m} */

Definition at line 151 of file regparse.h.

#define NST_CALLED   (1<<8)

Definition at line 145 of file regparse.h.

#define NST_CLEN_FIXED   (1<<2)

Definition at line 139 of file regparse.h.

#define NST_IN_REPEAT   (1<<12) /* STK_REPEAT is nested in stack. */

Definition at line 149 of file regparse.h.

#define NST_MARK1   (1<<3)

Definition at line 140 of file regparse.h.

#define NST_MARK2   (1<<4)

Definition at line 141 of file regparse.h.

#define NST_MAX_FIXED   (1<<1)

Definition at line 138 of file regparse.h.

#define NST_MEM_BACKREFED   (1<<5)

Definition at line 142 of file regparse.h.

#define NST_MIN_FIXED   (1<<0)

Definition at line 137 of file regparse.h.

#define NST_NAME_REF   (1<<11)

Definition at line 148 of file regparse.h.

#define NST_NAMED_GROUP   (1<<10)

Definition at line 147 of file regparse.h.

#define NST_NEST_LEVEL   (1<<13)

Definition at line 150 of file regparse.h.

#define NST_RECURSION   (1<<7)

Definition at line 144 of file regparse.h.

#define NST_STOP_BT_SIMPLE_REPEAT   (1<<6)

Definition at line 143 of file regparse.h.

#define NSTR_AMBIG   (1<<1)

Definition at line 82 of file regparse.h.

#define NSTR_AMBIG_REDUCE   (1<<2)

Definition at line 83 of file regparse.h.

#define NSTR_RAW   (1<<0) /* by backslashed number */

Definition at line 81 of file regparse.h.

#define NSTRING (   node)    ((node)->u.str)

Definition at line 52 of file regparse.h.

#define NSTRING_CLEAR_RAW (   node)    (node)->u.str.flag &= ~NSTR_RAW

Definition at line 87 of file regparse.h.

#define NSTRING_IS_AMBIG (   node)    (((node)->u.str.flag & NSTR_AMBIG) != 0)

Definition at line 91 of file regparse.h.

#define NSTRING_IS_AMBIG_REDUCE (   node)    (((node)->u.str.flag & NSTR_AMBIG_REDUCE) != 0)

Definition at line 92 of file regparse.h.

#define NSTRING_IS_RAW (   node)    (((node)->u.str.flag & NSTR_RAW) != 0)

Definition at line 90 of file regparse.h.

#define NSTRING_LEN (   node)    ((node)->u.str.end - (node)->u.str.s)

Definition at line 85 of file regparse.h.

#define NSTRING_SET_AMBIG (   node)    (node)->u.str.flag |= NSTR_AMBIG

Definition at line 88 of file regparse.h.

#define NSTRING_SET_AMBIG_REDUCE (   node)    (node)->u.str.flag |= NSTR_AMBIG_REDUCE

Definition at line 89 of file regparse.h.

#define NSTRING_SET_RAW (   node)    (node)->u.str.flag |= NSTR_RAW

Definition at line 86 of file regparse.h.

#define NTYPE (   node)    ((node)->type)

Definition at line 50 of file regparse.h.

#define NULL_NODE   ((Node* )0)

Definition at line 252 of file regparse.h.

#define SCANENV_MEM_NODES (   senv)
Value:
(IS_NOT_NULL((senv)->mem_nodes_dynamic) ? \
    (senv)->mem_nodes_dynamic : (senv)->mem_nodes_static)

Definition at line 255 of file regparse.h.

#define SCANENV_MEMNODES_SIZE   8

Definition at line 254 of file regparse.h.

Definition at line 168 of file regparse.h.

#define SET_EFFECT_STATUS (   node,
 
)    (node)->u.effect.state |= (f)

Definition at line 153 of file regparse.h.


Typedef Documentation

typedef struct _Node Node

Function Documentation

int onig_strncmp P_ ( (const UChar *s1, const UChar *s2, int n )
void onig_scan_env_set_error_string P_ ( (ScanEnv *env, int ecode, UChar *arg, UChar *arg_end)  )
int onig_scan_unsigned_number P_ ( (UChar **src, const UChar *end, OnigEncoding enc)  )
void onig_reduce_nested_quantifier P_ ( (Node *pnode, Node *cnode)  )
int onig_node_str_cat P_ ( (Node *node, const UChar *s, const UChar *end)  )
void onig_node_free P_ ( (Node *node )
Node* onig_node_new_str P_ ( (const UChar *s, const UChar *end)  )
Node* onig_node_new_list P_ ( (Node *left, Node *right)  )
int onig_free_node_list P_ ( (void)  )
int onig_names_free P_ ( (regex_t *reg)  )
int onig_parse_make_tree P_ ( (Node **root, const UChar *pattern, const UChar *end, regex_t *reg, ScanEnv *env)  )