/* file contains automatically generated code, DO NOT MODIFY *
 *
 * The code in this file implements a function that determines whether
 * or not a given identifier is really an SQL keyword.  The same thing
 * might be implemented more directly using a hand-written hash table.
 * But by using this automatically generated code, the size of the code
 * is substantially reduced.  This is important for embedded applications
 * on platforms with limited memory.
 *
 * This code has been copied from SQLite's mkkeywordhash.c file and modified.
 * to read the SQL keywords from a file instead of static ones
 */

/* Parsed keywords
 *
 * From line: ABORT,
 * KEYWORD: 'ABORT'
 *
 * From line: ADD,
 * KEYWORD: 'ADD'
 *
 * From line: AFTER,
 * KEYWORD: 'AFTER'
 *
 * From line: ALL,
 * KEYWORD: 'ALL'
 *
 * From line: ALTER,
 * KEYWORD: 'ALTER'
 *
 * From line: ANALYZE,
 * KEYWORD: 'ANALYZE'
 *
 * From line: AND,
 * KEYWORD: 'AND'
 *
 * From line: AS,
 * KEYWORD: 'AS'
 *
 * From line: ASC,
 * KEYWORD: 'ASC'
 *
 * From line: ATTACH,
 * KEYWORD: 'ATTACH'
 *
 * From line: AUTOINCREMENT,
 * KEYWORD: 'AUTOINCREMENT'
 *
 * From line: BEFORE,
 * KEYWORD: 'BEFORE'
 *
 * From line: BEGIN,
 * KEYWORD: 'BEGIN'
 *
 * From line: BETWEEN,
 * KEYWORD: 'BETWEEN'
 *
 * From line: BY,
 * KEYWORD: 'BY'
 *
 * From line: CASCADE,
 * KEYWORD: 'CASCADE'
 *
 * From line: CASE,
 * KEYWORD: 'CASE'
 *
 * From line: CAST,
 * KEYWORD: 'CAST'
 *
 * From line: CHECK,
 * KEYWORD: 'CHECK'
 *
 * From line: COLLATE,
 * KEYWORD: 'COLLATE'
 *
 * From line: COLUMN,
 * KEYWORD: 'COLUMN'
 *
 * From line: COMMIT,
 * KEYWORD: 'COMMIT'
 *
 * From line: CONFLICT,
 * KEYWORD: 'CONFLICT'
 *
 * From line: CONSTRAINT,
 * KEYWORD: 'CONSTRAINT'
 *
 * From line: CREATE,
 * KEYWORD: 'CREATE'
 *
 * From line: CROSS,
 * KEYWORD: 'CROSS'
 *
 * From line: CURRENT_DATE,
 * KEYWORD: 'CURRENT_DATE'
 *
 * From line: CURRENT_TIME,
 * KEYWORD: 'CURRENT_TIME'
 *
 * From line: CURRENT_TIMESTAMP,TK_CTIME_KW,
 * KEYWORD: 'CURRENT_TIMESTAMP'
 * KEYWORD: 'TK_CTIME_KW'
 *
 * From line: DATABASE,
 * KEYWORD: 'DATABASE'
 *
 * From line: DEFAULT,
 * KEYWORD: 'DEFAULT'
 *
 * From line: DEFERRED,
 * KEYWORD: 'DEFERRED'
 *
 * From line: DEFERRABLE,
 * KEYWORD: 'DEFERRABLE'
 *
 * From line: DELETE,
 * KEYWORD: 'DELETE'
 *
 * From line: DESC,
 * KEYWORD: 'DESC'
 *
 * From line: DETACH,
 * KEYWORD: 'DETACH'
 *
 * From line: DISTINCT,
 * KEYWORD: 'DISTINCT'
 *
 * From line: DROP,
 * KEYWORD: 'DROP'
 *
 * From line: END,
 * KEYWORD: 'END'
 *
 * From line: EACH,
 * KEYWORD: 'EACH'
 *
 * From line: ELSE,
 * KEYWORD: 'ELSE'
 *
 * From line: ESCAPE,
 * KEYWORD: 'ESCAPE'
 *
 * From line: EXCEPT,
 * KEYWORD: 'EXCEPT'
 *
 * From line: EXCLUSIVE,
 * KEYWORD: 'EXCLUSIVE'
 *
 * From line: EXISTS,
 * KEYWORD: 'EXISTS'
 *
 * From line: EXPLAIN,
 * KEYWORD: 'EXPLAIN'
 *
 * From line: FAIL,
 * KEYWORD: 'FAIL'
 *
 * From line: FOR,
 * KEYWORD: 'FOR'
 *
 * From line: FOREIGN,
 * KEYWORD: 'FOREIGN'
 *
 * From line: FROM,
 * KEYWORD: 'FROM'
 *
 * From line: FULL,
 * KEYWORD: 'FULL'
 *
 * From line: GLOB,
 * KEYWORD: 'GLOB'
 *
 * From line: GROUP,
 * KEYWORD: 'GROUP'
 *
 * From line: HAVING,
 * KEYWORD: 'HAVING'
 *
 * From line: IF,
 * KEYWORD: 'IF'
 *
 * From line: IGNORE,
 * KEYWORD: 'IGNORE'
 *
 * From line: IMMEDIATE,
 * KEYWORD: 'IMMEDIATE'
 *
 * From line: IN,
 * KEYWORD: 'IN'
 *
 * From line: INDEX,
 * KEYWORD: 'INDEX'
 *
 * From line: INDEXED,
 * KEYWORD: 'INDEXED'
 *
 * From line: INITIALLY,
 * KEYWORD: 'INITIALLY'
 *
 * From line: INNER,
 * KEYWORD: 'INNER'
 *
 * From line: INSERT,
 * KEYWORD: 'INSERT'
 *
 * From line: INSTEAD,
 * KEYWORD: 'INSTEAD'
 *
 * From line: INTERSECT,
 * KEYWORD: 'INTERSECT'
 *
 * From line: INTO,
 * KEYWORD: 'INTO'
 *
 * From line: IS,
 * KEYWORD: 'IS'
 *
 * From line: ISNULL,
 * KEYWORD: 'ISNULL'
 *
 * From line: JOIN,
 * KEYWORD: 'JOIN'
 *
 * From line: KEY,
 * KEYWORD: 'KEY'
 *
 * From line: LEFT,
 * KEYWORD: 'LEFT'
 *
 * From line: LIKE,
 * KEYWORD: 'LIKE'
 *
 * From line: LIMIT,
 * KEYWORD: 'LIMIT'
 *
 * From line: MATCH,
 * KEYWORD: 'MATCH'
 *
 * From line: NATURAL,
 * KEYWORD: 'NATURAL'
 *
 * From line: NOT,
 * KEYWORD: 'NOT'
 *
 * From line: NOTNULL,
 * KEYWORD: 'NOTNULL'
 *
 * From line: NULL,
 * KEYWORD: 'NULL'
 *
 * From line: OF,
 * KEYWORD: 'OF'
 *
 * From line: OFFSET,
 * KEYWORD: 'OFFSET'
 *
 * From line: ON,
 * KEYWORD: 'ON'
 *
 * From line: OR,
 * KEYWORD: 'OR'
 *
 * From line: ORDER,
 * KEYWORD: 'ORDER'
 *
 * From line: OUTER,
 * KEYWORD: 'OUTER'
 *
 * From line: PLAN,
 * KEYWORD: 'PLAN'
 *
 * From line: PRAGMA,
 * KEYWORD: 'PRAGMA'
 *
 * From line: PRIMARY,
 * KEYWORD: 'PRIMARY'
 *
 * From line: QUERY,
 * KEYWORD: 'QUERY'
 *
 * From line: RAISE,
 * KEYWORD: 'RAISE'
 *
 * From line: REFERENCES,
 * KEYWORD: 'REFERENCES'
 *
 * From line: REGEXP,
 * KEYWORD: 'REGEXP'
 *
 * From line: REINDEX,
 * KEYWORD: 'REINDEX'
 *
 * From line: RELEASE,
 * KEYWORD: 'RELEASE'
 *
 * From line: RENAME,
 * KEYWORD: 'RENAME'
 *
 * From line: REPLACE,
 * KEYWORD: 'REPLACE'
 *
 * From line: RESTRICT,
 * KEYWORD: 'RESTRICT'
 *
 * From line: RIGHT,
 * KEYWORD: 'RIGHT'
 *
 * From line: ROLLBACK,
 * KEYWORD: 'ROLLBACK'
 *
 * From line: ROW,
 * KEYWORD: 'ROW'
 *
 * From line: SAVEPOINT,
 * KEYWORD: 'SAVEPOINT'
 *
 * From line: SELECT,
 * KEYWORD: 'SELECT'
 *
 * From line: SET,
 * KEYWORD: 'SET'
 *
 * From line: TABLE,
 * KEYWORD: 'TABLE'
 *
 * From line: TEMP,
 * KEYWORD: 'TEMP'
 *
 * From line: TEMPORARY,
 * KEYWORD: 'TEMPORARY'
 *
 * From line: THEN,
 * KEYWORD: 'THEN'
 *
 * From line: TO,
 * KEYWORD: 'TO'
 *
 * From line: TRANSACTION,
 * KEYWORD: 'TRANSACTION'
 *
 * From line: TRIGGER,
 * KEYWORD: 'TRIGGER'
 *
 * From line: UNION,
 * KEYWORD: 'UNION'
 *
 * From line: UNIQUE,
 * KEYWORD: 'UNIQUE'
 *
 * From line: UPDATE,
 * KEYWORD: 'UPDATE'
 *
 * From line: USING,
 * KEYWORD: 'USING'
 *
 * From line: VACUUM,
 * KEYWORD: 'VACUUM'
 *
 * From line: VALUES,
 * KEYWORD: 'VALUES'
 *
 * From line: VIEW,
 * KEYWORD: 'VIEW'
 *
 * From line: VIRTUAL,
 * KEYWORD: 'VIRTUAL'
 *
 * From line: WHEN,
 * KEYWORD: 'WHEN'
 *
 * From line: WHERE,
 * KEYWORD: 'WHERE'
 */
