# This script produces the names.py file.

BEGIN {
    print "# Standard SPICE target names (generated by parse_zzidmap.awk)."""
    print ""
    print "target_name_pairs = ["
}

/^ *BLTCOD/ {
    n=$NF
}

/^ *BLTNAM/ {
    sub("[^']*", "")
    gsub(/''/, "\\'")
    print "    (" n ", " $0 "),"
}

END {
    print "    ]"
    print ""
    print "target_names = dict(target_name_pairs)"
}
