29    const char *search_tail = 
nullptr;  
 
   31    bool preorder(
const IR::Path *p)
 override {
 
   32        if (look_for.startsWith(p->name.name.string_view())) {
 
   33            search_tail = look_for.c_str() + p->name.name.size();
 
   34            if (*search_tail == 0 || *search_tail == 
'.' || *search_tail == 
'[') result = 
true;
 
   38    bool preorder(
const IR::Primitive *p)
 override {
 
   39        if (p->name == look_for) result = 
true;
 
   42    bool preorder(
const IR::Expression *)
 override { 
return !result; }
 
   44    void postorder(
const IR::Member *m)
 override {
 
   45        if (result && search_tail && *search_tail) {
 
   46            if (*search_tail == 
'.') search_tail++;
 
   47            if (
cstring(search_tail).startsWith(m->member.name.string_view())) {
 
   48                search_tail += m->member.name.size();
 
   49                if (*search_tail == 0 || *search_tail == 
'.' || *search_tail == 
'[') 
return;
 
   51            search_tail = 
nullptr;
 
   52            if (!m->expr->type->is<IR::Type_HeaderUnion>()) {
 
   57    void postorder(
const IR::ArrayIndex *m)
 override {
 
   58        if (result && search_tail && *search_tail) {
 
   59            if (*search_tail == 
'.' || *search_tail == 
'[') search_tail++;
 
   60            if (isdigit(*search_tail)) {
 
   61                int idx = strtol(search_tail, 
const_cast<char **
>(&search_tail), 10);
 
   62                if (*search_tail == 
']') search_tail++;
 
   63                if (
auto k = m->right->to<IR::Constant>()) {
 
   64                    if (k->asInt() == idx) 
return;
 
   70            search_tail = 
nullptr;
 
   73    void postorder(
const IR::PathExpression *)
 override {}
 
   74    void postorder(
const IR::Expression *)
 override { search_tail = 
nullptr; }
 
   81    explicit operator bool()
 const { 
return result; }