Lines Matching refs:g

33 	struct re_guts *g;  member
66 matcher(g, string, nmatch, pmatch, eflags) in matcher() argument
67 register struct re_guts *g; in matcher()
78 const register sopno gf = g->firststate+1; /* +1 for OEND */
79 const register sopno gl = g->laststate;
84 if (g->cflags&REG_NOSUB)
97 if (g->must != NULL) {
99 if (*dp == g->must[0] && stop - dp >= g->mlen &&
100 memcmp(dp, g->must, (size_t)g->mlen) == 0)
107 m->g = g;
128 if (nmatch == 0 && !g->backrefs)
141 if (nmatch == 1 && !g->backrefs)
146 m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) *
152 for (i = 1; i <= m->g->nsub; i++)
154 if (!g->backrefs && !(m->eflags&REG_BACKR)) {
158 if (g->nplus > 0 && m->lastpos == NULL)
159 m->lastpos = (unsigned char **)malloc((g->nplus+1) *
161 if (g->nplus > 0 && m->lastpos == NULL) {
173 assert(g->backrefs); /* must be back references doing it */
174 assert(g->nplus == 0 || m->lastpos != NULL);
184 for (i = 1; i <= m->g->nsub; i++) {
210 if (i <= m->g->nsub)
258 switch (OP(m->g->strip[es])) {
261 es += OPND(m->g->strip[es]);
264 while (OP(m->g->strip[es]) != O_CH)
265 es += OPND(m->g->strip[es]);
271 switch (OP(m->g->strip[ss])) {
367 esub = ss + OPND(m->g->strip[ss]) - 1;
368 assert(OP(m->g->strip[esub]) == OOR1);
373 assert(OP(m->g->strip[esub]) == OOR1);
375 assert(OP(m->g->strip[esub]) == OOR2);
377 esub += OPND(m->g->strip[esub]);
378 if (OP(m->g->strip[esub]) == OOR2)
381 assert(OP(m->g->strip[esub]) == O_CH);
395 i = OPND(m->g->strip[ss]);
396 assert(0 < i && i <= m->g->nsub);
400 i = OPND(m->g->strip[ss]);
401 assert(0 < i && i <= m->g->nsub);
447 switch (OP(s = m->g->strip[ss])) {
458 cs = &m->g->sets[OPND(s)];
465 (m->g->cflags&REG_NEWLINE)) )
473 (m->g->cflags&REG_NEWLINE)) )
481 (m->g->cflags&REG_NEWLINE)) ||
492 (m->g->cflags&REG_NEWLINE)) ||
503 s = m->g->strip[ss];
507 } while (OP(s = m->g->strip[ss]) != O_CH);
523 s = m->g->strip[ss];
527 assert(0 < i && i <= m->g->nsub);
538 while (m->g->strip[ss] != SOP(O_BACK, i))
550 assert(lev+1 <= m->g->nplus);
568 assert(OP(m->g->strip[esub]) == OOR1);
574 if (OP(m->g->strip[esub]) == O_CH)
577 assert(OP(m->g->strip[esub]) == OOR2);
579 esub += OPND(m->g->strip[esub]);
580 if (OP(m->g->strip[esub]) == OOR2)
583 assert(OP(m->g->strip[esub]) == O_CH);
588 assert(0 < i && i <= m->g->nsub);
599 assert(0 < i && i <= m->g->nsub);
644 st = step(m->g, startst, stopst, st, NOTHING, st);
658 if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) ||
661 i = m->g->nbol;
663 if ( (c == '\n' && m->g->cflags&REG_NEWLINE) ||
666 i += m->g->neol;
670 st = step(m->g, startst, stopst, st, flagch, st);
684 st = step(m->g, startst, stopst, st, flagch, st);
696 st = step(m->g, startst, stopst, tmp, c, st);
698 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st));
737 st = step(m->g, startst, stopst, st, NOTHING, st);
747 if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) ||
750 i = m->g->nbol;
752 if ( (c == '\n' && m->g->cflags&REG_NEWLINE) ||
755 i += m->g->neol;
759 st = step(m->g, startst, stopst, st, flagch, st);
773 st = step(m->g, startst, stopst, st, flagch, st);
787 st = step(m->g, startst, stopst, tmp, c, st);
789 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st));
812 step(g, start, stop, bef, ch, aft) in step() argument
813 register struct re_guts *g; in step()
828 s = g->strip[pc];
860 cs = &g->sets[OPND(s)];
894 assert(OP(g->strip[pc+OPND(s)]) == OOR2);
900 OP(s = g->strip[pc+look]) != O_CH;
908 if (OP(g->strip[pc+OPND(s)]) != O_CH) {
909 assert(OP(g->strip[pc+OPND(s)]) == OOR2);
941 register struct re_guts *g = m->g; local
951 for (i = 0; i < g->nstates; i++)