def METHOD_NAME(f, tables):
  print("namespace table_data {", file=f)
  print(file=f)
  print("using anomalous::e_fp_fdp;", file=f)
  print(file=f)
  for tab in tables[1:]:
    print("extern e_fp_fdp " + tab[0].lower() + "[];", file=f)
  print(file=f)
  print("static const anomalous::label_z_e_fp_fdp all[] = {", file=f)
  i = 0
  for tab in tables[1:]:
    i += 1
    print("{\"" + tab[0] + "\", " + str(i) + ", " + tab[0].lower() + "},", file=f)
  print("{0, 0, 0}", file=f)
  print("};", file=f)
  print("""
  } // namespace table_data
  table::table(
    std::string const& label,
    bool exact,
    bool exception_if_no_match)
  {
    std::string work_label = basic::strip_label(label, exact);
    label_z_e_fp_fdp_ = anomalous::find_entry(
      table_data::all, work_label, exact, exception_if_no_match);
  }
  fp_fdp
  table::at_ev(double energy) const
  {
    fp_fdp raw = anomalous::interpolate(label_z_e_fp_fdp_, energy);
    if (!raw.is_valid_fp()) return raw;
    // subtract the number of electrons
    return fp_fdp(raw.fp() - label_z_e_fp_fdp_->z, raw.fdp());
  }
  table_iterator::table_iterator()
  :
    current_("H", true)
  {}
  table
  table_iterator::next()
  {
    table result = current_;
    if (current_.is_valid()) current_.label_z_e_fp_fdp_++;
    return result;
  }