File: opNames.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 (23 lines) | stat: -rw-r--r-- 359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Read the sqliteVdbe.h file and generate a table of opcode names.
#
BEGIN {
  printf "static char *zOpName[] = { 0,\n"
  n = 0
}
/^#define OP_MAX/ {
  next
}
/^#define OP_/ {
  name = "\"" substr($2,4) "\","
  if( n<3 ){
    printf "  %-19s", name
    n++
  } else {
    printf "  %s\n", name
    n = 0
  }
}
END {
  if( n ){ printf "\n" }
  printf "};\n"
}