phase2.awk

mux2.0/src/phase2.awk · 372 B

From the archive mux-2.0.13.280.unix.tar.gz

Download the archive   « Back to the archive contents

#!/bin/nawk -f -
#
# Consume the output of 'analyse.sh', possible twiddled by
# hand, and generate a compresstab.h.
#
BEGIN {
	print "char *cmptab[] = {";
}

{
	if(NR >= 3965) {
		exit(0);
	}
	gsub(/^[0-9]* '/,"",$0);
	gsub(/'$/,"",$0);
	gsub(/\\/,"\\\\",$0);
	gsub(/'/,"\\\'",$0);
	gsub(/"/,"\\\"",$0);
	printf("\t\"%s\",\n", $0);
}

END {
	print "\tNULL";
	print "};"
}

Site Stats

Snippets: 1791
Codebases: 571