Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: third_party/sqlite/sqlite-src-3100200/tool/mkopcodec.tcl

Issue 1610543003: [sql] Import reference version of SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/sqlite-src-3100200/tool/mkopcodec.tcl
diff --git a/third_party/sqlite/sqlite-src-3100200/tool/mkopcodec.tcl b/third_party/sqlite/sqlite-src-3100200/tool/mkopcodec.tcl
new file mode 100644
index 0000000000000000000000000000000000000000..55d828b14df45747fb753f4aee170a957f4bbb3f
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3100200/tool/mkopcodec.tcl
@@ -0,0 +1,50 @@
+#!/usr/bin/tclsh
+#
+# This TCL script scans the opcodes.h file (which is itself generated by
+# another TCL 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.
+#
+puts "/* Automatically generated. Do not edit */"
+puts "/* See the tool/mkopcodec.tcl script for details. */"
+puts "#if !defined(SQLITE_OMIT_EXPLAIN) \\"
+puts " || defined(VDBE_PROFILE) \\"
+puts " || defined(SQLITE_DEBUG)"
+puts "#if defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) || defined(SQLITE_DEBUG)"
+puts "# define OpHelp(X) \"\\0\" X"
+puts "#else"
+puts "# define OpHelp(X)"
+puts "#endif"
+puts "const char *sqlite3OpcodeName(int i)\173"
+puts " static const char *const azName\[\] = \173 \"?\","
+set mx 0
+
+set in [open [lindex $argv 0] rb]
+while {![eof $in]} {
+ set line [gets $in]
+ if {[regexp {^#define OP_} $line]} {
+ set name [lindex $line 1]
+ regsub {^OP_} $name {} name
+ set i [lindex $line 2]
+ set label($i) $name
+ if {$mx<$i} {set mx $i}
+ if {[regexp {synopsis: (.*) \*/} $line all x]} {
+ set synopsis($i) [string trim $x]
+ } else {
+ set synopsis($i) {}
+ }
+ }
+}
+close $in
+
+for {set i 1} {$i<=$mx} {incr i} {
+ puts [format " /* %3d */ %-18s OpHelp(\"%s\")," \
+ $i \"$label($i)\" $synopsis($i)]
+}
+puts " \175;"
+puts " return azName\[i\];"
+puts "\175"
+puts "#endif"
« no previous file with comments | « third_party/sqlite/sqlite-src-3100200/tool/mkkeywordhash.c ('k') | third_party/sqlite/sqlite-src-3100200/tool/mkopcodeh.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698