void
xml_compiler::remapclasses_initialize_vector_loader::traverse(const extracted_ptree& pt,
        const std::string& parent_tag_name)
{
    for (const auto& it : pt) {
        try {
            if (it.get_tag_name() != "identifier") {
                if (! it.children_empty()) {
                    traverse(it.children_extracted_ptree(), it.get_tag_name());
                }

            } else {
                auto attr_essential = it.get_optional("<xmlattr>.essential");
                if (attr_essential) {
                    continue;
                }

                // ----------------------------------------
                auto raw_identifier = boost::trim_copy(it.get_data());
                if (! xml_compiler_.valid_identifier_(raw_identifier, parent_tag_name)) {
                    continue;
                }
                auto identifier = raw_identifier;
                normalize_identifier_(identifier);

                // ----------------------------------------
                uint32_t config_index = symbol_map_.get("ConfigIndex", identifier);
                identifier_map_[config_index] = raw_identifier;

                // ----------------------------------------
                remapclasses_initialize_vector_.start(config_index, raw_identifier);
                {
                    auto attr_vk_config = it.get_optional("<xmlattr>.vk_config");
                    if (attr_vk_config) {
                        remapclasses_initialize_vector_.push_back(5);
                        remapclasses_initialize_vector_.push_back(BRIDGE_VK_CONFIG);

                        static const std::string names[] = {
                            "VK_CONFIG_TOGGLE_",
                            "VK_CONFIG_FORCE_ON_",
                            "VK_CONFIG_FORCE_OFF_",
                            "VK_CONFIG_SYNC_KEYDOWNUP_",
                        };
                        for (const auto& n : names) {
                            remapclasses_initialize_vector_.push_back(symbol_map_.get("KeyCode", n + identifier));
                        }
                    }

                    filter_vector_.clear();
                    traverse_autogen_(pt, identifier, raw_identifier);
                }
                remapclasses_initialize_vector_.end();
            }

        } catch (std::exception& e) {
            xml_compiler_.error_information_.set(e.what());
        }
    }
}
  void
  xml_compiler::remapclasses_initialize_vector_loader::traverse_autogen_(const extracted_ptree& pt,
                                                                         const std::string& identifier,
                                                                         const std::string& raw_identifier)
  {
    // Add passthrough filter.
    if (filter_vector_.empty() &&
        ! boost::starts_with(identifier, "passthrough_")) {
      filter_vector_.push_back(2); // count
      filter_vector_.push_back(BRIDGE_FILTERTYPE_CONFIG_NOT);
      filter_vector_.push_back(symbol_map_cache_configindex_notsave_passthrough_);
    }

    filter_vector_.traverse(pt);

    // ----------------------------------------
    for (const auto& it : pt) {
      if (it.get_tag_name() == "item") {
        xml_compiler_.error_information_.set(boost::format("You should not write <identifier> in <item> which has child <item> nodes.\nRemove <identifier>%1%</identifier>.") % raw_identifier);

      } else if (it.get_tag_name() != "autogen") {
        size_t s = filter_vector_.size();
        traverse_autogen_(it.children_extracted_ptree(), identifier, raw_identifier);
        filter_vector_.resize(s);

      } else {
        std::string raw_autogen = boost::trim_left_copy(it.get_data());

        // ----------------------------------------
        std::string autogen(raw_autogen);

        // Replacing -- with __ for compatibility.
        // * --KeyToKey-- before version 8.0.0.
        // * __KeyToKey__ since version 8.0.0.
        if (boost::starts_with(autogen, "--")) {
          autogen[0] = '_';
          autogen[1] = '_';
          boost::replace_first(autogen, "--", "__");
        }

        // drop whitespaces for preprocessor. (for FROMKEYCODE_HOME, etc)
        // Note: preserve space when __ShowStatusMessage__.
        if (! boost::starts_with(autogen, "__ShowStatusMessage__")) {
          pqrs::string::remove_whitespaces(autogen);
        }

        handle_autogen(autogen, raw_autogen);
      }
    }
  }