/* Hash score: 173 */
static int keywordCode(const char *z, int n){
  /* zText[] encodes 813 bytes of keywords in 549 bytes */
  /*   REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT       */
  /*   ABLEFTHENDEFERRABLELSEXCEPTK_CTIME_KWHENATURALTERAISEXCLUSIVE      */
  /*   XISTSAVEPOINTERSECTRANSACTIONOTNULLIKECONSTRAINTOFFSETRIGGER       */
  /*   EFERENCESUNIQUERYATTACHAVINGROUPDATEMPORARYBEGINNERELEASE          */
  /*   BETWEENCASCADELETECASECOLLATECREATECURRENT_DATEDETACHIMMEDIATE     */
  /*   JOINSERTMATCHPLANALYZEPRAGMABORTVALUESVIRTUALIMITWHERENAME         */
  /*   AFTEREPLACEANDEFAULTAUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSS     */
  /*   CURRENT_TIMESTAMPRIMARYDEFERREDISTINCTDROPFAILFROMFULLGLOBYIF      */
  /*   ISNULLORDERESTRICTOUTERIGHTROLLBACKROWUNIONUSINGVACUUMVIEW         */
  /*   INITIALLY                                                          */
  static const char zText[548] = {
    'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
    'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
    'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
    'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
    'E','R','R','A','B','L','E','L','S','E','X','C','E','P','T','K','_','C',
    'T','I','M','E','_','K','W','H','E','N','A','T','U','R','A','L','T','E',
    'R','A','I','S','E','X','C','L','U','S','I','V','E','X','I','S','T','S',
    'A','V','E','P','O','I','N','T','E','R','S','E','C','T','R','A','N','S',
    'A','C','T','I','O','N','O','T','N','U','L','L','I','K','E','C','O','N',
    'S','T','R','A','I','N','T','O','F','F','S','E','T','R','I','G','G','E',
    'R','E','F','E','R','E','N','C','E','S','U','N','I','Q','U','E','R','Y',
    'A','T','T','A','C','H','A','V','I','N','G','R','O','U','P','D','A','T',
    'E','M','P','O','R','A','R','Y','B','E','G','I','N','N','E','R','E','L',
    'E','A','S','E','B','E','T','W','E','E','N','C','A','S','C','A','D','E',
    'L','E','T','E','C','A','S','E','C','O','L','L','A','T','E','C','R','E',
    'A','T','E','C','U','R','R','E','N','T','_','D','A','T','E','D','E','T',
    'A','C','H','I','M','M','E','D','I','A','T','E','J','O','I','N','S','E',
    'R','T','M','A','T','C','H','P','L','A','N','A','L','Y','Z','E','P','R',
    'A','G','M','A','B','O','R','T','V','A','L','U','E','S','V','I','R','T',
    'U','A','L','I','M','I','T','W','H','E','R','E','N','A','M','E','A','F',
    'T','E','R','E','P','L','A','C','E','A','N','D','E','F','A','U','L','T',
    'A','U','T','O','I','N','C','R','E','M','E','N','T','C','A','S','T','C',
    'O','L','U','M','N','C','O','M','M','I','T','C','O','N','F','L','I','C',
    'T','C','R','O','S','S','C','U','R','R','E','N','T','_','T','I','M','E',
    'S','T','A','M','P','R','I','M','A','R','Y','D','E','F','E','R','R','E',
    'D','I','S','T','I','N','C','T','D','R','O','P','F','A','I','L','F','R',
    'O','M','F','U','L','L','G','L','O','B','Y','I','F','I','S','N','U','L',
    'L','O','R','D','E','R','E','S','T','R','I','C','T','O','U','T','E','R',
    'I','G','H','T','R','O','L','L','B','A','C','K','R','O','W','U','N','I',
    'O','N','U','S','I','N','G','V','A','C','U','U','M','V','I','E','W','I',
    'N','I','T','I','A','L','L','Y',
  };
  static const unsigned int aHash[127] = {
     72, 100, 113, 70, 0, 56, 0, 0, 78, 0, 73, 0, 0,
     44, 12, 74, 15, 0, 112, 28, 52, 107, 0, 19, 0, 0,
     117, 0, 115, 110, 0, 22, 88, 0, 9, 0, 0, 66, 67,
     0, 65, 6, 0, 50, 85, 97, 0, 114, 96, 0, 0, 55,
     0, 98, 24, 0, 17, 0, 118, 51, 23, 0, 5, 105, 25,
     91, 0, 0, 120, 101, 61, 119, 58, 7, 53, 0, 86, 0,
     95, 26, 0, 94, 0, 0, 0, 90, 87, 92, 83, 104, 14,
     42, 103, 0, 77, 0, 18, 84, 106, 31, 0, 116, 76, 108,
     39, 57, 80, 0, 0, 89, 43, 0, 111, 0, 35, 0, 0,
     37, 0, 81, 59, 40, 0, 20, 38, 0, 54,
  };
  static const unsigned int aNext[120] = {
       0,   0,   0,   0,   4,   0,   0,   0,   0,   0,   0,   0,   0,
       0,   3,   0,   0,   0,   0,   0,   0,  13,   0,   0,   0,   0,
       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  29,   0,
       0,   0,   0,   0,   0,   0,   0,   0,  41,   0,   0,   0,  46,
       2,  49,  32,   0,  21,   0,   0,   0,   0,   0,   0,   0,   1,
      62,   0,   0,  63,   0,  45,   0,   0,   0,   0,   0,   0,   0,
      48,   0,   0,   0,  30,  60,  16,  33,  10,   0,   0,   0,   0,
       0,   0,   0,  11,  68,  75,   0,   8,   0,  99,  93,   0, 102,
      27,  82,   0,  71,   0,   0, 109,  36,  47,  69,  79,   0,  34,
      64,   0,   0,
  };
  static const unsigned char aLen[120] = {
       7,   5,   7,   4,   6,   4,   5,   3,   6,   7,   3,   6,   6,
       7,   7,   3,   8,   2,   6,   5,   4,   4,   3,  10,   4,   6,
      11,   4,   7,   5,   5,   9,   6,   9,   9,  11,   2,   7,   3,
       4,   4,  10,   4,   2,   6,   3,   7,  10,   6,   5,   6,   6,
       5,   6,   9,   4,   2,   5,   5,   7,   7,   7,   3,   6,   4,
       7,   6,  12,   6,   9,   4,   6,   5,   4,   7,   6,   5,   6,
       7,   5,   5,   6,   5,   7,   3,   7,  13,   2,   2,   4,   6,
       6,   8,   5,  17,  12,   7,   8,   8,   2,   4,   4,   4,   4,
       4,   2,   2,   6,   5,   8,   5,   5,   8,   3,   5,   5,   6,
       4,   9,   3,
  };
  static const unsigned short int aOffset[120] = {
       0,   2,   2,   8,   9,  14,  16,  20,  23,  25,  25,  29,  33,
      36,  41,  46,  48,  53,  54,  59,  62,  65,  67,  69,  78,  81,
      86,  96,  99, 104, 108, 112, 120, 125, 131, 139, 148, 149, 149,
     152, 155, 159, 166, 169, 169, 172, 174, 180, 190, 193, 198, 203,
     208, 211, 215, 215, 219, 224, 227, 231, 238, 245, 246, 250, 256,
     260, 267, 273, 285, 291, 300, 302, 308, 313, 315, 322, 327, 332,
     338, 344, 349, 352, 358, 362, 369, 371, 378, 380, 382, 391, 395,
     401, 407, 415, 420, 420, 436, 443, 450, 451, 458, 462, 466, 470,
     474, 477, 479, 481, 487, 491, 499, 503, 508, 516, 519, 524, 529,
     535, 539, 544,
  };
  int h, i;
  if( n<2 ) return 0;
  h = ((charMap(z[0])*4) ^
      (charMap(z[n-1])*3) ^
      n) % 127;
  for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){
    if( aLen[i]==n && casecmp(&zText[aOffset[i]],z,n)==0 ){
      return 1;
    }
  }
  return 0;
}

static gboolean
is_keyword (const char *z)
{
	return keywordCode(z, strlen (z));
}

