source: branches/1.2/mkopcode_spec.awk @ 394

Last change on this file since 394 was 394, checked in by moo, 8 years ago

merged [393] from trunk: svn:eol-style

  • Property svn:eol-style set to native
File size: 555 bytes
Line 
1#! /usr/bin/awk -f
2# vim:ts=4:sw=4
3# process eaccelerator/opcodes.c
4BEGIN {
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}
Note: See TracBrowser for help on using the repository browser.