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

Unified Diff: third_party/sqlite/sqlite-src-3100200/tool/addopcodes.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/addopcodes.tcl
diff --git a/third_party/sqlite/sqlite-src-3100200/tool/addopcodes.tcl b/third_party/sqlite/sqlite-src-3100200/tool/addopcodes.tcl
new file mode 100644
index 0000000000000000000000000000000000000000..84e3994ce8c8f9df536b9bd67b13c15f2dff5bdf
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3100200/tool/addopcodes.tcl
@@ -0,0 +1,63 @@
+#!/usr/bin/tclsh
+#
+# This script appends additional token codes to the end of the
+# parse.h file that lemon generates. These extra token codes are
+# not used by the parser. But they are used by the tokenizer and/or
+# the code generator.
+#
+#
+set in [open [lindex $argv 0] rb]
+set max 0
+while {![eof $in]} {
+ set line [gets $in]
+ if {[regexp {^#define TK_} $line]} {
+ puts $line
+ set x [lindex $line 2]
+ if {$x>$max} {set max $x}
+ }
+}
+close $in
+
+# The following are the extra token codes to be added. SPACE and
+# ILLEGAL *must* be the last two token codes and they must be in that order.
+#
+set extras {
+ TO_TEXT
+ TO_BLOB
+ TO_NUMERIC
+ TO_INT
+ TO_REAL
+ ISNOT
+ END_OF_FILE
+ UNCLOSED_STRING
+ FUNCTION
+ COLUMN
+ AGG_FUNCTION
+ AGG_COLUMN
+ UMINUS
+ UPLUS
+ REGISTER
+ ASTERISK
+ SPACE
+ ILLEGAL
+}
+if {[lrange $extras end-1 end]!="SPACE ILLEGAL"} {
+ error "SPACE and ILLEGAL must be the last two token codes and they\
+ must be in that order"
+}
+foreach x $extras {
+ incr max
+ puts [format "#define TK_%-29s %4d" $x $max]
+}
+
+# Some additional #defines related to token codes.
+#
+puts "\n/* The token codes above must all fit in 8 bits */"
+puts [format "#define %-20s %-6s" TKFLG_MASK 0xff]
+puts "\n/* Flags that can be added to a token code when it is not"
+puts "** being stored in a u8: */"
+foreach {fg val comment} {
+ TKFLG_DONTFOLD 0x100 {/* Omit constant folding optimizations */}
+} {
+ puts [format "#define %-20s %-6s %s" $fg $val $comment]
+}

Powered by Google App Engine
This is Rietveld 408576698