• Home
  • Raw
  • Download

Lines Matching refs:g

91 	struct re_guts *g;  member
113 static int matcher(struct re_guts *g, const char *string, size_t nmatch, regmatch_t pmatch[], int e…
117 static states step(struct re_guts *g, sopno start, sopno stop, states bef, wint_t ch, states aft, i…
200 matcher(struct re_guts *g, in matcher() argument
211 const sopno gf = g->firststate+1; /* +1 for OEND */ in matcher()
212 const sopno gl = g->laststate; in matcher()
224 _DIAGASSERT(g != NULL); in matcher()
229 if (g->cflags&REG_NOSUB) in matcher()
243 if (g->must != NULL) { in matcher()
244 if (g->charjump != NULL && g->matchjump != NULL) { in matcher()
245 mustfirst = g->must; in matcher()
246 mustlast = g->must + g->mlen - 1; in matcher()
247 charjump = g->charjump; in matcher()
248 matchjump = g->matchjump; in matcher()
250 for (dp = start+g->mlen-1; dp < stop;) { in matcher()
277 if (*dp == g->must[0] && in matcher()
278 (size_t)(stop - dp) >= g->mlen && in matcher()
279 memcmp(dp, g->must, (size_t)g->mlen) == 0) in matcher()
287 m->g = g; in matcher()
303 if (dp != NULL && g->moffset > -1) { in matcher()
306 nstart = stepback(start, dp, g->moffset); in matcher()
320 if (nmatch == 0 && !g->backrefs) in matcher()
334 if (nmatch == 1 && !g->backrefs) in matcher()
339 m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * in matcher()
345 for (i = 1; i <= m->g->nsub; i++) in matcher()
347 if (!g->backrefs && !(m->eflags&REG_BACKR)) { in matcher()
351 if (g->nplus > 0 && m->lastpos == NULL) in matcher()
352 m->lastpos = malloc((g->nplus+1) * in matcher()
354 if (g->nplus > 0 && m->lastpos == NULL) { in matcher()
365 assert(g->backrefs); /* must be back references doing it */ in matcher()
366 assert(g->nplus == 0 || m->lastpos != NULL); in matcher()
376 for (i = 1; i <= m->g->nsub; i++) { in matcher()
405 if (i <= m->g->nsub) in matcher()
462 switch (OP(m->g->strip[es])) { in dissect()
465 es += OPND(m->g->strip[es]); in dissect()
468 while (OP(m->g->strip[es]) != O_CH) in dissect()
469 es += OPND(m->g->strip[es]); in dissect()
475 switch (OP(m->g->strip[ss])) { in dissect()
577 esub = ss + OPND(m->g->strip[ss]) - 1; in dissect()
578 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
583 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
585 assert(OP(m->g->strip[esub]) == OOR2); in dissect()
587 esub += OPND(m->g->strip[esub]); in dissect()
588 if (OP(m->g->strip[esub]) == OOR2) in dissect()
591 assert(OP(m->g->strip[esub]) == O_CH); in dissect()
605 i = OPND(m->g->strip[ss]); in dissect()
606 assert(0 < i && i <= m->g->nsub); in dissect()
610 i = OPND(m->g->strip[ss]); in dissect()
611 assert(0 < i && i <= m->g->nsub); in dissect()
631 (m->g->cflags&REG_NEWLINE)) || \
674 switch (OP(s = m->g->strip[ss])) { in backref()
694 cs = &m->g->sets[OPND(s)]; in backref()
715 *(sp-1) == '\n' && (m->g->cflags&REG_NEWLINE))) in backref()
723 (m->g->cflags&REG_NEWLINE)) ) in backref()
759 s = m->g->strip[ss]; in backref()
763 } while (OP(s = m->g->strip[ss]) != O_CH); in backref()
779 s = m->g->strip[ss]; in backref()
783 assert(0 < i && i <= m->g->nsub); in backref()
796 while (m->g->strip[ss] != SOP(O_BACK, i)) in backref()
806 assert(lev+1 <= m->g->nplus); in backref()
822 assert(OP(m->g->strip[esub]) == OOR1); in backref()
828 if (OP(m->g->strip[esub]) == O_CH) in backref()
831 assert(OP(m->g->strip[esub]) == OOR2); in backref()
833 esub += OPND(m->g->strip[esub]); in backref()
834 if (OP(m->g->strip[esub]) == OOR2) in backref()
837 assert(OP(m->g->strip[esub]) == O_CH); in backref()
843 assert(0 < i && i <= m->g->nsub); in backref()
853 assert(0 < i && i <= m->g->nsub); in backref()
902 st = step(m->g, startst, stopst, st, NOTHING, st, sflags); in walk()
933 if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) || in walk()
936 i = m->g->nbol; in walk()
938 if ( (c == '\n' && m->g->cflags&REG_NEWLINE) || in walk()
941 i += m->g->neol; in walk()
955 st = step(m->g, startst, stopst, st, flagch, st, in walk()
970 st = step(m->g, startst, stopst, st, flagch, st, sflags); in walk()
981 st = step(m->g, startst, stopst, st, flagch, st, sflags); in walk()
1002 st = step(m->g, startst, stopst, tmp, c, st, sflags); in walk()
1004 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st, sflags), in walk()
1035 step(struct re_guts *g, in step() argument
1050 _DIAGASSERT(g != NULL); in step()
1053 s = g->strip[pc]; in step()
1101 cs = &g->sets[OPND(s)]; in step()
1135 assert(OP(g->strip[pc+OPND(s)]) == OOR2); in step()
1141 OP(s = g->strip[pc+look]) != O_CH; in step()
1149 if (OP(g->strip[pc+OPND(s)]) != O_CH) { in step()
1150 assert(OP(g->strip[pc+OPND(s)]) == OOR2); in step()
1181 struct re_guts *g = m->g; in print() local
1196 for (i = 0; i < g->nstates; i++) in print()