source: trunk/mkopcode_spec.awk @ 522

Last change on this file since 522 was 522, checked in by moo, 6 years ago

slide hits per second and hour

  • Property svn:eol-style set to native
File size: 661 bytes
RevLine 
[52]1#! /usr/bin/awk -f
[1]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        }
[522]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;
[1]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.