5 #ifndef RE2_WALKER_INL_H_
6 #define RE2_WALKER_INL_H_
18 #include "util/logging.h"
19 #include "re2/regexp.h"
51 T* child_args,
int nchild_args);
137 stack_ =
new std::stack<WalkState<T> >;
138 stopped_early_ =
false;
151 LOG(DFATAL) <<
"Stack not empty.";
152 while (
stack_->size() > 0) {
153 delete stack_->top().child_args;
164 LOG(DFATAL) <<
"Walk NULL";
177 if (--max_visits_ < 0) {
178 stopped_early_ =
true;
179 t = ShortVisit(re, s->parent_arg);
183 s->pre_arg = PreVisit(re, s->parent_arg, &
stop);
189 s->child_args = NULL;
191 s->child_args = &s->child_arg;
192 else if (re->
nsub_ > 1)
193 s->child_args =
new T[re->
nsub_];
199 if (s->n < re->
nsub_) {
200 if (use_copy && s->n > 0 && sub[s->n - 1] == sub[s->n]) {
201 s->child_args[s->n] =
Copy(s->child_args[s->n - 1]);
210 t = PostVisit(re, s->parent_arg, s->pre_arg, s->child_args, s->n);
212 delete[] s->child_args;
223 if (s->child_args != NULL)
224 s->child_args[s->n] = t;
236 max_visits_ = 1000000;
237 return WalkInternal(re, top_arg,
true);
242 max_visits_ = max_visits;
243 return WalkInternal(re, top_arg,
false);
248 #endif // RE2_WALKER_INL_H_