generror.awk (375B)
1 /^enum nerrors \{/ {print "char *errlist[] = {"; inhome = 1} 2 3 inhome && /E[A-Z]*, / {sub(/,/, "", $1) 4 printf("\t[%s] = ", $1) 5 $1 = $2 = $NF = "" 6 sub(/^ */, "") 7 sub(/ *$/, "") 8 printf("\"%s\",\n", $0)} 9 inhome && /^}/ {print "};" ; inhome = 0}