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

27 lines
429 B
Sed
Raw Permalink Normal View History

1989-11-15 17:46:58 +00:00
/ISTART/c\
/* test bit fields */\
struct bfs {\
unsigned int bf1:1 ;\
unsigned int bf2:4 ;\
unsigned int bf3:8 ;\
unsigned int bf4:16 ;\
} bfs ;
s/FN/main/
/LSTART/c\
bfs.bf1=1 ; bfs.bf2=8 ;
/[XYZS]/s/.*/& ; printf("%s#","&"@) ;/
1989-11-17 16:37:20 +00:00
/Z1/s/#/ %u&/
1989-11-15 17:46:58 +00:00
/Z1/s/@/, Z1&/
1989-11-17 16:37:20 +00:00
/Z2/s/#/ %u&/
1989-11-15 17:46:58 +00:00
/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/@//