bloaty/third_party/re2/re2/prog.h
Go to the documentation of this file.
1 // Copyright 2007 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 
5 #ifndef RE2_PROG_H_
6 #define RE2_PROG_H_
7 
8 // Compiled representation of regular expressions.
9 // See regexp.h for the Regexp class, which represents a regular
10 // expression symbolically.
11 
12 #include <stdint.h>
13 #include <functional>
14 #include <mutex>
15 #include <string>
16 #include <vector>
17 #include <type_traits>
18 
19 #include "util/util.h"
20 #include "util/logging.h"
21 #include "util/pod_array.h"
22 #include "util/sparse_array.h"
23 #include "util/sparse_set.h"
24 #include "re2/re2.h"
25 
26 namespace re2 {
27 
28 // Opcodes for Inst
29 enum InstOp {
30  kInstAlt = 0, // choose between out_ and out1_
31  kInstAltMatch, // Alt: out_ is [00-FF] and back, out1_ is match; or vice versa.
32  kInstByteRange, // next (possible case-folded) byte must be in [lo_, hi_]
33  kInstCapture, // capturing parenthesis number cap_
34  kInstEmptyWidth, // empty-width special (^ $ ...); bit(s) set in empty_
35  kInstMatch, // found a match!
36  kInstNop, // no-op; occasionally unavoidable
37  kInstFail, // never match; occasionally unavoidable
39 };
40 
41 // Bit flags for empty-width specials
42 enum EmptyOp {
43  kEmptyBeginLine = 1<<0, // ^ - beginning of line
44  kEmptyEndLine = 1<<1, // $ - end of line
45  kEmptyBeginText = 1<<2, // \A - beginning of text
46  kEmptyEndText = 1<<3, // \z - end of text
47  kEmptyWordBoundary = 1<<4, // \b - word boundary
48  kEmptyNonWordBoundary = 1<<5, // \B - not \b
49  kEmptyAllFlags = (1<<6)-1,
50 };
51 
52 class DFA;
53 class Regexp;
54 
55 // Compiled form of regexp program.
56 class Prog {
57  public:
58  Prog();
59  ~Prog();
60 
61  // Single instruction in regexp program.
62  class Inst {
63  public:
64  // See the assertion below for why this is so.
65  Inst() = default;
66 
67  // Copyable.
68  Inst(const Inst&) = default;
69  Inst& operator=(const Inst&) = default;
70 
71  // Constructors per opcode
73  void InitByteRange(int lo, int hi, int foldcase, uint32_t out);
74  void InitCapture(int cap, uint32_t out);
76  void InitMatch(int id);
77  void InitNop(uint32_t out);
78  void InitFail();
79 
80  // Getters
81  int id(Prog* p) { return static_cast<int>(this - p->inst_.data()); }
82  InstOp opcode() { return static_cast<InstOp>(out_opcode_&7); }
83  int last() { return (out_opcode_>>3)&1; }
84  int out() { return out_opcode_>>4; }
85  int out1() { DCHECK(opcode() == kInstAlt || opcode() == kInstAltMatch); return out1_; }
86  int cap() { DCHECK_EQ(opcode(), kInstCapture); return cap_; }
87  int lo() { DCHECK_EQ(opcode(), kInstByteRange); return lo_; }
88  int hi() { DCHECK_EQ(opcode(), kInstByteRange); return hi_; }
91  int match_id() { DCHECK_EQ(opcode(), kInstMatch); return match_id_; }
93 
94  bool greedy(Prog* p) {
96  return p->inst(out())->opcode() == kInstByteRange ||
97  (p->inst(out())->opcode() == kInstNop &&
98  p->inst(p->inst(out())->out())->opcode() == kInstByteRange);
99  }
100 
101  // Does this inst (an kInstByteRange) match c?
102  inline bool Matches(int c) {
104  if (foldcase() && 'A' <= c && c <= 'Z')
105  c += 'a' - 'A';
106  return lo_ <= c && c <= hi_;
107  }
108 
109  // Returns string representation for debugging.
110  std::string Dump();
111 
112  // Maximum instruction id.
113  // (Must fit in out_opcode_. PatchList/last steal another bit.)
114  static const int kMaxInst = (1<<28) - 1;
115 
116  private:
118  out_opcode_ = (out()<<4) | (last()<<3) | opcode;
119  }
120 
121  void set_last() {
122  out_opcode_ = (out()<<4) | (1<<3) | opcode();
123  }
124 
125  void set_out(int out) {
126  out_opcode_ = (out<<4) | (last()<<3) | opcode();
127  }
128 
130  out_opcode_ = (out<<4) | (last()<<3) | opcode;
131  }
132 
133  uint32_t out_opcode_; // 28 bits: out, 1 bit: last, 3 (low) bits: opcode
134  union { // additional instruction arguments:
135  uint32_t out1_; // opcode == kInstAlt
136  // alternate next instruction
137 
138  int32_t cap_; // opcode == kInstCapture
139  // Index of capture register (holds text
140  // position recorded by capturing parentheses).
141  // For \n (the submatch for the nth parentheses),
142  // the left parenthesis captures into register 2*n
143  // and the right one captures into register 2*n+1.
144 
145  int32_t match_id_; // opcode == kInstMatch
146  // Match ID to identify this match (for re2::Set).
147 
148  struct { // opcode == kInstByteRange
149  uint8_t lo_; // byte range is lo_-hi_ inclusive
151  uint16_t hint_foldcase_; // 15 bits: hint, 1 (low) bit: foldcase
152  // hint to execution engines: the delta to the
153  // next instruction (in the current list) worth
154  // exploring iff this instruction matched; 0
155  // means there are no remaining possibilities,
156  // which is most likely for character classes.
157  // foldcase: A-Z -> a-z before checking range.
158  };
159 
160  EmptyOp empty_; // opcode == kInstEmptyWidth
161  // empty_ is bitwise OR of kEmpty* flags above.
162  };
163 
164  friend class Compiler;
165  friend struct PatchList;
166  friend class Prog;
167  };
168 
169  // Inst must be trivial so that we can freely clear it with memset(3).
170  // Arrays of Inst are initialised by copying the initial elements with
171  // memmove(3) and then clearing any remaining elements with memset(3).
172  static_assert(std::is_trivial<Inst>::value, "Inst must be trivial");
173 
174  // Whether to anchor the search.
175  enum Anchor {
176  kUnanchored, // match anywhere
177  kAnchored, // match only starting at beginning of text
178  };
179 
180  // Kind of match to look for (for anchor != kFullMatch)
181  //
182  // kLongestMatch mode finds the overall longest
183  // match but still makes its submatch choices the way
184  // Perl would, not in the way prescribed by POSIX.
185  // The POSIX rules are much more expensive to implement,
186  // and no one has needed them.
187  //
188  // kFullMatch is not strictly necessary -- we could use
189  // kLongestMatch and then check the length of the match -- but
190  // the matching code can run faster if it knows to consider only
191  // full matches.
192  enum MatchKind {
193  kFirstMatch, // like Perl, PCRE
194  kLongestMatch, // like egrep or POSIX
195  kFullMatch, // match only entire text; implies anchor==kAnchored
196  kManyMatch // for SearchDFA, records set of matches
197  };
198 
199  Inst *inst(int id) { return &inst_[id]; }
200  int start() { return start_; }
202  void set_start(int start) { start_ = start; }
204  int size() { return size_; }
205  bool reversed() { return reversed_; }
207  int list_count() { return list_count_; }
208  int inst_count(InstOp op) { return inst_count_[op]; }
211  int64_t dfa_mem() { return dfa_mem_; }
212  int flags() { return flags_; }
213  void set_flags(int flags) { flags_ = flags; }
214  bool anchor_start() { return anchor_start_; }
215  void set_anchor_start(bool b) { anchor_start_ = b; }
216  bool anchor_end() { return anchor_end_; }
217  void set_anchor_end(bool b) { anchor_end_ = b; }
218  int bytemap_range() { return bytemap_range_; }
219  const uint8_t* bytemap() { return bytemap_; }
220 
221  // Lazily computed.
222  int first_byte();
223 
224  // Returns string representation of program for debugging.
225  std::string Dump();
228 
229  // Returns the set of kEmpty flags that are in effect at
230  // position p within context.
231  static uint32_t EmptyFlags(const StringPiece& context, const char* p);
232 
233  // Returns whether byte c is a word character: ASCII only.
234  // Used by the implementation of \b and \B.
235  // This is not right for Unicode, but:
236  // - it's hard to get right in a byte-at-a-time matching world
237  // (the DFA has only one-byte lookahead).
238  // - even if the lookahead were possible, the Progs would be huge.
239  // This crude approximation is the same one PCRE uses.
240  static bool IsWordChar(uint8_t c) {
241  return ('A' <= c && c <= 'Z') ||
242  ('a' <= c && c <= 'z') ||
243  ('0' <= c && c <= '9') ||
244  c == '_';
245  }
246 
247  // Execution engines. They all search for the regexp (run the prog)
248  // in text, which is in the larger context (used for ^ $ \b etc).
249  // Anchor and kind control the kind of search.
250  // Returns true if match found, false if not.
251  // If match found, fills match[0..nmatch-1] with submatch info.
252  // match[0] is overall match, match[1] is first set of parens, etc.
253  // If a particular submatch is not matched during the regexp match,
254  // it is set to NULL.
255  //
256  // Matching text == StringPiece(NULL, 0) is treated as any other empty
257  // string, but note that on return, it will not be possible to distinguish
258  // submatches that matched that empty string from submatches that didn't
259  // match anything. Either way, match[i] == NULL.
260 
261  // Search using NFA: can find submatches but kind of slow.
262  bool SearchNFA(const StringPiece& text, const StringPiece& context,
263  Anchor anchor, MatchKind kind,
264  StringPiece* match, int nmatch);
265 
266  // Search using DFA: much faster than NFA but only finds
267  // end of match and can use a lot more memory.
268  // Returns whether a match was found.
269  // If the DFA runs out of memory, sets *failed to true and returns false.
270  // If matches != NULL and kind == kManyMatch and there is a match,
271  // SearchDFA fills matches with the match IDs of the final matching state.
272  bool SearchDFA(const StringPiece& text, const StringPiece& context,
273  Anchor anchor, MatchKind kind, StringPiece* match0,
274  bool* failed, SparseSet* matches);
275 
276  // The callback issued after building each DFA state with BuildEntireDFA().
277  // If next is null, then the memory budget has been exhausted and building
278  // will halt. Otherwise, the state has been built and next points to an array
279  // of bytemap_range()+1 slots holding the next states as per the bytemap and
280  // kByteEndText. The number of the state is implied by the callback sequence:
281  // the first callback is for state 0, the second callback is for state 1, ...
282  // match indicates whether the state is a matching state.
283  using DFAStateCallback = std::function<void(const int* next, bool match)>;
284 
285  // Build the entire DFA for the given match kind.
286  // Usually the DFA is built out incrementally, as needed, which
287  // avoids lots of unnecessary work.
288  // If cb is not empty, it receives one callback per state built.
289  // Returns the number of states built.
290  // FOR TESTING OR EXPERIMENTAL PURPOSES ONLY.
291  int BuildEntireDFA(MatchKind kind, const DFAStateCallback& cb);
292 
293  // Controls whether the DFA should bail out early if the NFA would be faster.
294  // FOR TESTING ONLY.
295  static void TEST_dfa_should_bail_when_slow(bool b);
296 
297  // Compute bytemap.
298  void ComputeByteMap();
299 
300  // Computes whether all matches must begin with the same first
301  // byte, and if so, returns that byte. If not, returns -1.
302  int ComputeFirstByte();
303 
304  // Run peep-hole optimizer on program.
305  void Optimize();
306 
307  // One-pass NFA: only correct if IsOnePass() is true,
308  // but much faster than NFA (competitive with PCRE)
309  // for those expressions.
310  bool IsOnePass();
311  bool SearchOnePass(const StringPiece& text, const StringPiece& context,
312  Anchor anchor, MatchKind kind,
313  StringPiece* match, int nmatch);
314 
315  // Bit-state backtracking. Fast on small cases but uses memory
316  // proportional to the product of the list count and the text size.
317  bool CanBitState() { return list_heads_.data() != NULL; }
318  bool SearchBitState(const StringPiece& text, const StringPiece& context,
319  Anchor anchor, MatchKind kind,
320  StringPiece* match, int nmatch);
321 
322  static const int kMaxOnePassCapture = 5; // $0 through $4
323 
324  // Backtracking search: the gold standard against which the other
325  // implementations are checked. FOR TESTING ONLY.
326  // It allocates a ton of memory to avoid running forever.
327  // It is also recursive, so can't use in production (will overflow stacks).
328  // The name "Unsafe" here is supposed to be a flag that
329  // you should not be using this function.
331  const StringPiece& context,
332  Anchor anchor, MatchKind kind,
333  StringPiece* match, int nmatch);
334 
335  // Computes range for any strings matching regexp. The min and max can in
336  // some cases be arbitrarily precise, so the caller gets to specify the
337  // maximum desired length of string returned.
338  //
339  // Assuming PossibleMatchRange(&min, &max, N) returns successfully, any
340  // string s that is an anchored match for this regexp satisfies
341  // min <= s && s <= max.
342  //
343  // Note that PossibleMatchRange() will only consider the first copy of an
344  // infinitely repeated element (i.e., any regexp element followed by a '*' or
345  // '+' operator). Regexps with "{N}" constructions are not affected, as those
346  // do not compile down to infinite repetitions.
347  //
348  // Returns true on success, false on error.
349  bool PossibleMatchRange(std::string* min, std::string* max, int maxlen);
350 
351  // EXPERIMENTAL! SUBJECT TO CHANGE!
352  // Outputs the program fanout into the given sparse array.
353  void Fanout(SparseArray<int>* fanout);
354 
355  // Compiles a collection of regexps to Prog. Each regexp will have
356  // its own Match instruction recording the index in the output vector.
357  static Prog* CompileSet(Regexp* re, RE2::Anchor anchor, int64_t max_mem);
358 
359  // Flattens the Prog from "tree" form to "list" form. This is an in-place
360  // operation in the sense that the old instructions are lost.
361  void Flatten();
362 
363  // Walks the Prog; the "successor roots" or predecessors of the reachable
364  // instructions are marked in rootmap or predmap/predvec, respectively.
365  // reachable and stk are preallocated scratch structures.
366  void MarkSuccessors(SparseArray<int>* rootmap,
367  SparseArray<int>* predmap,
368  std::vector<std::vector<int>>* predvec,
369  SparseSet* reachable, std::vector<int>* stk);
370 
371  // Walks the Prog from the given "root" instruction; the "dominator root"
372  // of the reachable instructions (if such exists) is marked in rootmap.
373  // reachable and stk are preallocated scratch structures.
374  void MarkDominator(int root, SparseArray<int>* rootmap,
375  SparseArray<int>* predmap,
376  std::vector<std::vector<int>>* predvec,
377  SparseSet* reachable, std::vector<int>* stk);
378 
379  // Walks the Prog from the given "root" instruction; the reachable
380  // instructions are emitted in "list" form and appended to flat.
381  // reachable and stk are preallocated scratch structures.
382  void EmitList(int root, SparseArray<int>* rootmap,
383  std::vector<Inst>* flat,
384  SparseSet* reachable, std::vector<int>* stk);
385 
386  // Computes hints for ByteRange instructions in [begin, end).
387  void ComputeHints(std::vector<Inst>* flat, int begin, int end);
388 
389  private:
390  friend class Compiler;
391 
392  DFA* GetDFA(MatchKind kind);
393  void DeleteDFA(DFA* dfa);
394 
395  bool anchor_start_; // regexp has explicit start anchor
396  bool anchor_end_; // regexp has explicit end anchor
397  bool reversed_; // whether program runs backward over input
398  bool did_flatten_; // has Flatten been called?
399  bool did_onepass_; // has IsOnePass been called?
400 
401  int start_; // entry point for program
402  int start_unanchored_; // unanchored entry point for program
403  int size_; // number of instructions
404  int bytemap_range_; // bytemap_[x] < bytemap_range_
405  int first_byte_; // required first byte for match, or -1 if none
406  int flags_; // regexp parse flags
407 
408  int list_count_; // count of lists (see above)
409  int inst_count_[kNumInst]; // count of instructions by opcode
410  PODArray<uint16_t> list_heads_; // sparse array enumerating list heads
411  // not populated if size_ is overly large
412 
413  PODArray<Inst> inst_; // pointer to instruction array
414  PODArray<uint8_t> onepass_nodes_; // data for OnePass nodes
415 
416  int64_t dfa_mem_; // Maximum memory for DFAs.
417  DFA* dfa_first_; // DFA cached for kFirstMatch/kManyMatch
418  DFA* dfa_longest_; // DFA cached for kLongestMatch/kFullMatch
419 
420  uint8_t bytemap_[256]; // map from input bytes to byte classes
421 
425 
426  Prog(const Prog&) = delete;
427  Prog& operator=(const Prog&) = delete;
428 };
429 
430 } // namespace re2
431 
432 #endif // RE2_PROG_H_
re2::Prog::dfa_longest_once_
std::once_flag dfa_longest_once_
Definition: bloaty/third_party/re2/re2/prog.h:424
re2::Prog::Inst::Matches
bool Matches(int c)
Definition: bloaty/third_party/re2/re2/prog.h:102
re2::Prog::Inst::greedy
bool greedy(Prog *p)
Definition: bloaty/third_party/re2/re2/prog.h:94
re2::Prog::Inst::out1_
uint32_t out1_
Definition: bloaty/third_party/re2/re2/prog.h:135
re2::kInstFail
@ kInstFail
Definition: bloaty/third_party/re2/re2/prog.h:37
re2::Prog::dfa_first_
DFA * dfa_first_
Definition: bloaty/third_party/re2/re2/prog.h:417
re2::Prog::set_anchor_start
void set_anchor_start(bool b)
Definition: bloaty/third_party/re2/re2/prog.h:215
re2::Prog::did_onepass_
bool did_onepass_
Definition: bloaty/third_party/re2/re2/prog.h:399
re2::Prog::Inst::hi
int hi()
Definition: bloaty/third_party/re2/re2/prog.h:88
re2::Prog::ComputeFirstByte
int ComputeFirstByte()
Definition: bloaty/third_party/re2/re2/nfa.cc:617
re2::Prog::list_count
int list_count()
Definition: bloaty/third_party/re2/re2/prog.h:207
re2::Prog::DumpUnanchored
std::string DumpUnanchored()
Definition: bloaty/third_party/re2/re2/prog.cc:166
re2::Compiler
Definition: bloaty/third_party/re2/re2/compile.cc:127
re2::Prog::Inst::InitCapture
void InitCapture(int cap, uint32_t out)
Definition: bloaty/third_party/re2/re2/prog.cc:40
re2::Prog::SearchOnePass
bool SearchOnePass(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match, int nmatch)
Definition: bloaty/third_party/re2/re2/onepass.cc:214
re2::Prog::Inst::out1
int out1()
Definition: bloaty/third_party/re2/re2/prog.h:85
pod_array.h
re2::Prog::flags
int flags()
Definition: bloaty/third_party/re2/re2/prog.h:212
re2::Prog::BuildEntireDFA
int BuildEntireDFA(MatchKind kind, const DFAStateCallback &cb)
Definition: bloaty/third_party/re2/re2/dfa.cc:2000
re2::Prog::reversed
bool reversed()
Definition: bloaty/third_party/re2/re2/prog.h:205
begin
char * begin
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1007
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
re2::Prog::kFullMatch
@ kFullMatch
Definition: bloaty/third_party/re2/re2/prog.h:195
re2::Prog::Inst
Definition: bloaty/third_party/re2/re2/prog.h:62
re2::Prog::Anchor
Anchor
Definition: bloaty/third_party/re2/re2/prog.h:175
re2::Prog::Prog
Prog()
Definition: bloaty/third_party/re2/re2/prog.cc:102
re2::Prog::reversed_
bool reversed_
Definition: bloaty/third_party/re2/re2/prog.h:397
re2::Prog::operator=
Prog & operator=(const Prog &)=delete
match
unsigned char match[65280+2]
Definition: bloaty/third_party/zlib/examples/gun.c:165
re2::Regexp
Definition: bloaty/third_party/re2/re2/regexp.h:274
re2::InstOp
InstOp
Definition: bloaty/third_party/re2/re2/prog.h:29
re2::Prog::did_flatten_
bool did_flatten_
Definition: bloaty/third_party/re2/re2/prog.h:398
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
re2::Prog::Inst::match_id_
int32_t match_id_
Definition: bloaty/third_party/re2/re2/prog.h:145
re2::PODArray::data
T * data() const
Definition: bloaty/third_party/re2/util/pod_array.h:24
re2::Prog::list_heads
uint16_t * list_heads()
Definition: bloaty/third_party/re2/re2/prog.h:209
re2::Prog::size_
int size_
Definition: bloaty/third_party/re2/re2/prog.h:403
re2::Prog::Inst::empty
EmptyOp empty()
Definition: bloaty/third_party/re2/re2/prog.h:92
re2::Prog::ComputeByteMap
void ComputeByteMap()
Definition: bloaty/third_party/re2/re2/prog.cc:446
re2::Prog::list_count_
int list_count_
Definition: bloaty/third_party/re2/re2/prog.h:408
re2::Prog::Inst::InitMatch
void InitMatch(int id)
re2::Prog::MarkSuccessors
void MarkSuccessors(SparseArray< int > *rootmap, SparseArray< int > *predmap, std::vector< std::vector< int >> *predvec, SparseSet *reachable, std::vector< int > *stk)
Definition: bloaty/third_party/re2/re2/prog.cc:646
re2::Prog::ComputeHints
void ComputeHints(std::vector< Inst > *flat, int begin, int end)
Definition: bloaty/third_party/re2/re2/prog.cc:844
re2::Prog::Inst::set_out
void set_out(int out)
Definition: bloaty/third_party/re2/re2/prog.h:125
re2
Definition: bloaty/third_party/re2/re2/bitmap256.h:17
re2::Prog::dfa_mem
int64_t dfa_mem()
Definition: bloaty/third_party/re2/re2/prog.h:211
xds_manager.p
p
Definition: xds_manager.py:60
re2::Prog::bytemap_range
int bytemap_range()
Definition: bloaty/third_party/re2/re2/prog.h:218
re2::Prog::Inst::cap
int cap()
Definition: bloaty/third_party/re2/re2/prog.h:86
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
re2::Prog::Inst::match_id
int match_id()
Definition: bloaty/third_party/re2/re2/prog.h:91
re2::Prog::Inst::set_out_opcode
void set_out_opcode(int out, InstOp opcode)
Definition: bloaty/third_party/re2/re2/prog.h:129
re2::kInstEmptyWidth
@ kInstEmptyWidth
Definition: bloaty/third_party/re2/re2/prog.h:34
re2::Prog::IsWordChar
static bool IsWordChar(uint8_t c)
Definition: bloaty/third_party/re2/re2/prog.h:240
re2::Prog::inst_count
int inst_count(InstOp op)
Definition: bloaty/third_party/re2/re2/prog.h:208
sparse_set.h
re2::Prog::first_byte_
int first_byte_
Definition: bloaty/third_party/re2/re2/prog.h:405
re2::Prog::CanBitState
bool CanBitState()
Definition: bloaty/third_party/re2/re2/prog.h:317
re2::Prog::GetDFA
DFA * GetDFA(MatchKind kind)
Definition: bloaty/third_party/re2/re2/dfa.cc:1818
re2::Prog::MatchKind
MatchKind
Definition: bloaty/third_party/re2/re2/prog.h:192
sparse_array.h
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
re2::kEmptyWordBoundary
@ kEmptyWordBoundary
Definition: bloaty/third_party/re2/re2/prog.h:47
re2::Prog::Inst::InitAlt
void InitAlt(uint32_t out, uint32_t out1)
Definition: bloaty/third_party/re2/re2/prog.cc:26
re2::Prog::DumpByteMap
std::string DumpByteMap()
Definition: bloaty/third_party/re2/re2/prog.cc:175
re2::SparseSetT
Definition: bloaty/third_party/re2/util/sparse_set.h:69
re2::kInstCapture
@ kInstCapture
Definition: bloaty/third_party/re2/re2/prog.h:33
re2::Prog::Inst::InitEmptyWidth
void InitEmptyWidth(EmptyOp empty, uint32_t out)
Definition: bloaty/third_party/re2/re2/prog.cc:46
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
re2::PatchList
Definition: bloaty/third_party/re2/re2/compile.cc:38
gen_server_registered_method_bad_client_test_body.text
def text
Definition: gen_server_registered_method_bad_client_test_body.py:50
google::protobuf.internal::once_flag
std::once_flag once_flag
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/once.h:43
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
root
RefCountedPtr< grpc_tls_certificate_provider > root
Definition: xds_server_config_fetcher.cc:223
re2::kEmptyNonWordBoundary
@ kEmptyNonWordBoundary
Definition: bloaty/third_party/re2/re2/prog.h:48
re2::Prog::anchor_end
bool anchor_end()
Definition: bloaty/third_party/re2/re2/prog.h:216
re2::EmptyOp
EmptyOp
Definition: bloaty/third_party/re2/re2/prog.h:42
re2::Prog::set_anchor_end
void set_anchor_end(bool b)
Definition: bloaty/third_party/re2/re2/prog.h:217
re2::SparseArray
Definition: bloaty/third_party/re2/util/sparse_array.h:110
re2::Prog::inst_
PODArray< Inst > inst_
Definition: bloaty/third_party/re2/re2/prog.h:413
re2::Prog::SearchBitState
bool SearchBitState(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match, int nmatch)
Definition: bloaty/third_party/re2/re2/bitstate.cc:350
re2::Prog::Inst::empty_
EmptyOp empty_
Definition: bloaty/third_party/re2/re2/prog.h:160
re2::Prog::set_reversed
void set_reversed(bool reversed)
Definition: bloaty/third_party/re2/re2/prog.h:206
re2::kEmptyAllFlags
@ kEmptyAllFlags
Definition: bloaty/third_party/re2/re2/prog.h:49
re2::Prog::EmitList
void EmitList(int root, SparseArray< int > *rootmap, std::vector< Inst > *flat, SparseSet *reachable, std::vector< int > *stk)
Definition: bloaty/third_party/re2/re2/prog.cc:774
re2::Prog::Flatten
void Flatten()
Definition: bloaty/third_party/re2/re2/prog.cc:557
re2::Prog::inst
Inst * inst(int id)
Definition: bloaty/third_party/re2/re2/prog.h:199
re2::Prog::inst_count_
int inst_count_[kNumInst]
Definition: bloaty/third_party/re2/re2/prog.h:409
re2::Prog::Inst::InitNop
void InitNop(uint32_t out)
Definition: bloaty/third_party/re2/re2/prog.cc:58
re2::Prog::kAnchored
@ kAnchored
Definition: bloaty/third_party/re2/re2/prog.h:177
re2::Prog::set_dfa_mem
void set_dfa_mem(int64_t dfa_mem)
Definition: bloaty/third_party/re2/re2/prog.h:210
re2::kEmptyBeginText
@ kEmptyBeginText
Definition: bloaty/third_party/re2/re2/prog.h:45
re2::kNumInst
@ kNumInst
Definition: bloaty/third_party/re2/re2/prog.h:38
re2::Prog::DeleteDFA
void DeleteDFA(DFA *dfa)
Definition: bloaty/third_party/re2/re2/dfa.cc:1847
re2::Prog::~Prog
~Prog()
Definition: bloaty/third_party/re2/re2/prog.cc:120
re2::Prog::Inst::last
int last()
Definition: bloaty/third_party/re2/re2/prog.h:83
re2::Prog::Inst::id
int id(Prog *p)
Definition: bloaty/third_party/re2/re2/prog.h:81
re2::Prog::set_start_unanchored
void set_start_unanchored(int start)
Definition: bloaty/third_party/re2/re2/prog.h:203
re2::Prog::size
int size()
Definition: bloaty/third_party/re2/re2/prog.h:204
re2::Prog::anchor_end_
bool anchor_end_
Definition: bloaty/third_party/re2/re2/prog.h:396
re2::Prog::Inst::kMaxInst
static const int kMaxInst
Definition: bloaty/third_party/re2/re2/prog.h:114
min
#define min(a, b)
Definition: qsort.h:83
re2::Prog::set_start
void set_start(int start)
Definition: bloaty/third_party/re2/re2/prog.h:202
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
re2::Prog::PossibleMatchRange
bool PossibleMatchRange(std::string *min, std::string *max, int maxlen)
Definition: bloaty/third_party/re2/re2/dfa.cc:2147
re2::Prog::kManyMatch
@ kManyMatch
Definition: bloaty/third_party/re2/re2/prog.h:196
re2::kInstAlt
@ kInstAlt
Definition: bloaty/third_party/re2/re2/prog.h:30
stdint.h
re2::Prog::bytemap
const uint8_t * bytemap()
Definition: bloaty/third_party/re2/re2/prog.h:219
re2::Prog::Inst::opcode
InstOp opcode()
Definition: bloaty/third_party/re2/re2/prog.h:82
re2::Prog::SearchDFA
bool SearchDFA(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match0, bool *failed, SparseSet *matches)
Definition: bloaty/third_party/re2/re2/dfa.cc:1861
re2::Prog::set_flags
void set_flags(int flags)
Definition: bloaty/third_party/re2/re2/prog.h:213
re2::DFA
Definition: bloaty/third_party/re2/re2/dfa.cc:77
re2::kEmptyEndLine
@ kEmptyEndLine
Definition: bloaty/third_party/re2/re2/prog.h:44
re2::Prog::IsOnePass
bool IsOnePass()
Definition: bloaty/third_party/re2/re2/onepass.cc:384
value
const char * value
Definition: hpack_parser_table.cc:165
re2::Prog::MarkDominator
void MarkDominator(int root, SparseArray< int > *rootmap, SparseArray< int > *predmap, std::vector< std::vector< int >> *predvec, SparseSet *reachable, std::vector< int > *stk)
Definition: bloaty/third_party/re2/re2/prog.cc:710
re2::Prog::Fanout
void Fanout(SparseArray< int > *fanout)
Definition: bloaty/third_party/re2/re2/nfa.cc:705
re2::Prog::kMaxOnePassCapture
static const int kMaxOnePassCapture
Definition: bloaty/third_party/re2/re2/prog.h:322
re2::Prog::Inst::foldcase
int foldcase()
Definition: bloaty/third_party/re2/re2/prog.h:89
re2::kInstNop
@ kInstNop
Definition: bloaty/third_party/re2/re2/prog.h:36
re2::Prog::Inst::set_opcode
void set_opcode(InstOp opcode)
Definition: bloaty/third_party/re2/re2/prog.h:117
re2::kInstMatch
@ kInstMatch
Definition: bloaty/third_party/re2/re2/prog.h:35
re2::Prog::Inst::out_opcode_
uint32_t out_opcode_
Definition: bloaty/third_party/re2/re2/prog.h:133
re2::kInstAltMatch
@ kInstAltMatch
Definition: bloaty/third_party/re2/re2/prog.h:31
absl::flags_internal
Definition: abseil-cpp/absl/flags/commandlineflag.h:40
re2::Prog::start_unanchored_
int start_unanchored_
Definition: bloaty/third_party/re2/re2/prog.h:402
re2::Prog::first_byte
int first_byte()
Definition: bloaty/third_party/re2/re2/prog.cc:188
re2::Prog
Definition: bloaty/third_party/re2/re2/prog.h:56
re2::Prog::anchor_start_
bool anchor_start_
Definition: bloaty/third_party/re2/re2/prog.h:395
DCHECK_EQ
#define DCHECK_EQ(val1, val2)
Definition: bloaty/third_party/re2/util/logging.h:20
re2::Prog::bytemap_
uint8_t bytemap_[256]
Definition: bloaty/third_party/re2/re2/prog.h:420
re2::Prog::anchor_start
bool anchor_start()
Definition: bloaty/third_party/re2/re2/prog.h:214
re2::Prog::dfa_longest_
DFA * dfa_longest_
Definition: bloaty/third_party/re2/re2/prog.h:418
next
AllocList * next[kMaxLevel]
Definition: abseil-cpp/absl/base/internal/low_level_alloc.cc:100
re2::Prog::Inst::out
int out()
Definition: bloaty/third_party/re2/re2/prog.h:84
re2::Prog::CompileSet
static Prog * CompileSet(Regexp *re, RE2::Anchor anchor, int64_t max_mem)
Definition: bloaty/third_party/re2/re2/compile.cc:1275
re2::Prog::Inst::operator=
Inst & operator=(const Inst &)=default
re2::Prog::Inst::hint_foldcase_
uint16_t hint_foldcase_
Definition: bloaty/third_party/re2/re2/prog.h:151
re2::Prog::Inst::InitFail
void InitFail()
Definition: bloaty/third_party/re2/re2/prog.cc:63
re2::Prog::start_unanchored
int start_unanchored()
Definition: bloaty/third_party/re2/re2/prog.h:201
re2::Prog::bytemap_range_
int bytemap_range_
Definition: bloaty/third_party/re2/re2/prog.h:404
re2::kEmptyEndText
@ kEmptyEndText
Definition: bloaty/third_party/re2/re2/prog.h:46
re2::Prog::kUnanchored
@ kUnanchored
Definition: bloaty/third_party/re2/re2/prog.h:176
re2::kEmptyBeginLine
@ kEmptyBeginLine
Definition: bloaty/third_party/re2/re2/prog.h:43
re2::Prog::first_byte_once_
std::once_flag first_byte_once_
Definition: bloaty/third_party/re2/re2/prog.h:422
re2::Prog::TEST_dfa_should_bail_when_slow
static void TEST_dfa_should_bail_when_slow(bool b)
Definition: bloaty/third_party/re2/re2/dfa.cc:2004
re2::Prog::list_heads_
PODArray< uint16_t > list_heads_
Definition: bloaty/third_party/re2/re2/prog.h:410
re2::Prog::kFirstMatch
@ kFirstMatch
Definition: bloaty/third_party/re2/re2/prog.h:193
re2::Prog::UnsafeSearchBacktrack
bool UnsafeSearchBacktrack(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match, int nmatch)
Definition: bloaty/third_party/re2/re2/testing/backtrack.cc:245
re2::Prog::Inst::lo
int lo()
Definition: bloaty/third_party/re2/re2/prog.h:87
re2::Prog::Inst::lo_
uint8_t lo_
Definition: bloaty/third_party/re2/re2/prog.h:149
re2::Prog::Inst::Dump
std::string Dump()
Definition: bloaty/third_party/re2/re2/prog.cc:68
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
re2::Prog::DFAStateCallback
std::function< void(const int *next, bool match)> DFAStateCallback
Definition: bloaty/third_party/re2/re2/prog.h:283
re2::RE2::Anchor
Anchor
Definition: bloaty/third_party/re2/re2/re2.h:472
re2::Prog::dfa_mem_
int64_t dfa_mem_
Definition: bloaty/third_party/re2/re2/prog.h:416
DCHECK
#define DCHECK(condition)
Definition: bloaty/third_party/re2/util/logging.h:19
re2::Prog::Inst::hi_
uint8_t hi_
Definition: bloaty/third_party/re2/re2/prog.h:150
re2::Prog::Inst::hint
int hint()
Definition: bloaty/third_party/re2/re2/prog.h:90
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
re2::Prog::Inst::cap_
int32_t cap_
Definition: bloaty/third_party/re2/re2/prog.h:138
re2::Prog::dfa_first_once_
std::once_flag dfa_first_once_
Definition: bloaty/third_party/re2/re2/prog.h:423
re2::Prog::flags_
int flags_
Definition: bloaty/third_party/re2/re2/prog.h:406
re2::Prog::onepass_nodes_
PODArray< uint8_t > onepass_nodes_
Definition: bloaty/third_party/re2/re2/prog.h:414
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
re2::Prog::Inst::Inst
Inst()=default
re2::StringPiece
Definition: bloaty/third_party/re2/re2/stringpiece.h:39
re2::Prog::Inst::InitByteRange
void InitByteRange(int lo, int hi, int foldcase, uint32_t out)
Definition: bloaty/third_party/re2/re2/prog.cc:32
opcode
opcode
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/upb.h:6290
re2::PODArray< uint16_t >
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
re2::Prog::kLongestMatch
@ kLongestMatch
Definition: bloaty/third_party/re2/re2/prog.h:194
re2::Prog::start_
int start_
Definition: bloaty/third_party/re2/re2/prog.h:401
re2::kInstByteRange
@ kInstByteRange
Definition: bloaty/third_party/re2/re2/prog.h:32
re2::Prog::EmptyFlags
static uint32_t EmptyFlags(const StringPiece &context, const char *p)
Definition: bloaty/third_party/re2/re2/prog.cc:287
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
re2::Prog::start
int start()
Definition: bloaty/third_party/re2/re2/prog.h:200
id
uint32_t id
Definition: flow_control_fuzzer.cc:70
re2::Prog::Dump
std::string Dump()
Definition: bloaty/third_party/re2/re2/prog.cc:157
re2::Prog::Optimize
void Optimize()
Definition: bloaty/third_party/re2/re2/prog.cc:198
re2::Prog::SearchNFA
bool SearchNFA(const StringPiece &text, const StringPiece &context, Anchor anchor, MatchKind kind, StringPiece *match, int nmatch)
Definition: bloaty/third_party/re2/re2/nfa.cc:677
re2::Prog::Inst::set_last
void set_last()
Definition: bloaty/third_party/re2/re2/prog.h:121


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:46