summaryrefslogtreecommitdiff
path: root/components/external/SQLite-3.8.1/addopcodes.awk
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-11-30 03:36:56 -0800
committerBernard Xiong <[email protected]>2013-11-30 03:36:56 -0800
commitbe2f628160fa1262b6cc10df3823c5f984bc3c48 (patch)
tree6a96d2f30c979713b5f175b08c90a03f359faeb6 /components/external/SQLite-3.8.1/addopcodes.awk
parent35d83be62ff504d2b595288e0a377160604e71a8 (diff)
parent9326719a12cf54f3418e292835e37ddc3afa92fd (diff)
Merge pull request #205 from geniusgogo/sqlite
Sqlite
Diffstat (limited to 'components/external/SQLite-3.8.1/addopcodes.awk')
-rw-r--r--components/external/SQLite-3.8.1/addopcodes.awk34
1 files changed, 34 insertions, 0 deletions
diff --git a/components/external/SQLite-3.8.1/addopcodes.awk b/components/external/SQLite-3.8.1/addopcodes.awk
new file mode 100644
index 0000000000..c90e1dd7f4
--- /dev/null
+++ b/components/external/SQLite-3.8.1/addopcodes.awk
@@ -0,0 +1,34 @@
+#!/usr/bin/awk
+#
+# 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.
+#
+#
+BEGIN {
+ max = 0
+}
+/^#define TK_/ {
+ print $0
+ if( max<$3 ) max = $3
+}
+END {
+ printf "#define TK_%-29s %4d\n", "TO_TEXT", ++max
+ printf "#define TK_%-29s %4d\n", "TO_BLOB", ++max
+ printf "#define TK_%-29s %4d\n", "TO_NUMERIC", ++max
+ printf "#define TK_%-29s %4d\n", "TO_INT", ++max
+ printf "#define TK_%-29s %4d\n", "TO_REAL", ++max
+ printf "#define TK_%-29s %4d\n", "ISNOT", ++max
+ printf "#define TK_%-29s %4d\n", "END_OF_FILE", ++max
+ printf "#define TK_%-29s %4d\n", "ILLEGAL", ++max
+ printf "#define TK_%-29s %4d\n", "SPACE", ++max
+ printf "#define TK_%-29s %4d\n", "UNCLOSED_STRING", ++max
+ printf "#define TK_%-29s %4d\n", "FUNCTION", ++max
+ printf "#define TK_%-29s %4d\n", "COLUMN", ++max
+ printf "#define TK_%-29s %4d\n", "AGG_FUNCTION", ++max
+ printf "#define TK_%-29s %4d\n", "AGG_COLUMN", ++max
+ printf "#define TK_%-29s %4d\n", "CONST_FUNC", ++max
+ printf "#define TK_%-29s %4d\n", "UMINUS", ++max
+ printf "#define TK_%-29s %4d\n", "UPLUS", ++max
+}