|
Revision 564, 0.7 KB
(checked in by moo, 5 years ago)
|
|
add id/name in comment to make it more readable
|
-
Property svn:eol-style set to
native
|
| Rev | Line | |
|---|
| [52] | 1 | #! /usr/bin/awk -f |
|---|
| [1] | 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 | if (!match($0, /EXT_([^ |]+).*OP[1S]_([^ |]+).*OP2_([^ |]+).*RES_([^ |)]+).*/, array)) { |
|---|
| 13 | print "error" $0 |
|---|
| 14 | exit |
|---|
| 15 | } |
|---|
| [564] | 16 | id = ""; |
|---|
| 17 | if (match($0, /\/\* *([0-9]+) *\*\//, m)) { |
|---|
| 18 | id = m[1]; |
|---|
| [522] | 19 | } |
|---|
| [564] | 20 | name = ""; |
|---|
| 21 | if (match($0, /"([^"]+)"/, m)) { |
|---|
| 22 | name = m[1]; |
|---|
| 23 | } |
|---|
| 24 | printf "\tOPSPEC(%10s, %10s, %10s, %10s) /* %s %s */\n", array[1], array[2], array[3], array[4], id, name; |
|---|
| [1] | 25 | next |
|---|
| 26 | } |
|---|
| 27 | } |
|---|
| 28 | /^}/ { |
|---|
| 29 | print $0 |
|---|
| 30 | exit; |
|---|
| 31 | } |
|---|
| 32 | /^[ ]*,[ ]*$/ { |
|---|
| 33 | next |
|---|
| 34 | } |
|---|
| 35 | { |
|---|
| 36 | if (started) { |
|---|
| 37 | print $0 |
|---|
| 38 | next |
|---|
| 39 | } |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | /^static/ { |
|---|
| 43 | started = 1; |
|---|
| 44 | print "static const xc_opcode_spec_t xc_opcode_spec[] = {" |
|---|
| 45 | } |
|---|