|
Revision 52, 0.5 kB
(checked in by moo, 2 years ago)
|
|
bc with old bsd for devel
|
| Line | |
|---|
| 1 | #! /usr/bin/awk -f |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | BEGIN { |
|---|
| 5 | FS=" " |
|---|
| 6 | max = 0; |
|---|
| 7 | started = 0 |
|---|
| 8 | } |
|---|
| 9 | |
|---|
| 10 | /OPDEF/ { |
|---|
| 11 | if (started) { |
|---|
| 12 | sub(/".*"/, "") |
|---|
| 13 | if (!match($0, /EXT_([^ |]+).*OP[1S]_([^ |]+).*OP2_([^ |]+).*RES_([^ |)]+).*/, array)) { |
|---|
| 14 | print "error" $0 |
|---|
| 15 | exit |
|---|
| 16 | } |
|---|
| 17 | printf "\tOPSPEC(%10s, %10s, %10s, %10s)\n", array[1], array[2], array[3], array[4] |
|---|
| 18 | next |
|---|
| 19 | } |
|---|
| 20 | } |
|---|
| 21 | /^}/ { |
|---|
| 22 | print $0 |
|---|
| 23 | exit; |
|---|
| 24 | } |
|---|
| 25 | /^[ ]*,[ ]*$/ { |
|---|
| 26 | next |
|---|
| 27 | } |
|---|
| 28 | { |
|---|
| 29 | if (started) { |
|---|
| 30 | print $0 |
|---|
| 31 | next |
|---|
| 32 | } |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | /^static/ { |
|---|
| 36 | started = 1; |
|---|
| 37 | print "static const xc_opcode_spec_t xc_opcode_spec[] = {" |
|---|
| 38 | } |
|---|