Home | History | Annotate | Download | only in re2

Lines Matching refs:params

290   // Fills in params->start and params->firstbyte using
294 bool AnalyzeSearch(SearchParams* params);
295 bool AnalyzeSearchHelper(SearchParams* params, StartInfo* info, uint flags);
299 // Might unlock and relock cache_mutex_ via params->cache_lock.
300 inline bool InlinedSearchLoop(SearchParams* params,
309 // Might unlock and relock cache_mutex_ via params->cache_lock.
310 bool SearchFFF(SearchParams* params);
311 bool SearchFFT(SearchParams* params);
312 bool SearchFTF(SearchParams* params);
313 bool SearchFTT(SearchParams* params);
314 bool SearchTFF(SearchParams* params);
315 bool SearchTFT(SearchParams* params);
316 bool SearchTTF(SearchParams* params);
317 bool SearchTTT(SearchParams* params);
322 // Might unlock and relock cache_mutex_ via params->cache_lock.
323 bool FastSearchLoop(SearchParams* params);
330 // Might unlock and relock cache_mutex_ via params->cache_lock.
331 bool SlowSearchLoop(SearchParams* params);
1315 // The bools are equal to the same-named variables in params, but
1318 inline bool DFA::InlinedSearchLoop(SearchParams* params,
1322 State* start = params->start;
1323 const uint8* bp = BytePtr(params->text.begin()); // start of text
1325 const uint8* ep = BytePtr(params->text.end()); // end of text
1339 params->ep = reinterpret_cast<const char*>(lastmatch);
1354 if ((p = BytePtr(memchr(p, params->firstbyte, ep - p))) == NULL) {
1359 if ((p = BytePtr(memrchr(ep, params->firstbyte, p - ep))) == NULL) {
1407 params->failed = true;
1417 ResetCache(params->cache_lock);
1423 params->failed = true;
1429 params->failed = true;
1436 params->ep = reinterpret_cast<const char*>(lastmatch);
1440 params->ep = reinterpret_cast<const char*>(ep);
1459 params->ep = reinterpret_cast<const char*>(lastmatch);
1469 if (params->text.end() == params->context.end())
1472 lastbyte = params->text.end()[0] & 0xFF;
1474 if (params->text.begin() == params->context.begin())
1477 lastbyte = params->text.begin()[-1] & 0xFF;
1487 ResetCache(params->cache_lock);
1489 params->failed = true;
1495 params->failed = true;
1504 params->ep = reinterpret_cast<const char*>(ep);
1510 if (params->matches && kind_ == Prog::kManyMatch) {
1511 vector<int>* v = params->matches;
1523 params->ep = reinterpret_cast<const char*>(lastmatch);
1528 bool DFA::SearchFFF(SearchParams* params) {
1529 return InlinedSearchLoop(params, 0, 0, 0);
1531 bool DFA::SearchFFT(SearchParams* params) {
1532 return InlinedSearchLoop(params, 0, 0, 1);
1534 bool DFA::SearchFTF(SearchParams* params) {
1535 return InlinedSearchLoop(params, 0, 1, 0);
1537 bool DFA::SearchFTT(SearchParams* params) {
1538 return InlinedSearchLoop(params, 0, 1, 1);
1540 bool DFA::SearchTFF(SearchParams* params) {
1541 return InlinedSearchLoop(params, 1, 0, 0);
1543 bool DFA::SearchTFT(SearchParams* params) {
1544 return InlinedSearchLoop(params, 1, 0, 1);
1546 bool DFA::SearchTTF(SearchParams* params) {
1547 return InlinedSearchLoop(params, 1, 1, 0);
1549 bool DFA::SearchTTT(SearchParams* params) {
1550 return InlinedSearchLoop(params, 1, 1, 1);
1554 bool DFA::SlowSearchLoop(SearchParams* params) {
1555 return InlinedSearchLoop(params,
1556 params->firstbyte >= 0,
1557 params->want_earliest_match,
1558 params->run_forward);
1563 bool DFA::FastSearchLoop(SearchParams* params) {
1577 bool have_firstbyte = (params->firstbyte >= 0);
1579 2 * params->want_earliest_match +
1580 1 * params->run_forward;
1581 return (this->*Searches[index])(params);
1609 // state for the DFA search loop. Fills in params and returns true on success.
1611 bool DFA::AnalyzeSearch(SearchParams* params) {
1612 const StringPiece& text = params->text;
1613 const StringPiece& context = params->context;
1618 params->start = DeadState;
1625 if (params->run_forward) {
1654 if (params->anchored || prog_->anchor_start())
1661 if (!AnalyzeSearchHelper(params, info, flags)) {
1662 ResetCache(params->cache_lock);
1663 if (!AnalyzeSearchHelper(params, info, flags)) {
1665 params->failed = true;
1672 params->anchored, params->run_forward, flags,
1675 params->start = info->start;
1676 params->firstbyte = ANNOTATE_UNPROTECTED_READ(info->firstbyte);
1682 bool DFA::AnalyzeSearchHelper(SearchParams* params, StartInfo* info,
1698 params->anchored ? prog_->start() : prog_->start_unanchored(),
1770 SearchParams params(text, context, &l);
1771 params.anchored = anchored;
1772 params.want_earliest_match = want_earliest_match;
1773 params.run_forward = run_forward;
1774 params.matches = matches;
1776 if (!AnalyzeSearch(&params)) {
1780 if (params.start == DeadState)
1782 if (params.start == FullMatchState) {
1790 fprintf(stderr, "start %s\n", DumpState(params.start).c_str());
1791 bool ret = FastSearchLoop(&params);
1792 if (params.failed) {
1796 *epp = params.ep;
1941 SearchParams params(NULL, NULL, &l);
1942 params.anchored = false;
1943 if (!AnalyzeSearch(&params) || params.start <= SpecialStateMax)
1949 queued.insert(params.start);
1950 q.push_back(params.start);
1996 SearchParams params(NULL, NULL, &l);
1997 params.anchored = true;
1998 if (!AnalyzeSearch(&params))
2000 if (params.start == DeadState) { // No matching strings
2005 if (params.start == FullMatchState) // Every string matches: no max
2008 // The DFA is essentially a big graph rooted at params.start,
2034 State* s = params.start;
2071 s = params.start;