home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / parser / tables.y < prev    next >
Encoding:
Text File  |  1993-01-18  |  3.0 KB  |  148 lines

  1. /*
  2. **    SCANNER KEYWORD TABLES
  3. **
  4. **    Keywords, tokens, and opcode tuples are included in this file
  5. **    The keyword table MUST be in sorted order.
  6. **    The operator table does not need to be sorted
  7. **
  8. **    Version:
  9. **        @(#)tables.y    8.2    3/2/85
  10. */
  11. struct optab    Keyword[] =
  12. {
  13.     "abs",            FOP,            opABS,
  14.     "all",            ALL,            0,
  15.     "and",            LBOP,            AND,
  16.     "any",            AGOP,             opANY,
  17.     "append",        APPEND,            GOVAL,
  18.     "ascii",        FOP,            opASCII,
  19.     "at",            AT,            0,
  20.     "atan",            FOP,            opATAN,
  21.     "avg",            AGOP,            opAVG,
  22.     "avgu",            AGOP,            opAVGU,
  23.     "by",            BY,            opEQ,
  24.     "concat",         FBOP,            opCONCAT,
  25.     "copy",            COPY,            GOVAL,
  26.     "cos",            FOP,            opCOS,
  27.     "count",        AGOP,            opCOUNT,
  28.     "countu",        AGOP,            opCOUNTU,
  29.     "create",        CREATE,            GOVAL,
  30.     "define",        DEFINE,            GOVAL,
  31.     "delete",        DELETE,            GOVAL,
  32.     "delim",        DELIM,            0,
  33.     "destroy",        DESTROY,        GOVAL,
  34. #    ifdef    DISTRIB
  35.     "distribute",        DISTRIBUTE,        0,
  36.     "distributed",        DISTRD,            0,
  37. #    endif
  38.     "exp",            FOP,            opEXP,
  39.     "float4",        FOP,            opFLOAT4,
  40.     "float8",        FOP,            opFLOAT8,
  41.     "from",            FROM,            0,
  42.     "help",            HELP,            GOVAL,
  43.     "in",            IN,            0,
  44.     "index",        INDEX,            GOVAL,
  45.     "int1",            FOP,            opINT1,
  46.     "int2",            FOP,            opINT2,
  47.     "int4",            FOP,            opINT4,
  48.     "integrity",        INTEGRITY,        0,
  49.     "into",            INTO,            0,
  50.     "is",            IS,            opEQ,
  51.     "log",            FOP,            opLOG,
  52.     "max",            AGOP,            opMAX,
  53.     "min",            AGOP,            opMIN,
  54.     "mod",            FBOP,            opMOD,
  55.     "modify",        MODIFY,            GOVAL,
  56.     "not",            LUOP,            opNOT,
  57.     "of",            OF,            0,
  58.     "on",            ON,            0,
  59.     "onto",            ONTO,            0,
  60.     "or",            LBOP,            OR,
  61.     "permit",        PERMIT,            0,
  62.     "print",        PRINT,            GOVAL,
  63.     "range",        RANGE,            GOVAL,
  64.     "replace",        REPLACE,        GOVAL,
  65.     "retrieve",        RETRIEVE,        GOVAL,
  66.     "save",            SAVE,            GOVAL,
  67.     "sin",            FOP,            opSIN,
  68.     "sqrt",            FOP,            opSQRT,
  69.     "sum",            AGOP,            opSUM,
  70.     "sumu",            AGOP,            opSUMU,
  71.     "to",            TO,            0,
  72.     "unique",        UNIQUE,            0,
  73.     "until",        UNTIL,            0,
  74.     "unuse",        UNUSE,            GOVAL,
  75.     "use",            USE,            GOVAL,
  76.     "view",            VIEW,            0,
  77.     "where",        WHERE,            0,
  78. };
  79. int    Keyent =        sizeof Keyword / sizeof Keyword[0];
  80.  
  81. struct optab    Optab[] =
  82. {
  83.     /* PUNCTUATION */
  84.     ",",            COMMA,            0,
  85.     "(",            LPAREN,            '(',
  86.     ".",            PERIOD,            0,
  87.     ")",            RPAREN,            ')',
  88.     "\"",            SCONST,            0,
  89.     "/*",            BGNCMNT,        0,
  90.     "*/",            ENDCMNT,        0,
  91.     ":",            COLON,            0,
  92.     "]",            RBRAC,            ']',
  93.     "[",            LBRAC,            '[',
  94.     "$",            DOLLAR,            0,
  95.     "%",            PCT,            '%',
  96.  
  97.  
  98.     /* UNARY ARITHMETIC OPERATORS */
  99.     "+",            UAOP,            opADD,
  100.     "-",            UAOP,            opSUB,
  101.  
  102.     /* BINARY ARITHMETIC OPERATORS */
  103.     "*",            BAOP,            opMUL,
  104.     "/",            BAOP,            opDIV,
  105.     "**",            BAOPH,            opPOW,
  106.  
  107.     /* BOUNDS OPERATORS */
  108.     ">",            BDOP,            opGT,
  109.     ">=",            BDOP,            opGE,
  110.     "<",            BDOP,            opLT,
  111.     "<=",            BDOP,            opLE,
  112.  
  113.     /* EQUALITY OPERATORS */
  114.     "!=",            EOP,            opNE,
  115.     "=",            IS,            opEQ,
  116.     0
  117. };
  118.  
  119. /* constant operators table for lookup */
  120. struct constop    Coptab[] =
  121. {
  122.     "dba",        opDBA,        CHAR,        2,
  123.     "usercode",    opUSERCODE,    CHAR,        2,
  124.     0,        0,        0,        0,
  125.     "date",        opDATE,        '?',        '?',
  126.     "time",        opDATE,        '?',        '?',
  127.     0,        0,        0,        0
  128. };
  129.  
  130.  
  131. /*
  132. ** Tokens
  133. ** a structure initialized here to contain the
  134. ** yacc generated tokens for the indicated
  135. ** terminal symbols.
  136. */
  137. struct special    Tokens =
  138. {
  139.     SCONST,
  140.     BGNCMNT,
  141.     ENDCMNT,
  142.     I2CONST,
  143.     I4CONST,
  144.     F4CONST,
  145.     F8CONST,
  146.     NAME
  147. };
  148.