| Line | |
|---|
| 1 | #! /usr/bin/awk -f |
|---|
| 2 | # vim:ts=4:sw=4 |
|---|
| 3 | # process eaccelerator/opcodes.c |
|---|
| 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 | comment = ""; |
|---|
| 18 | if (match($0, /\/\* (\d+) \*\//, comments)) { |
|---|
| 19 | comment = comments[1]; |
|---|
| 20 | } |
|---|
| 21 | printf "\tOPSPEC(%10s, %10s, %10s, %10s)%s\n", array[1], array[2], array[3], array[4], comment; |
|---|
| 22 | next |
|---|
| 23 | } |
|---|
| 24 | } |
|---|
| 25 | /^}/ { |
|---|
| 26 | print $0 |
|---|
| 27 | exit; |
|---|
| 28 | } |
|---|
| 29 | /^[ ]*,[ ]*$/ { |
|---|
| 30 | next |
|---|
| 31 | } |
|---|
| 32 | { |
|---|
| 33 | if (started) { |
|---|
| 34 | print $0 |
|---|
| 35 | next |
|---|
| 36 | } |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | /^static/ { |
|---|
| 40 | started = 1; |
|---|
| 41 | print "static const xc_opcode_spec_t xc_opcode_spec[] = {" |
|---|
| 42 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.