Lines Matching refs:g
83 struct re_guts *g; member
185 matcher(struct re_guts *g, const char *string, size_t nmatch, in matcher() argument
193 const sopno gf = g->firststate+1; /* +1 for OEND */ in matcher()
194 const sopno gl = g->laststate; in matcher()
206 if (g->cflags®_NOSUB) in matcher()
221 if (g->must != NULL) { in matcher()
222 if (g->charjump != NULL && g->matchjump != NULL) { in matcher()
223 mustfirst = g->must; in matcher()
224 mustlast = g->must + g->mlen - 1; in matcher()
225 charjump = g->charjump; in matcher()
226 matchjump = g->matchjump; in matcher()
228 for (dp = start+g->mlen-1; dp < stop; ) { in matcher()
257 if (*dp == g->must[0] && in matcher()
258 stop - dp >= g->mlen && in matcher()
259 memcmp(dp, g->must, (size_t)g->mlen) == 0) in matcher()
267 m->g = g; in matcher()
283 if (dp != NULL && g->moffset > -1) { in matcher()
286 nstart = stepback(start, dp, g->moffset, g->mb_cur_max); in matcher()
304 if (nmatch == 0 && !g->backrefs) in matcher()
318 if (nmatch == 1 && !g->backrefs) in matcher()
323 m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * in matcher()
329 for (i = 1; i <= m->g->nsub; i++) in matcher()
331 if (!g->backrefs && !(m->eflags®_BACKR)) { in matcher()
335 if (g->nplus > 0 && m->lastpos == NULL) in matcher()
336 m->lastpos = malloc((g->nplus+1) * in matcher()
338 if (g->nplus > 0 && m->lastpos == NULL) { in matcher()
350 assert(g->backrefs); /* must be back references doing it */ in matcher()
351 assert(g->nplus == 0 || m->lastpos != NULL); in matcher()
361 for (i = 1; i <= m->g->nsub; i++) { in matcher()
389 if (i <= m->g->nsub) in matcher()
431 switch (OP(m->g->strip[es])) { in dissect()
434 es += OPND(m->g->strip[es]); in dissect()
437 while (OP(m->g->strip[es]) != (sop)O_CH) in dissect()
438 es += OPND(m->g->strip[es]); in dissect()
444 switch (OP(m->g->strip[ss])) { in dissect()
540 esub = ss + OPND(m->g->strip[ss]) - 1; in dissect()
541 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
547 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
549 assert(OP(m->g->strip[esub]) == OOR2); in dissect()
551 esub += OPND(m->g->strip[esub]); in dissect()
552 if (OP(m->g->strip[esub]) == (sop)OOR2) in dissect()
555 assert(OP(m->g->strip[esub]) == O_CH); in dissect()
569 i = OPND(m->g->strip[ss]); in dissect()
570 assert(0 < i && i <= m->g->nsub); in dissect()
574 i = OPND(m->g->strip[ss]); in dissect()
575 assert(0 < i && i <= m->g->nsub); in dissect()
616 switch (OP(s = m->g->strip[ss])) { in backref()
634 cs = &m->g->sets[OPND(s)]; in backref()
642 *(sp-1) == '\n' && (m->g->cflags®_NEWLINE))) { in backref()
649 (m->g->cflags®_NEWLINE))) { in backref()
663 (m->g->cflags®_NEWLINE)) || in backref()
673 s = m->g->strip[ss]; in backref()
677 } while (OP(s = m->g->strip[ss]) != (sop)O_CH); in backref()
693 s = m->g->strip[ss]; in backref()
697 assert(0 < i && i <= m->g->nsub); in backref()
710 while (m->g->strip[ss] != (sop)SOP(O_BACK, i)) in backref()
720 assert(lev+1 <= m->g->nplus); in backref()
735 assert(OP(m->g->strip[esub]) == OOR1); in backref()
741 if (OP(m->g->strip[esub]) == (sop)O_CH) in backref()
744 assert(OP(m->g->strip[esub]) == (sop)OOR2); in backref()
746 esub += OPND(m->g->strip[esub]); in backref()
747 if (OP(m->g->strip[esub]) == (sop)OOR2) in backref()
750 assert(OP(m->g->strip[esub]) == O_CH); in backref()
756 assert(0 < i && i <= m->g->nsub); in backref()
766 assert(0 < i && i <= m->g->nsub); in backref()
808 st = step(m->g, startst, stopst, st, NOTHING, st); in walk()
837 if ((lastc == '\n' && m->g->cflags®_NEWLINE) || in walk()
840 i = m->g->nbol; in walk()
842 if ((c == '\n' && m->g->cflags®_NEWLINE) || in walk()
845 i += m->g->neol; in walk()
849 st = step(m->g, startst, stopst, st, in walk()
864 st = step(m->g, startst, stopst, st, flagch, st); in walk()
885 st = step(m->g, startst, stopst, tmp, c, st); in walk()
887 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); in walk()
906 step(struct re_guts *g, in step() argument
921 s = g->strip[pc]; in step()
953 cs = &g->sets[OPND(s)]; in step()
987 assert(OP(g->strip[pc+OPND(s)]) == (sop)OOR2); in step()
993 OP(s = g->strip[pc+look]) != (sop)O_CH; in step()
1001 if (OP(g->strip[pc+OPND(s)]) != (sop)O_CH) { in step()
1002 assert(OP(g->strip[pc+OPND(s)]) == (sop)OOR2); in step()
1025 struct re_guts *g = m->g; in print() local
1035 for (i = 0; i < g->nstates; i++) in print()