shithub: scc

ref: 22bcaee6b85ae9fd458b5b5717847d00b7b8599f
dir: /cc2/generror.awk/

View raw version
/^enum nerrors \{/     {print "char *errlist[] = {"; inhome = 1}

inhome && /E[A-Z]*, /  {sub(/,/, "", $1)
                        printf("\t[%s] = \"", $1)
                        for (i = 3; i <= NF-1; ++i)
				printf("%s%s", $i, (i == NF-1) ? "\"" : " ")
			print ","}

inhome && /^}/          {print "};" ; inhome = 0}