BEGIN{ nact = 0; print "/* This file was created by bpol.awk --- do not edit */" print "CodeWord bpol[] = {" } { if ($1 !~ /#/) { nact++; if (nact != 1) {printf ",";}; if ($3 !~ /:/) {sym= $3;} else if ($2 ~ /P0/) {sym= "P_"$1;} else if ($2 ~ /Lib/) {sym= $1;} print "CodeWord(" sym ")"; } } END{ print "};" }