3 # This AWK script scans the opcodes.h file (which is itself generated by
4 # another awk script) and uses the information gleaned to create the
5 # opcodes.c source file.
7 # Opcodes.c contains strings which are the symbolic names for the various
8 # opcodes used by the VDBE. These strings are used when disassembling a
9 # VDBE program during tracing or as a result of the EXPLAIN keyword.
12 print "/* Automatically generated. Do not edit */"
13 print "/* See the mkopcodec.awk script for details. */"
14 printf "#if !defined(SQLITE_OMIT_EXPLAIN)"
15 printf " || defined(VDBE_PROFILE)"
16 print " || defined(SQLITE_DEBUG)"
17 print "#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG)"
18 print "# define OpHelp(X) \"\\0\" X"
20 print "# define OpHelp(X)"
22 print "const char *sqlite3OpcodeName(int i){"
23 print " static const char *const azName[] = { \"?\","
31 for(j=
5; j
<NF; j
++) if( $j==
"synopsis:" ) break
35 for(j=j
+1; j
<NF; j
++) x = x
" " $j
43 printf " /* %3d */ %-18s OpHelp(\"%s\"),\n", i
, \
44 "\"" label
[i
] "\"", synopsis
[i
]
47 print " return azName[i];"