scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

generror.awk (323B)


      1 /^enum nerrors \{/     {print "char *errlist[] = {"; inhome = 1}
      2 
      3 inhome && /E[A-Z]*, /  {sub(/,/, "", $1)
      4                         printf("\t[%s] = \"", $1)
      5                         for (i = 3; i <= NF-1; ++i)
      6 				printf("%s%s", $i, (i == NF-1) ? "\"" : " ")
      7 			print ","}
      8 
      9 inhome && /^}/          {print "};" ; inhome = 0}