• Home
  • Raw
  • Download

Lines Matching refs:g

72 	struct re_guts *g;  member
128 matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], in matcher() argument
136 const sopno gf = g->firststate+1; /* +1 for OEND */ in matcher()
137 const sopno gl = g->laststate; in matcher()
142 if (g->cflags&REG_NOSUB) in matcher()
155 if (g->must != NULL) { in matcher()
157 if (*dp == g->must[0] && stop - dp >= g->mlen && in matcher()
158 memcmp(dp, g->must, (size_t)g->mlen) == 0) in matcher()
165 m->g = g; in matcher()
188 if (nmatch == 0 && !g->backrefs) in matcher()
201 if (nmatch == 1 && !g->backrefs) in matcher()
206 m->pmatch = (regmatch_t *)malloc((m->g->nsub + 1) * in matcher()
212 for (i = 1; i <= (int)m->g->nsub; i++) in matcher()
214 if (!g->backrefs && !(m->eflags&REG_BACKR)) { in matcher()
218 if (g->nplus > 0 && m->lastpos == NULL) in matcher()
219 m->lastpos = (char **)malloc((g->nplus+1) * in matcher()
221 if (g->nplus > 0 && m->lastpos == NULL) { in matcher()
233 assert(g->backrefs); /* must be back references doing it */ in matcher()
234 assert(g->nplus == 0 || m->lastpos != NULL); in matcher()
244 for (i = 1; i <= m->g->nsub; i++) { in matcher()
271 if (i <= (int)m->g->nsub) in matcher()
311 switch (OP(m->g->strip[es])) { in dissect()
314 es += OPND(m->g->strip[es]); in dissect()
317 while (OP(m->g->strip[es]) != O_CH) in dissect()
318 es += OPND(m->g->strip[es]); in dissect()
324 switch (OP(m->g->strip[ss])) { in dissect()
422 esub = ss + OPND(m->g->strip[ss]) - 1; in dissect()
423 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
428 assert(OP(m->g->strip[esub]) == OOR1); in dissect()
430 assert(OP(m->g->strip[esub]) == OOR2); in dissect()
432 esub += OPND(m->g->strip[esub]); in dissect()
433 if (OP(m->g->strip[esub]) == OOR2) in dissect()
436 assert(OP(m->g->strip[esub]) == O_CH); in dissect()
451 i = OPND(m->g->strip[ss]); in dissect()
452 assert(0 < i && i <= m->g->nsub); in dissect()
456 i = OPND(m->g->strip[ss]); in dissect()
457 assert(0 < i && i <= m->g->nsub); in dissect()
496 switch (OP(s = m->g->strip[ss])) { in backref()
507 cs = &m->g->sets[OPND(s)]; in backref()
514 (m->g->cflags&REG_NEWLINE)) ) in backref()
522 (m->g->cflags&REG_NEWLINE)) ) in backref()
530 (m->g->cflags&REG_NEWLINE)) || in backref()
541 (m->g->cflags&REG_NEWLINE)) || in backref()
552 s = m->g->strip[ss]; in backref()
556 } while (OP(s = m->g->strip[ss]) != O_CH); in backref()
572 s = m->g->strip[ss]; in backref()
576 assert(0 < i && i <= m->g->nsub); in backref()
589 while (m->g->strip[ss] != SOP(O_BACK, i)) in backref()
601 assert(lev+1 <= m->g->nplus); in backref()
619 assert(OP(m->g->strip[esub]) == OOR1); in backref()
625 if (OP(m->g->strip[esub]) == O_CH) in backref()
628 assert(OP(m->g->strip[esub]) == OOR2); in backref()
630 esub += OPND(m->g->strip[esub]); in backref()
631 if (OP(m->g->strip[esub]) == OOR2) in backref()
634 assert(OP(m->g->strip[esub]) == O_CH); in backref()
639 assert(0 < i && i <= m->g->nsub); in backref()
650 assert(0 < i && i <= m->g->nsub); in backref()
688 st = step(m->g, startst, stopst, st, NOTHING, st); in fast()
702 if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) || in fast()
705 i = m->g->nbol; in fast()
707 if ( (c == '\n' && m->g->cflags&REG_NEWLINE) || in fast()
710 i += m->g->neol; in fast()
714 st = step(m->g, startst, stopst, st, flagch, st); in fast()
728 st = step(m->g, startst, stopst, st, flagch, st); in fast()
740 st = step(m->g, startst, stopst, tmp, c, st); in fast()
742 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); in fast()
774 st = step(m->g, startst, stopst, st, NOTHING, st); in slow()
784 if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) || in slow()
787 i = m->g->nbol; in slow()
789 if ( (c == '\n' && m->g->cflags&REG_NEWLINE) || in slow()
792 i += m->g->neol; in slow()
796 st = step(m->g, startst, stopst, st, flagch, st); in slow()
810 st = step(m->g, startst, stopst, st, flagch, st); in slow()
824 st = step(m->g, startst, stopst, tmp, c, st); in slow()
826 assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); in slow()
838 step(struct re_guts *g, in step() argument
853 s = g->strip[pc]; in step()
885 cs = &g->sets[OPND(s)]; in step()
919 assert(OP(g->strip[pc+OPND(s)]) == OOR2); in step()
925 OP(s = g->strip[pc+look]) != O_CH; in step()
933 if (OP(g->strip[pc+OPND(s)]) != O_CH) { in step()
934 assert(OP(g->strip[pc+OPND(s)]) == OOR2); in step()
957 struct re_guts *g = m->g; in print() local
967 for (i = 0; i < g->nstates; i++) in print()