File: renumberOps.awk

package info (click to toggle)
sqlite 2.4.7-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,080 kB
  • ctags: 1,881
  • sloc: ansic: 21,330; tcl: 7,046; sh: 6,830; yacc: 474; makefile: 464; awk: 73
file content (12 lines) | stat: -rw-r--r-- 239 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# Run this script on sqliteVdbe.h to renumber the opcodes sequentially.
#
BEGIN { cnt = 1 }
/^#define OP_MAX/ {
  printf "#define %-20s %3d\n",$2, cnt-1
  next
}
/^#define OP_/ {
  printf "#define %-20s %3d\n",$2, cnt++
  next
}
{ print }