ack/util/grind/make.ops
1990-08-31 18:22:53 +00:00

19 lines
317 B
Plaintext
Executable file

awk '
BEGIN { n = 0 }
{ print "#define " $1 " " n; n++
if ($3 !~ /0/) print "extern int " $3 "();" ;
}
' < $1 > ops.h
cat > ops.c <<'EOF'
#include "operator.h"
#include "ops.h"
t_operator operators[] = {
EOF
awk ' { print "{ " $2 ", " $3 "}, /* " $1 " */" }' < $1 >> ops.c
cat >> ops.c <<'EOF'
{ 0, 0 }
};
EOF