1 /* mrds_scanner_tables.incl.pl1
  2 
  3    These are the tables that drive the scanner for MRDS selection expression
  4    parsing.
  5 
  6    Originally created 08-04-85 J. Hergert
  7 
  8 
  9  The following declaration is used by the scanner to type the token it is
 10  about to parse. The first character determines what the token could be.
 11 
 12  The codes in the following declaration are deciphered as follows:
 13  Any code >  0 is a token type, indicating the type of token we will try
 14  to find. Codes less than 0 are negated keyword encode values. These token
 15  types are simple one character tokens and no further searching need be
 16  done when we find one.
 17 */
 18 
 19 
 20 /****^  HISTORY COMMENTS:
 21   1) change(87-11-23,Hergert), approve(88-06-28,MCR7903),
 22      audit(88-06-28,Dupuis), install(88-08-01,MR12.2-1073):
 23      Created for for new parser.
 24                                                    END HISTORY COMMENTS */
 25 
 26 dcl token_type_list (22) fixed bin internal static options(constant) init (
 27 /*                                              CHARACTER CLASSES
 28             1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22
 29           num   .  +-  Ee   i   ^   =   <   > let  * /  |   (   )   &   , whsp  " oth   :   ]   [
 30 */
 31             1,  2,  3,  4,  4,  5,  6,  7,  8,  4, 14, 9, 14, 14, 14, 14, 10, 11, 12, 13, 14, 14);
 32 
 33 
 34 
 35 
 36 /* The following dcl sets up a list that is used to categorize each
 37    character into one of 22 classes. The classes are defined below.
 38 
 39 The character classes are the following:
 40 1 digits
 41 2   .
 42 3   +-
 43 4   Ee
 44 5   i
 45 6   ^
 46 7   =
 47 8   <
 48 9   >
 49 10  letters
 50 11  * /
 51 12  |
 52 13  (
 53 14  )
 54 15  &
 55 16  ,
 56 17  SP TAB NL FF VT CR   (white space)
 57 18  "
 58 19  all others
 59 20  :
 60 21  ]
 61 22  [
 62 */
 63 
 64 
 65 /* each of 512 ascii characters classified into the above groups */
 66 
 67 dcl char_class_list (0:511) fixed bin internal static options(constant)
 68     init(
 69 /*         whsp                !   "   #$%    &   '   (   )   *  +   ,  - */
 70     (9)19, (5)17, (18)19, 17, 19, 18, (3)19, 15, 19, 13, 14, 11, 3, 16, 3,
 71 /*  .   /   nums   :   ;  <  =  >   ?   @   ABCD  E   FGH   I   J-U       */
 72     2, 11, (10)1, 20, 19, 8, 7, 9, 19, 19, (4)10, 4, (3)10, 5, (12)10,
 73 /*   V   W   X   Y   Z   [   \   ]  ^   _   `   abcd  e   fgh   i   j-u   */
 74     10, 10, 10, 10, 10, 22, 19, 21, 6, 19, 19, (4)10, 4, (3)10, 5, (12)10,
 75 /*   v   w   x   y   z   {   |                                            */
 76     10, 10, 10, 10, 10, 19, 12, (387)19);
 77 
 78 
 79 
 80 
 81 /* the table declared below is a state table used to parse a number.
 82    The rows are states, and the columns are character classes. These
 83    are obtained from the char_class_list above. The columns are organized
 84    so that the six correspond to classes 1-6 above.
 85 
 86    A positive value in the table is the next state to goto, given the current
 87    character class. A negative value means the scan is finished.
 88    -1 means the scan is finished, a token has been found.
 89    -2 means an error has been detected.
 90    -3 means the scan is finished, a token has been found, the cursor must be
 91       bumped by one.
 92 */
 93 
 94 dcl num_state_table (6,6) fixed bin internal static options (constant) init(
 95 /*                class
 96           1   2   3   4   5   6
 97         num   .  +-  Ee   i   other
 98 states */
 99 /* 1 */   1,  2, -1,  3, -3, -1,
100 /* 2 */   4, -2, -2, -2, -2, -2,
101 /* 3 */   6, -2,  5, -2, -2, -2,
102 /* 4 */   4, -1, -1,  3, -3, -1,
103 /* 5 */   6, -2, -2, -2, -2, -2,
104 /* 6 */   6, -1, -1, -1, -3, -1);
105