ack/modules/src/em_code/make.em.gen
2007-02-25 12:46:11 +00:00

19 lines
665 B
Bash
Executable file

#!/bin/sh
echo "/* this part is generated from $1 at: " `date` "*/"
ed -s $1 <<'EOI'
1,/^$/d
1,/^$/d
1,$s/^\(...\) \(.\).*/\1:\2/
g/:d/s/^\(...\):\(.\).*/#define C_\1(c) CC_opcst(op_\1, c)/
g/:[cslnfzor]/s/^\(...\):\(.\).*/#define C_\1(c) CC_opcst(op_\1, c)/
g/:w/s/^\(...\).*/#define C_\1(w) CC_opcst(op_\1, w)\
#define C_\1_narg() CC_opnarg(op_\1)/
g/:g/s/^\(...\).*/#define C_\1(g) CC_opcst(op_\1, g)\
#define C_\1_dnam(g, o) CC_opdnam(op_\1, g, o)\
#define C_\1_dlb(g, o) CC_opdlb(op_\1, g, o)/
g/:p/s/^\(...\).*/#define C_\1(p) CC_oppnam(op_\1, p)/
g/:b/s/^\(...\).*/#define C_\1(b) CC_opilb(op_\1, b)/
g/:-/s/^\(...\).*/#define C_\1() CC_op(op_\1)/
1,$p
EOI