blob: 6119272bd7326466ceb79b854b04c38632e662a6 [file] [log] [blame]
drhb327f772004-10-06 15:03:57 +00001#!/usr/bin/awk -f
2#
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.
6#
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.
10#
11BEGIN {
12 print "/* Automatically generated. Do not edit */"
13 print "/* See the mkopcodec.h script for details. */"
drh57196282004-10-06 15:41:16 +000014 print "const char *const sqlite3OpcodeNames[] = { \"?\","
drhb327f772004-10-06 15:03:57 +000015}
16/^#define OP_/ {
17 sub("OP_","",$2)
18 print " \"" $2 "\","
19}
20END {
21 print "};"
22}