| 7 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 8 |
|
|
| 9 |
Written by Philip Hazel |
Written by Philip Hazel |
| 10 |
Copyright (c) 1997-2010 University of Cambridge |
Copyright (c) 1997-2011 University of Cambridge |
| 11 |
|
|
| 12 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 13 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 1753 |
} compile_data; |
} compile_data; |
| 1754 |
|
|
| 1755 |
/* Structure for maintaining a chain of pointers to the currently incomplete |
/* Structure for maintaining a chain of pointers to the currently incomplete |
| 1756 |
branches, for testing for left recursion. */ |
branches, for testing for left recursion while compiling. */ |
| 1757 |
|
|
| 1758 |
typedef struct branch_chain { |
typedef struct branch_chain { |
| 1759 |
struct branch_chain *outer; |
struct branch_chain *outer; |
| 1761 |
} branch_chain; |
} branch_chain; |
| 1762 |
|
|
| 1763 |
/* Structure for items in a linked list that represents an explicit recursive |
/* Structure for items in a linked list that represents an explicit recursive |
| 1764 |
call within the pattern. */ |
call within the pattern; used by pcre_exec(). */ |
| 1765 |
|
|
| 1766 |
typedef struct recursion_info { |
typedef struct recursion_info { |
| 1767 |
struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ |
struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ |
| 1768 |
int group_num; /* Number of group that was called */ |
int group_num; /* Number of group that was called */ |
| 1769 |
int *offset_save; /* Pointer to start of saved offsets */ |
int *offset_save; /* Pointer to start of saved offsets */ |
| 1770 |
int saved_max; /* Number of saved offsets */ |
int saved_max; /* Number of saved offsets */ |
| 1771 |
|
USPTR subject_position; /* Position at start of recursion */ |
| 1772 |
} recursion_info; |
} recursion_info; |
| 1773 |
|
|
| 1774 |
|
/* A similar structure for pcre_dfa_exec(). */ |
| 1775 |
|
|
| 1776 |
|
typedef struct dfa_recursion_info { |
| 1777 |
|
struct dfa_recursion_info *prevrec; |
| 1778 |
|
int group_num; |
| 1779 |
|
USPTR subject_position; |
| 1780 |
|
} dfa_recursion_info; |
| 1781 |
|
|
| 1782 |
/* Structure for building a chain of data for holding the values of the subject |
/* Structure for building a chain of data for holding the values of the subject |
| 1783 |
pointer at the start of each subpattern, so as to detect when an empty string |
pointer at the start of each subpattern, so as to detect when an empty string |
| 1784 |
has been matched by a subpattern - to break infinite loops. */ |
has been matched by a subpattern - to break infinite loops; used by |
| 1785 |
|
pcre_exec(). */ |
| 1786 |
|
|
| 1787 |
typedef struct eptrblock { |
typedef struct eptrblock { |
| 1788 |
struct eptrblock *epb_prev; |
struct eptrblock *epb_prev; |
| 1842 |
functions. */ |
functions. */ |
| 1843 |
|
|
| 1844 |
typedef struct dfa_match_data { |
typedef struct dfa_match_data { |
| 1845 |
const uschar *start_code; /* Start of the compiled pattern */ |
const uschar *start_code; /* Start of the compiled pattern */ |
| 1846 |
const uschar *start_subject; /* Start of the subject string */ |
const uschar *start_subject; /* Start of the subject string */ |
| 1847 |
const uschar *end_subject; /* End of subject string */ |
const uschar *end_subject; /* End of subject string */ |
| 1848 |
const uschar *start_used_ptr; /* Earliest consulted character */ |
const uschar *start_used_ptr; /* Earliest consulted character */ |
| 1849 |
const uschar *tables; /* Character tables */ |
const uschar *tables; /* Character tables */ |
| 1850 |
int start_offset; /* The start offset value */ |
int start_offset; /* The start offset value */ |
| 1851 |
int moptions; /* Match options */ |
int moptions; /* Match options */ |
| 1852 |
int poptions; /* Pattern options */ |
int poptions; /* Pattern options */ |
| 1853 |
int nltype; /* Newline type */ |
int nltype; /* Newline type */ |
| 1854 |
int nllen; /* Newline string length */ |
int nllen; /* Newline string length */ |
| 1855 |
uschar nl[4]; /* Newline string when fixed */ |
uschar nl[4]; /* Newline string when fixed */ |
| 1856 |
void *callout_data; /* To pass back to callouts */ |
void *callout_data; /* To pass back to callouts */ |
| 1857 |
|
dfa_recursion_info *recursive; /* Linked list of recursion data */ |
| 1858 |
} dfa_match_data; |
} dfa_match_data; |
| 1859 |
|
|
| 1860 |
/* Bit definitions for entries in the pcre_ctypes table. */ |
/* Bit definitions for entries in the pcre_ctypes table. */ |