Go to the documentation of this file.
35 #include "re2/regexp.h"
36 #include "util/logging.h"
40 #include "util/strutil.h"
63 bool anchored,
bool longest,
215 stk[nstk++] = {id0, NULL};
231 if (q->has_index(
id)) {
240 q->set_new(
id, NULL);
241 Thread** tp = &q->get_existing(
id);
247 LOG(DFATAL) <<
"unhandled " << ip->
opcode() <<
" in AddToThreadq";
264 stk[nstk++] = {
id+1, NULL};
267 a = {ip->
out(), NULL};
272 stk[nstk++] = {
id+1, NULL};
277 stk[nstk++] = {0,
t0};
285 a = {ip->
out(), NULL};
300 a = {
id+ip->
hint(), NULL};
318 stk[nstk++] = {
id+1, NULL};
323 a = {ip->
out(), NULL};
359 LOG(DFATAL) <<
"Unhandled " << ip->
opcode() <<
" in step";
375 for (++
i;
i != runq->
end(); ++
i)
414 for (++
i;
i != runq->
end(); ++
i)
431 if (capture[
i] == NULL)
433 else if (capture[
i+1] == NULL)
445 bool anchored,
bool longest,
456 LOG(DFATAL) <<
"context does not contain text";
471 LOG(DFATAL) <<
"Bad args: nsubmatch=" << nsubmatch;
479 if (nsubmatch == 0) {
495 fprintf(
stderr,
"NFA::Search %s (context: %s) anchored=%d longest=%d\n",
507 for (
const char* p =
text.data();; p++) {
517 fprintf(
stderr,
"%c:", c);
540 LOG(DFATAL) <<
"Unexpected opcode in short circuit: " << ip->
opcode();
575 if (!anchored && runq->
size() == 0 &&
576 fb >= 0 && p <
etext_ && (p[0] & 0xFF) != fb) {
577 p =
reinterpret_cast<const char*
>(memchr(p, fb,
etext_ - p));
592 if (runq->
size() == 0) {
594 fprintf(
stderr,
"dead\n");
603 for (
int i = 0;
i < nsubmatch;
i++)
608 fprintf(
stderr,
"match (%td,%td)\n",
626 LOG(DFATAL) <<
"unhandled " << ip->
opcode() <<
" in ComputeFirstByte";
638 if (ip->
lo() != ip->
hi())
640 if (ip->
foldcase() &&
'a' <= ip->
lo() && ip->
lo() <=
'z')
646 else if (
b != ip->
lo())
719 LOG(DFATAL) <<
"unhandled " << ip->
opcode() <<
" in Prog::Fanout()";
NFA & operator=(const NFA &)=delete
PODArray< AddState > stack_
void CopyCapture(const char **dst, const char **src)
return memset(p, 0, total)
#define DCHECK_LE(val1, val2)
unsigned char match[65280+2]
void resize(int new_max_size)
std::string FormatCapture(const char **capture)
static AllocList * Next(int i, AllocList *prev, LowLevelAlloc::Arena *arena)
int inst_count(InstOp op)
def c_str(s, encoding='ascii')
int Step(Threadq *runq, Threadq *nextq, int c, const StringPiece &context, const char *p)
std::string StringPrintf(const char *format,...)
Thread * Incref(Thread *t)
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
void AddToThreadq(Threadq *q, int id0, int c, const StringPiece &context, const char *p, Thread *t0)
iterator set_new(int i, const Value &v)
promise_detail::Loop< F > Loop(F f)
void Fanout(SparseArray< int > *fanout)
bool Search(const StringPiece &text, const StringPiece &context, bool anchored, bool longest, StringPiece *submatch, int nsubmatch)
#define DCHECK_EQ(val1, val2)
AllocList * next[kMaxLevel]
SparseArray< Thread * > Threadq
static const bool ExtraDebug
bool has_index(int i) const
grpc::ClientContext context
#define DCHECK(condition)
static uint32_t EmptyFlags(const StringPiece &context, const char *p)
bool SearchNFA(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match, int nmatch)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:31