1: /*
   2: **  TOKENS.Y -- operator and keyword tables
   3: **
   4: **	Defines:
   5: **		Optab -- operator table
   6: **		Kwrdtab -- keyword tables
   7: **		Kwrdnum -- number of keywords (for binary search in getkey())
   8: **		Tokens -- so lexical routines can know about yacc tokens
   9: **
  10: **	Requires:
  11: **		Kwrdtab must be in alphabetical order!!!
  12: **
  13: **	Required By:
  14: **		grammar.y
  15: **
  16: **	History:
  17: **		5/31/78 -- (marc) first written
  18: */
  19: 
  20: 
  21: struct optab    Kwrdtab [] =
  22: {
  23:     "all",          ALL,            0,
  24:     "and",          LBOP,           0,
  25:     "any",          AOP,            0,
  26:     "append",       APPEND,         0,
  27:     "ascii",        FOP,            0,
  28:     "at",           AT,         0,
  29:     "atan",         FOP,            0,
  30:     "auto",         ALLOC,          opAUTO,
  31:     "avg",          AOP,            0,
  32:     "avgu",         AOP,            0,
  33:     "by",           BY,         0,
  34:     "char",         TYPE,           opSTRING,
  35:     "concat",       FBOP,           0,
  36:     "copy",         COPY,           0,
  37:     "cos",          FOP,            0,
  38:     "count",        AOP,            0,
  39:     "countu",       AOP,            0,
  40:     "create",       CREATE,         0,
  41:     "define",       DEFINE,         0,
  42:     "delete",       DELETE,         0,
  43:     "destroy",      DESTROY,        0,
  44:     "double",       TYPE,           opDOUBLE,
  45:     "exit",         EXIT,           0,
  46:     "extern",       ALLOC,          opEXTERN,
  47:     "float",        TYPE,           opFLOAT,
  48:     "float4",       FOP,            4,
  49:     "float8",       FOP,            8,
  50:     "from",         FROM,           0,
  51:     "gamma",        FOP,            0,
  52:     "help",         HELP,           0,
  53:     "in",           IN,         0,
  54:     "index",        INDEX,          0,
  55:     "ingres",       INGRES,         0,
  56:     "int",          TYPE,           opINT,
  57:     "int1",         FOP,            1,
  58:     "int2",         FOP,            2,
  59:     "int4",         FOP,            4,
  60:     "integrity",        INTEGRITY,      0,
  61:     "into",         INTO,           0,
  62:     "is",           IS,         0,
  63:     "log",          FOP,            0,
  64:     "long",         TYPE,           opLONG,
  65:     "max",          AOP,            0,
  66:     "min",          AOP,            0,
  67:     "mod",          FBOP,           0,
  68:     "modify",       MODIFY,         0,
  69:     "not",          LUOP,           0,
  70:     "of",           OF,         0,
  71:     "on",           ON,         0,
  72:     "onto",         ONTO,           0,
  73:     "or",           LBOP,           0,
  74:     "param",        PARAM,          0,
  75:     "permit",       PERMIT,         0,
  76:     "print",        PRINT,          0,
  77:     "rand",         FOP,            0,
  78:     "range",        RANGE,          0,
  79:     "register",     ALLOC,          opREGISTER,
  80:     "replace",      REPLACE,        0,
  81:     "retrieve",     RETRIEVE,       0,
  82:     "save",         SAVE,           0,
  83:     "sin",          FOP,            0,
  84:     "sqrt",         FOP,            0,
  85:     "static",       ALLOC,          opSTATIC,
  86:     "struct",       STRUCT,         opSTRUCT,
  87:     "sum",          AOP,            0,
  88:     "sumu",         AOP,            0,
  89:     "to",           TO,         0,
  90:     "unique",       UNIQUE,         0,
  91:     "until",        UNTIL,          0,
  92:     "view",         VIEW,           0,
  93:     "where",        WHERE,          0,
  94: };
  95: 
  96: /* This decalaration must be here as getkey references it,
  97: ** and it must contain the number of elements in the
  98: ** Kwrdtab, which is only known here
  99: */
 100: 
 101: int Kwrdnum     = sizeof Kwrdtab / sizeof Kwrdtab [0];
 102: 
 103: struct optab    Optab [] =
 104: {
 105:     /* PUNCTUATION */
 106:     ",",            COMMA,          0,
 107:     "(",            LPAREN,         0,
 108:     ".",            PERIOD,         0,
 109:     ")",            RPAREN,         0,
 110:     "\"",           QUOTE,          0,
 111:     "/*",           BGNCMNT,        0,
 112:     "*/",           ENDCMNT,        0,
 113:     "#",            NONREF,         0,
 114:     ":",            COLON,          0,
 115: 
 116:     /* C LANUAGE PUNCTUATION */
 117:     "{",            LBRACE,         0,
 118:     "}",            RBRACE,         0,
 119:     "[",            LBRKT,          0,
 120:     "]",            RBRKT,          0,
 121:     ";",            SEMICOL,        0,
 122:     "->",           POINTER,        0,
 123: 
 124:     /* UNARY ARITHMETIC OPERATORS */
 125:     "+",            UOP,            0,
 126:     "-",            UOP,            0,
 127: 
 128:     /* BINARY ARITHMETIC OPERATORS */
 129:     "*",            BOP,            0,
 130:     "/",            BOP,            0,
 131:     "**",           BOP,            0,
 132: 
 133:     /* BOUNDS OPERATORS */
 134:     ">",            BDOP,           0,
 135:     ">=",           BDOP,           0,
 136:     "<",            BDOP,           0,
 137:     "<=",           BDOP,           0,
 138: 
 139:     /* EQUALITY OPERATORS */
 140:     "!=",           EOP,            0,
 141:     "=",            IS,         0,
 142:     0
 143: };
 144: 
 145: 
 146: struct special Tokens =
 147: {
 148:     NAME,
 149:     SCONST,
 150:     I2CONST,
 151:     I4CONST,
 152:     F8CONST,
 153:     QUOTE,
 154:     BGNCMNT,
 155:     ENDCMNT,
 156:     C_CODE,
 157:     STRUCT_VAR,
 158: };

Defined variables

_Kwrdnum defined in line 101; never used
_Kwrdtab defined in line 21; used 2 times
  • in line 101(2)
_Optab defined in line 103; never used
_Tokens defined in line 146; never used

Usage of this include

Last modified: 1995-02-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1243
Valid CSS Valid XHTML 1.0 Strict