|
#define | INCOMPATIBLE 1 /* destroys arc */ |
|
#define | SATISFIED 2 /* constraint satisfied */ |
|
#define | COMPATIBLE 3 /* compatible but not satisfied yet */ |
|
#define | REPLACEARC 4 /* replace arc's color with constraint color */ |
|
#define | NEXT() (next(v)) /* advance by one token */ |
|
#define | SEE(t) (v->nexttype == (t)) /* is next token this? */ |
|
#define | EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ |
|
#define | VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ |
|
#define | ISERR() VISERR(v) |
|
#define | VERR(vv, e) |
|
#define | ERR(e) VERR(v, e) /* record an error */ |
|
#define | NOERR() {if (ISERR()) return;} /* if error seen, return */ |
|
#define | NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */ |
|
#define | NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */ |
|
#define | INSIST(c, e) do { if (!(c)) ERR(e); } while (0) /* error if c false */ |
|
#define | NOTE(b) (v->re->re_info |= (b)) /* note visible condition */ |
|
#define | EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y) |
|
#define | EMPTY 'n' /* no token present */ |
|
#define | EOS 'e' /* end of string */ |
|
#define | PLAIN 'p' /* ordinary character */ |
|
#define | DIGIT 'd' /* digit (in bound) */ |
|
#define | BACKREF 'b' /* back reference */ |
|
#define | COLLEL 'I' /* start of [. */ |
|
#define | ECLASS 'E' /* start of [= */ |
|
#define | CCLASS 'C' /* start of [: */ |
|
#define | END 'X' /* end of [. [= [: */ |
|
#define | CCLASSS 's' /* char class shorthand escape */ |
|
#define | CCLASSC 'c' /* complement char class shorthand escape */ |
|
#define | RANGE 'R' /* - within [] which might be range delim. */ |
|
#define | LACON 'L' /* lookaround constraint subRE */ |
|
#define | AHEAD 'a' /* color-lookahead arc */ |
|
#define | BEHIND 'r' /* color-lookbehind arc */ |
|
#define | WBDRY 'w' /* word boundary constraint */ |
|
#define | NWBDRY 'W' /* non-word-boundary constraint */ |
|
#define | CANTMATCH 'x' /* arc that cannot match anything */ |
|
#define | SBEGIN 'A' /* beginning of string (even if not BOL) */ |
|
#define | SEND 'Z' /* end of string (even if not EOL) */ |
|
#define | COLORED(a) |
|
#define | CNOERR() { if (ISERR()) return freev(v, v->err); } |
|
#define | ARCV(t, val) newarc(v->nfa, t, val, lp, rp) |
|
#define | SOME 2 |
|
#define | INF 3 |
|
#define | PAIR(x, y) ((x)*4 + (y)) |
|
#define | REDUCE(x) ( ((x) == DUPINF) ? INF : (((x) > 1) ? SOME : (x)) ) |
|
|
static void | moresubs (struct vars *v, int wanted) |
|
static int | freev (struct vars *v, int err) |
|
static void | makesearch (struct vars *v, struct nfa *nfa) |
|
static struct subre * | parse (struct vars *v, int stopper, int type, struct state *init, struct state *final) |
|
static struct subre * | parsebranch (struct vars *v, int stopper, int type, struct state *left, struct state *right, int partial) |
|
static struct subre * | parseqatom (struct vars *v, int stopper, int type, struct state *lp, struct state *rp, struct subre *top) |
|
static void | nonword (struct vars *v, int dir, struct state *lp, struct state *rp) |
|
static void | word (struct vars *v, int dir, struct state *lp, struct state *rp) |
|
static void | charclass (struct vars *v, enum char_classes cls, struct state *lp, struct state *rp) |
|
static void | charclasscomplement (struct vars *v, enum char_classes cls, struct state *lp, struct state *rp) |
|
static int | scannum (struct vars *v) |
|
static void | repeat (struct vars *v, struct state *lp, struct state *rp, int m, int n) |
|
static void | bracket (struct vars *v, struct state *lp, struct state *rp) |
|
static void | cbracket (struct vars *v, struct state *lp, struct state *rp) |
|
static void | brackpart (struct vars *v, struct state *lp, struct state *rp, bool *have_cclassc) |
|
static const chr * | scanplain (struct vars *v) |
|
static void | onechr (struct vars *v, chr c, struct state *lp, struct state *rp) |
|
static void | optimizebracket (struct vars *v, struct state *lp, struct state *rp) |
|
static void | wordchrs (struct vars *v) |
|
static void | processlacon (struct vars *v, struct state *begin, struct state *end, int latype, struct state *lp, struct state *rp) |
|
static struct subre * | subre (struct vars *v, int op, int flags, struct state *begin, struct state *end) |
|
static void | freesubre (struct vars *v, struct subre *sr) |
|
static void | freesubreandsiblings (struct vars *v, struct subre *sr) |
|
static void | freesrnode (struct vars *v, struct subre *sr) |
|
static void | removecaptures (struct vars *v, struct subre *t) |
|
static int | numst (struct subre *t, int start) |
|
static void | markst (struct subre *t) |
|
static void | cleanst (struct vars *v) |
|
static long | nfatree (struct vars *v, struct subre *t, FILE *f) |
|
static long | nfanode (struct vars *v, struct subre *t, int converttosearch, FILE *f) |
|
static int | newlacon (struct vars *v, struct state *begin, struct state *end, int latype) |
|
static void | freelacons (struct subre *subs, int n) |
|
static void | rfree (regex_t *re) |
|
static int | rstacktoodeep (void) |
|
static void | lexstart (struct vars *v) |
|
static void | prefixes (struct vars *v) |
|
static int | next (struct vars *v) |
|
static int | lexescape (struct vars *v) |
|
static chr | lexdigits (struct vars *v, int base, int minlen, int maxlen) |
|
static int | brenext (struct vars *v, chr c) |
|
static void | skip (struct vars *v) |
|
static chr | newline (void) |
|
static chr | chrnamed (struct vars *v, const chr *startp, const chr *endp, chr lastresort) |
|
static void | initcm (struct vars *v, struct colormap *cm) |
|
static void | freecm (struct colormap *cm) |
|
static color | maxcolor (struct colormap *cm) |
|
static color | newcolor (struct colormap *cm) |
|
static void | freecolor (struct colormap *cm, color co) |
|
static color | pseudocolor (struct colormap *cm) |
|
static color | subcolor (struct colormap *cm, chr c) |
|
static color | subcolorhi (struct colormap *cm, color *pco) |
|
static color | newsub (struct colormap *cm, color co) |
|
static int | newhicolorrow (struct colormap *cm, int oldrow) |
|
static void | newhicolorcols (struct colormap *cm) |
|
static void | subcolorcvec (struct vars *v, struct cvec *cv, struct state *lp, struct state *rp) |
|
static void | subcoloronechr (struct vars *v, chr ch, struct state *lp, struct state *rp, color *lastsubcolor) |
|
static void | subcoloronerange (struct vars *v, chr from, chr to, struct state *lp, struct state *rp, color *lastsubcolor) |
|
static void | subcoloronerow (struct vars *v, int rownum, struct state *lp, struct state *rp, color *lastsubcolor) |
|
static void | okcolors (struct nfa *nfa, struct colormap *cm) |
|
static void | colorchain (struct colormap *cm, struct arc *a) |
|
static void | uncolorchain (struct colormap *cm, struct arc *a) |
|
static void | rainbow (struct nfa *nfa, struct colormap *cm, int type, color but, struct state *from, struct state *to) |
|
static void | colorcomplement (struct nfa *nfa, struct colormap *cm, int type, struct state *of, struct state *from, struct state *to) |
|
static struct nfa * | newnfa (struct vars *v, struct colormap *cm, struct nfa *parent) |
|
static void | freenfa (struct nfa *nfa) |
|
static struct state * | newstate (struct nfa *nfa) |
|
static struct state * | newfstate (struct nfa *nfa, int flag) |
|
static void | dropstate (struct nfa *nfa, struct state *s) |
|
static void | freestate (struct nfa *nfa, struct state *s) |
|
static void | newarc (struct nfa *nfa, int t, color co, struct state *from, struct state *to) |
|
static void | createarc (struct nfa *nfa, int t, color co, struct state *from, struct state *to) |
|
static struct arc * | allocarc (struct nfa *nfa) |
|
static void | freearc (struct nfa *nfa, struct arc *victim) |
|
static void | changearcsource (struct arc *a, struct state *newfrom) |
|
static void | changearctarget (struct arc *a, struct state *newto) |
|
static int | hasnonemptyout (struct state *s) |
|
static struct arc * | findarc (struct state *s, int type, color co) |
|
static void | cparc (struct nfa *nfa, struct arc *oa, struct state *from, struct state *to) |
|
static void | sortins (struct nfa *nfa, struct state *s) |
|
static int | sortins_cmp (const void *a, const void *b) |
|
static void | sortouts (struct nfa *nfa, struct state *s) |
|
static int | sortouts_cmp (const void *a, const void *b) |
|
static void | moveins (struct nfa *nfa, struct state *oldState, struct state *newState) |
|
static void | copyins (struct nfa *nfa, struct state *oldState, struct state *newState) |
|
static void | mergeins (struct nfa *nfa, struct state *s, struct arc **arcarray, int arccount) |
|
static void | moveouts (struct nfa *nfa, struct state *oldState, struct state *newState) |
|
static void | copyouts (struct nfa *nfa, struct state *oldState, struct state *newState) |
|
static void | cloneouts (struct nfa *nfa, struct state *old, struct state *from, struct state *to, int type) |
|
static void | delsub (struct nfa *nfa, struct state *lp, struct state *rp) |
|
static void | deltraverse (struct nfa *nfa, struct state *leftend, struct state *s) |
|
static void | dupnfa (struct nfa *nfa, struct state *start, struct state *stop, struct state *from, struct state *to) |
|
static void | duptraverse (struct nfa *nfa, struct state *s, struct state *stmp) |
|
static void | removeconstraints (struct nfa *nfa, struct state *start, struct state *stop) |
|
static void | removetraverse (struct nfa *nfa, struct state *s) |
|
static void | cleartraverse (struct nfa *nfa, struct state *s) |
|
static struct state * | single_color_transition (struct state *s1, struct state *s2) |
|
static void | specialcolors (struct nfa *nfa) |
|
static long | optimize (struct nfa *nfa, FILE *f) |
|
static void | pullback (struct nfa *nfa, FILE *f) |
|
static int | pull (struct nfa *nfa, struct arc *con, struct state **intermediates) |
|
static void | pushfwd (struct nfa *nfa, FILE *f) |
|
static int | push (struct nfa *nfa, struct arc *con, struct state **intermediates) |
|
static int | combine (struct nfa *nfa, struct arc *con, struct arc *a) |
|
static void | fixempties (struct nfa *nfa, FILE *f) |
|
static struct state * | emptyreachable (struct nfa *nfa, struct state *s, struct state *lastfound, struct arc **inarcsorig) |
|
static int | isconstraintarc (struct arc *a) |
|
static int | hasconstraintout (struct state *s) |
|
static void | fixconstraintloops (struct nfa *nfa, FILE *f) |
|
static int | findconstraintloop (struct nfa *nfa, struct state *s) |
|
static void | breakconstraintloop (struct nfa *nfa, struct state *sinitial) |
|
static void | clonesuccessorstates (struct nfa *nfa, struct state *ssource, struct state *sclone, struct state *spredecessor, struct arc *refarc, char *curdonemap, char *outerdonemap, int nstates) |
|
static void | removecantmatch (struct nfa *nfa) |
|
static void | cleanup (struct nfa *nfa) |
|
static void | markreachable (struct nfa *nfa, struct state *s, struct state *okay, struct state *mark) |
|
static void | markcanreach (struct nfa *nfa, struct state *s, struct state *okay, struct state *mark) |
|
static long | analyze (struct nfa *nfa) |
|
static void | checkmatchall (struct nfa *nfa) |
|
static bool | checkmatchall_recurse (struct nfa *nfa, struct state *s, bool **haspaths) |
|
static bool | check_out_colors_match (struct state *s, color co1, color co2) |
|
static bool | check_in_colors_match (struct state *s, color co1, color co2) |
|
static void | compact (struct nfa *nfa, struct cnfa *cnfa) |
|
static void | carcsort (struct carc *first, size_t n) |
|
static int | carc_cmp (const void *a, const void *b) |
|
static void | freecnfa (struct cnfa *cnfa) |
|
static void | dumpnfa (struct nfa *nfa, FILE *f) |
|
static struct cvec * | newcvec (int nchrs, int nranges) |
|
static struct cvec * | clearcvec (struct cvec *cv) |
|
static void | addchr (struct cvec *cv, chr c) |
|
static void | addrange (struct cvec *cv, chr from, chr to) |
|
static struct cvec * | getcvec (struct vars *v, int nchrs, int nranges) |
|
static void | freecvec (struct cvec *cv) |
|
static int | pg_wc_isdigit (pg_wchar c) |
|
static int | pg_wc_isalpha (pg_wchar c) |
|
static int | pg_wc_isalnum (pg_wchar c) |
|
static int | pg_wc_isword (pg_wchar c) |
|
static int | pg_wc_isupper (pg_wchar c) |
|
static int | pg_wc_islower (pg_wchar c) |
|
static int | pg_wc_isgraph (pg_wchar c) |
|
static int | pg_wc_isprint (pg_wchar c) |
|
static int | pg_wc_ispunct (pg_wchar c) |
|
static int | pg_wc_isspace (pg_wchar c) |
|
static pg_wchar | pg_wc_toupper (pg_wchar c) |
|
static pg_wchar | pg_wc_tolower (pg_wchar c) |
|
static chr | element (struct vars *v, const chr *startp, const chr *endp) |
|
static struct cvec * | range (struct vars *v, chr a, chr b, int cases) |
|
static int | before (chr x, chr y) |
|
static struct cvec * | eclass (struct vars *v, chr c, int cases) |
|
static enum char_classes | lookupcclass (struct vars *v, const chr *startp, const chr *endp) |
|
static struct cvec * | cclasscvec (struct vars *v, enum char_classes cclasscode, int cases) |
|
static int | cclass_column_index (struct colormap *cm, chr c) |
|
static struct cvec * | allcases (struct vars *v, chr c) |
|
static int | cmp (const chr *x, const chr *y, size_t len) |
|
static int | casecmp (const chr *x, const chr *y, size_t len) |
|
int | pg_regcomp (regex_t *re, const chr *string, size_t len, int flags, Oid collation) |
|
static struct subre * parseqatom |
( |
struct vars * |
v, |
|
|
int |
stopper, |
|
|
int |
type, |
|
|
struct state * |
lp, |
|
|
struct state * |
rp, |
|
|
struct subre * |
top |
|
) |
| |
|
static |
Definition at line 838 of file regcomp.c.
848 #define ARCV(t, val) newarc(v->nfa, t, val, lp, rp)
859 struct subre **atomp;
1016 if ((
size_t) subno >= v->
nsubs)
1046 if (atom->
capno == 0)
1050 atom->
capno = subno;
1062 v->
subs[subno] = atom;
1141 if (m == 0 && n == 0)
1148 if (atom != NULL && (atom->
flags &
CAP))
1166 f = top->
flags | qprefer | ((atom != NULL) ? atom->
flags : 0);
1169 if (!(m == 1 && n == 1))
1187 atom =
subre(v,
'=', 0, lp, rp);
1198 if (atom->
begin == lp || atom->
end == rp)
1295 atom->
min = (short) m;
1296 atom->
max = (short) n;
1301 else if (m == 1 && n == 1 &&
1342 t =
subre(v,
'.', f, s, atom->
end);
1414 else if (t->
child->
op ==
'=' &&
if(TABLE==NULL||TABLE_index==NULL)
static void wordchrs(struct vars *v)
static void repeat(struct vars *v, struct state *lp, struct state *rp, int m, int n)
static void moresubs(struct vars *v, int wanted)
static void moveouts(struct nfa *nfa, struct state *oldState, struct state *newState)
static int scannum(struct vars *v)
static void cbracket(struct vars *v, struct state *lp, struct state *rp)
static void nonword(struct vars *v, int dir, struct state *lp, struct state *rp)
static void delsub(struct nfa *nfa, struct state *lp, struct state *rp)
static void removeconstraints(struct nfa *nfa, struct state *start, struct state *stop)
static struct subre * parse(struct vars *v, int stopper, int type, struct state *init, struct state *final)
static void processlacon(struct vars *v, struct state *begin, struct state *end, int latype, struct state *lp, struct state *rp)
static void word(struct vars *v, int dir, struct state *lp, struct state *rp)
References AHEAD, ARCV, assert, subre::backno, BACKR, BACKREF, subre::begin, BEHIND, bracket(), BRUSE, CAP, subre::capno, cbracket(), CCLASSC, CCLASSS, vars::cflags, charclass(), charclasscomplement(), subre::child, vars::cm, COLORLESS, COMBINE, delsub(), DIGIT, DUPINF, dupnfa(), EAT, EMPTYARC, subre::end, EOS, ERR, subre::flags, freesrnode(), freesubre(), freesubreandsiblings(), if(), INSIST, ISERR, LACON, subre::latype, LONGER, subre::max, MESSY, subre::min, MIXED, moresubs(), moveins(), moveouts(), newstate(), NEXT, vars::nexttype, vars::nextvalue, vars::nfa, state::nins, vars::nlcolor, NOERRN, nonword(), NOTE, state::nouts, vars::nsubexp, vars::nsubs, NWBDRY, okcolors(), onechr(), subre::op, parse(), parsebranch(), PLAIN, PREF, processlacon(), rainbow(), REG_ADVANCED, REG_ASSERT, REG_BADBR, REG_BADRPT, REG_EPAREN, REG_ESUBREG, REG_EXTENDED, REG_NLANCH, REG_NLSTOP, REG_UPBOTCH, removeconstraints(), repeat(), s2, SBEGIN, scannum(), SEE, SEND, SHORTER, subre::sibling, subre(), vars::subs, type, UP, WBDRY, word(), and wordchrs().
Referenced by parsebranch().