From: eck Date: Wed, 18 Jul 1990 16:31:32 +0000 (+0000) Subject: forgot pop_push.awk X-Git-Tag: release-5-5~1643 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=aca2c5f4b17a66f341e82649b461e6655e446770;p=ack.git forgot pop_push.awk --- diff --git a/util/opt/pop_push.awk b/util/opt/pop_push.awk new file mode 100644 index 000000000..ef3a6025c --- /dev/null +++ b/util/opt/pop_push.awk @@ -0,0 +1,30 @@ +BEGIN { print "#define CONDBRA '\001'" > "pop_push.h" + print "#define JUMP '\002'" >> "pop_push.h" + print "#define HASLABEL '\004'" >> "pop_push.h" + print "#include \"pop_push.h\"" + print + print "char *pop_push[] = {" + print "\"\"," + switch = 0 +} +/aar/ { switch = NR } + { if (switch) { + printf("\"%s\",\n",$3) + col_2[NR-switch] = $2 + } + } +END { print "};" + print + print "char flow_tab[]= {" + print "'\000'," + for(i=0; i < NR-switch; i++) { + inf = col_2[i] + f_out = "" + if (substr(inf,1,1)=="b") f_out = "HASLABEL|" + if (substr(inf,2,1)=="c") f_out = f_out "CONDBRA" + else if (substr(inf,2,1)=="t") f_out = f_out "JUMP" + else f_out = "'\000'" + print f_out"," + } + print "};" + }