Changeset 169 for trunk/mkstructinfo.awk
- Timestamp:
- 2006-09-16T03:09:22+02:00 (7 years ago)
- File:
-
- 1 edited
-
trunk/mkstructinfo.awk (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/mkstructinfo.awk
r52 r169 4 4 brace = 0; 5 5 buffer_len = 0; 6 } 7 /^#/ { 8 next; 6 9 } 7 10 /^}.*;/ { … … 51 54 { 52 55 if (brace == 1 && instruct) { 56 gsub(/\/\*(.+?)\*\//, " "); # removes one line comment 53 57 sub(/.*[{}]/, ""); 54 58 gsub(/\[[^\]]+\]/, ""); # ignore [...] … … 69 73 next; 70 74 } 75 # unsigned int *a, b; int c; 71 76 gsub(/[*]/, " "); 77 # unsigned int a, b; int c; 72 78 gsub(/ +/, " "); 79 # unsigned int a, b; int c; 73 80 gsub(/ *[,;]/, ";"); 81 # unsigned int a; b; int c; 74 82 if (!match($0, /;/)) { 75 83 next; 76 84 } 77 85 split($0, chunks, ";"); 78 # get var of "int *var, var;" etc 79 for (i in chunks) { 86 # [unsigned int a, b, c] 87 88 for (i = 1; i in chunks; i ++) { 80 89 if (chunks[i] == "") { 81 90 delete chunks[i]; … … 83 92 } 84 93 split(chunks[i], pieces, " "); 94 # [unsigned, int, a] 95 # [b] 96 # [c] 85 97 86 for (j in pieces) { 98 last_piece = ""; 99 for (j = 1; j in pieces; j ++) { 87 100 last_piece = pieces[j]; 88 delete pieces[ i];101 delete pieces[j]; 89 102 } 90 103 if (last_piece == "") { 91 104 print "=====" chunks[i]; 92 105 } 106 # a 107 # b 108 # c 109 93 110 buffer[buffer_len] = last_piece; 94 111 buffer_len ++; 95 delete chunks[i] ;112 delete chunks[i] 96 113 } 114 last_piece = ""; 97 115 } 98 116 next;
Note: See TracChangeset
for help on using the changeset viewer.

