ack/lang/cem/ctest/ctgen/bf.sed

27 lines
393 B
Sed
Raw Normal View History

1985-02-06 21:25:27 +00:00
/ISTART/c\
/* test bit fields */\
struct bfs {\
int bf1:1 ;\
int bf2:4 ;\
int bf3:8 ;\
int bf4:16 ;\
} bfs ;
s/FN/main/
/LSTART/c\
bfs.bf1=1 ; bfs.bf2=8 ;
/[XYZS]/s/.*/& ; printf("%s#","&"@) ;/
/Z1/s/#/ %d&/
/Z1/s/@/, Z1&/
/Z2/s/#/ %d&/
/Z2/s/@/, Z2&/
/Z1/s/^/Z1 = 255 ; /
/Z2/s/^/Z2 = 3 ; /
/[XYZS]/s/^/ /
s/X/bfs.bf1/g
s/Y/bfs.bf2/g
s/S/1/g
s/Z1/bfs.bf3/g
s/Z2/bfs.bf4/g
s/#/\\n/
s/@//