ack/util/grind/make.ops

19 lines
317 B
Plaintext
Raw Normal View History

1990-08-31 18:22:53 +00:00
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