diff options
| author | geniusgogo <[email protected]> | 2013-11-13 22:27:45 +0800 |
|---|---|---|
| committer | geniusgogo <[email protected]> | 2013-11-30 14:59:51 +0800 |
| commit | a186d329a47ebe7f4a2481016407898028454fde (patch) | |
| tree | e983ff6d38238b55ac442aeaa7919a92b7d093ec /components/external/SQLite-3.8.1/mkopcodec.awk | |
| parent | 0347f8ab9c75f17d89d7f565f6a398dcbf0f700b (diff) | |
add SQLite-3.8.1 authority original source tree
Diffstat (limited to 'components/external/SQLite-3.8.1/mkopcodec.awk')
| -rw-r--r-- | components/external/SQLite-3.8.1/mkopcodec.awk | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/components/external/SQLite-3.8.1/mkopcodec.awk b/components/external/SQLite-3.8.1/mkopcodec.awk new file mode 100644 index 0000000000..2ef77d4cca --- /dev/null +++ b/components/external/SQLite-3.8.1/mkopcodec.awk @@ -0,0 +1,36 @@ +#!/usr/bin/awk -f +# +# This AWK script scans the opcodes.h file (which is itself generated by +# another awk script) and uses the information gleaned to create the +# opcodes.c source file. +# +# Opcodes.c contains strings which are the symbolic names for the various +# opcodes used by the VDBE. These strings are used when disassembling a +# VDBE program during tracing or as a result of the EXPLAIN keyword. +# +BEGIN { + print "/* Automatically generated. Do not edit */" + print "/* See the mkopcodec.awk script for details. */" + printf "#if !defined(SQLITE_OMIT_EXPLAIN)" + printf " || !defined(NDEBUG)" + printf " || defined(VDBE_PROFILE)" + print " || defined(SQLITE_DEBUG)" + print "const char *sqlite3OpcodeName(int i){" + print " static const char *const azName[] = { \"?\"," + mx = 0 +} +/define OP_/ { + sub("OP_","",$2) + i = $3+0 + label[i] = $2 + if( mx<i ) mx = i +} +END { + for(i=1; i<=mx; i++){ + printf " /* %3d */ \"%s\",\n", i, label[i] + } + print " };" + print " return azName[i];" + print "}" + print "#endif" +} |
