home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / ch-exp.tab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-12  |  70.9 KB  |  2,778 lines

  1.  
  2. # line 55 "./ch-exp.y"
  3.  
  4. #include "defs.h"
  5. #include <ctype.h>
  6. #include "expression.h"
  7. #include "language.h"
  8. #include "value.h"
  9. #include "parser-defs.h"
  10. #include "ch-lang.h"
  11.  
  12. /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
  13.    as well as gratuitiously global symbol names, so we can have multiple
  14.    yacc generated parsers in gdb.  Note that these are only the variables
  15.    produced by yacc.  If other parser generators (bison, byacc, etc) produce
  16.    additional global names that conflict at link time, then those parser
  17.    generators need to be fixed instead of adding those names to this list. */
  18.  
  19. #define    yymaxdepth chill_maxdepth
  20. #define    yyparse    chill_parse
  21. #define    yylex    chill_lex
  22. #define    yyerror    chill_error
  23. #define    yylval    chill_lval
  24. #define    yychar    chill_char
  25. #define    yydebug    chill_debug
  26. #define    yypact    chill_pact
  27. #define    yyr1    chill_r1
  28. #define    yyr2    chill_r2
  29. #define    yydef    chill_def
  30. #define    yychk    chill_chk
  31. #define    yypgo    chill_pgo
  32. #define    yyact    chill_act
  33. #define    yyexca    chill_exca
  34. #define yyerrflag chill_errflag
  35. #define yynerrs    chill_nerrs
  36. #define    yyps    chill_ps
  37. #define    yypv    chill_pv
  38. #define    yys    chill_s
  39. #define    yy_yys    chill_yys
  40. #define    yystate    chill_state
  41. #define    yytmp    chill_tmp
  42. #define    yyv    chill_v
  43. #define    yy_yyv    chill_yyv
  44. #define    yyval    chill_val
  45. #define    yylloc    chill_lloc
  46. #define yyreds    chill_reds        /* With YYDEBUG defined */
  47. #define yytoks    chill_toks        /* With YYDEBUG defined */
  48.  
  49. #ifndef YYDEBUG
  50. #define    YYDEBUG    0        /* Default to no yydebug support */
  51. #endif
  52.  
  53. int
  54. yyparse PARAMS ((void));
  55.  
  56. static int
  57. yylex PARAMS ((void));
  58.  
  59. void
  60. yyerror PARAMS ((char *));
  61.  
  62.  
  63. # line 120 "./ch-exp.y"
  64. typedef union 
  65.   {
  66.     LONGEST lval;
  67.     unsigned LONGEST ulval;
  68.     struct {
  69.       LONGEST val;
  70.       struct type *type;
  71.     } typed_val;
  72.     double dval;
  73.     struct symbol *sym;
  74.     struct type *tval;
  75.     struct stoken sval;
  76.     struct ttype tsym;
  77.     struct symtoken ssym;
  78.     int voidval;
  79.     struct block *bval;
  80.     enum exp_opcode opcode;
  81.     struct internalvar *ivar;
  82.  
  83.     struct type **tvec;
  84.     int *ivec;
  85.   } YYSTYPE;
  86. # define FIXME_01 257
  87. # define FIXME_02 258
  88. # define FIXME_03 259
  89. # define FIXME_04 260
  90. # define FIXME_05 261
  91. # define FIXME_06 262
  92. # define FIXME_07 263
  93. # define FIXME_08 264
  94. # define FIXME_09 265
  95. # define FIXME_10 266
  96. # define FIXME_11 267
  97. # define FIXME_12 268
  98. # define FIXME_13 269
  99. # define FIXME_14 270
  100. # define FIXME_15 271
  101. # define FIXME_16 272
  102. # define FIXME_17 273
  103. # define FIXME_18 274
  104. # define FIXME_19 275
  105. # define FIXME_20 276
  106. # define FIXME_21 277
  107. # define FIXME_22 278
  108. # define FIXME_24 279
  109. # define FIXME_25 280
  110. # define FIXME_26 281
  111. # define FIXME_27 282
  112. # define FIXME_28 283
  113. # define FIXME_29 284
  114. # define FIXME_30 285
  115. # define INTEGER_LITERAL 286
  116. # define BOOLEAN_LITERAL 287
  117. # define CHARACTER_LITERAL 288
  118. # define FLOAT_LITERAL 289
  119. # define GENERAL_PROCEDURE_NAME 290
  120. # define LOCATION_NAME 291
  121. # define SET_LITERAL 292
  122. # define EMPTINESS_LITERAL 293
  123. # define CHARACTER_STRING_LITERAL 294
  124. # define BIT_STRING_LITERAL 295
  125. # define TYPENAME 296
  126. # define FIELD_NAME 297
  127. # define CASE 298
  128. # define OF 299
  129. # define ESAC 300
  130. # define LOGIOR 301
  131. # define ORIF 302
  132. # define LOGXOR 303
  133. # define LOGAND 304
  134. # define ANDIF 305
  135. # define NOTEQUAL 306
  136. # define GTR 307
  137. # define LEQ 308
  138. # define IN 309
  139. # define SLASH_SLASH 310
  140. # define MOD 311
  141. # define REM 312
  142. # define NOT 313
  143. # define POINTER 314
  144. # define RECEIVE 315
  145. # define UP 316
  146. # define IF 317
  147. # define THEN 318
  148. # define ELSE 319
  149. # define FI 320
  150. # define ELSIF 321
  151. # define ILLEGAL_TOKEN 322
  152. # define NUM 323
  153. # define PRED 324
  154. # define SUCC 325
  155. # define ABS 326
  156. # define CARD 327
  157. # define MAX_TOKEN 328
  158. # define MIN_TOKEN 329
  159. # define SIZE 330
  160. # define UPPER 331
  161. # define LOWER 332
  162. # define LENGTH 333
  163. # define GDB_REGNAME 334
  164. # define GDB_LAST 335
  165. # define GDB_VARIABLE 336
  166. # define GDB_ASSIGNMENT 337
  167. #define yyclearin yychar = -1
  168. #define yyerrok yyerrflag = 0
  169. extern int yychar;
  170. extern int yyerrflag;
  171. #ifndef YYMAXDEPTH
  172. #define YYMAXDEPTH 150
  173. #endif
  174. YYSTYPE yylval, yyval;
  175. # define YYERRCODE 256
  176.  
  177. # line 991 "./ch-exp.y"
  178.  
  179.  
  180. /* Implementation of a dynamically expandable buffer for processing input
  181.    characters acquired through lexptr and building a value to return in
  182.    yylval. */
  183.  
  184. static char *tempbuf;        /* Current buffer contents */
  185. static int tempbufsize;        /* Size of allocated buffer */
  186. static int tempbufindex;    /* Current index into buffer */
  187.  
  188. #define GROWBY_MIN_SIZE 64    /* Minimum amount to grow buffer by */
  189.  
  190. #define CHECKBUF(size) \
  191.   do { \
  192.     if (tempbufindex + (size) >= tempbufsize) \
  193.       { \
  194.     growbuf_by_size (size); \
  195.       } \
  196.   } while (0);
  197.  
  198. /* Grow the static temp buffer if necessary, including allocating the first one
  199.    on demand. */
  200.  
  201. static void
  202. growbuf_by_size (count)
  203.      int count;
  204. {
  205.   int growby;
  206.  
  207.   growby = max (count, GROWBY_MIN_SIZE);
  208.   tempbufsize += growby;
  209.   if (tempbuf == NULL)
  210.     {
  211.       tempbuf = (char *) xmalloc (tempbufsize);
  212.     }
  213.   else
  214.     {
  215.       tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
  216.     }
  217. }
  218.  
  219. /* Try to consume a simple name string token.  If successful, returns
  220.    a pointer to a nullbyte terminated copy of the name that can be used
  221.    in symbol table lookups.  If not successful, returns NULL. */
  222.  
  223. static char *
  224. match_simple_name_string ()
  225. {
  226.   char *tokptr = lexptr;
  227.  
  228.   if (isalpha (*tokptr))
  229.     {
  230.       char *result;
  231.       do {
  232.     tokptr++;
  233.       } while (isalnum (*tokptr) || (*tokptr == '_'));
  234.       yylval.sval.ptr = lexptr;
  235.       yylval.sval.length = tokptr - lexptr;
  236.       lexptr = tokptr;
  237.       result = copy_name (yylval.sval);
  238.       for (tokptr = result; *tokptr; tokptr++)
  239.     if (isupper (*tokptr))
  240.       *tokptr = tolower(*tokptr);
  241.       return result;
  242.     }
  243.   return (NULL);
  244. }
  245.  
  246. /* Start looking for a value composed of valid digits as set by the base
  247.    in use.  Note that '_' characters are valid anywhere, in any quantity,
  248.    and are simply ignored.  Since we must find at least one valid digit,
  249.    or reject this token as an integer literal, we keep track of how many
  250.    digits we have encountered. */
  251.   
  252. static int
  253. decode_integer_value (base, tokptrptr, ivalptr)
  254.   int base;
  255.   char **tokptrptr;
  256.   int *ivalptr;
  257. {
  258.   char *tokptr = *tokptrptr;
  259.   int temp;
  260.   int digits = 0;
  261.  
  262.   while (*tokptr != '\0')
  263.     {
  264.       temp = tolower (*tokptr);
  265.       tokptr++;
  266.       switch (temp)
  267.     {
  268.     case '_':
  269.       continue;
  270.     case '0':  case '1':  case '2':  case '3':  case '4':
  271.     case '5':  case '6':  case '7':  case '8':  case '9':
  272.       temp -= '0';
  273.       break;
  274.     case 'a':  case 'b':  case 'c':  case 'd':  case 'e': case 'f':
  275.       temp -= 'a';
  276.       temp += 10;
  277.       break;
  278.     default:
  279.       temp = base;
  280.       break;
  281.     }
  282.       if (temp < base)
  283.     {
  284.       digits++;
  285.       *ivalptr *= base;
  286.       *ivalptr += temp;
  287.     }
  288.       else
  289.     {
  290.       /* Found something not in domain for current base. */
  291.       tokptr--;    /* Unconsume what gave us indigestion. */
  292.       break;
  293.     }
  294.     }
  295.   
  296.   /* If we didn't find any digits, then we don't have a valid integer
  297.      value, so reject the entire token.  Otherwise, update the lexical
  298.      scan pointer, and return non-zero for success. */
  299.   
  300.   if (digits == 0)
  301.     {
  302.       return (0);
  303.     }
  304.   else
  305.     {
  306.       *tokptrptr = tokptr;
  307.       return (1);
  308.     }
  309. }
  310.  
  311. static int
  312. decode_integer_literal (valptr, tokptrptr)
  313.   int *valptr;
  314.   char **tokptrptr;
  315. {
  316.   char *tokptr = *tokptrptr;
  317.   int base = 0;
  318.   int ival = 0;
  319.   int explicit_base = 0;
  320.   
  321.   /* Look for an explicit base specifier, which is optional. */
  322.   
  323.   switch (*tokptr)
  324.     {
  325.     case 'd':
  326.     case 'D':
  327.       explicit_base++;
  328.       base = 10;
  329.       tokptr++;
  330.       break;
  331.     case 'b':
  332.     case 'B':
  333.       explicit_base++;
  334.       base = 2;
  335.       tokptr++;
  336.       break;
  337.     case 'h':
  338.     case 'H':
  339.       explicit_base++;
  340.       base = 16;
  341.       tokptr++;
  342.       break;
  343.     case 'o':
  344.     case 'O':
  345.       explicit_base++;
  346.       base = 8;
  347.       tokptr++;
  348.       break;
  349.     default:
  350.       base = 10;
  351.       break;
  352.     }
  353.   
  354.   /* If we found an explicit base ensure that the character after the
  355.      explicit base is a single quote. */
  356.   
  357.   if (explicit_base && (*tokptr++ != '\''))
  358.     {
  359.       return (0);
  360.     }
  361.   
  362.   /* Attempt to decode whatever follows as an integer value in the
  363.      indicated base, updating the token pointer in the process and
  364.      computing the value into ival.  Also, if we have an explicit
  365.      base, then the next character must not be a single quote, or we
  366.      have a bitstring literal, so reject the entire token in this case.
  367.      Otherwise, update the lexical scan pointer, and return non-zero
  368.      for success. */
  369.  
  370.   if (!decode_integer_value (base, &tokptr, &ival))
  371.     {
  372.       return (0);
  373.     }
  374.   else if (explicit_base && (*tokptr == '\''))
  375.     {
  376.       return (0);
  377.     }
  378.   else
  379.     {
  380.       *valptr = ival;
  381.       *tokptrptr = tokptr;
  382.       return (1);
  383.     }
  384. }
  385.  
  386. /*  If it wasn't for the fact that floating point values can contain '_'
  387.     characters, we could just let strtod do all the hard work by letting it
  388.     try to consume as much of the current token buffer as possible and
  389.     find a legal conversion.  Unfortunately we need to filter out the '_'
  390.     characters before calling strtod, which we do by copying the other
  391.     legal chars to a local buffer to be converted.  However since we also
  392.     need to keep track of where the last unconsumed character in the input
  393.     buffer is, we have transfer only as many characters as may compose a
  394.     legal floating point value. */
  395.     
  396. static int
  397. match_float_literal ()
  398. {
  399.   char *tokptr = lexptr;
  400.   char *buf;
  401.   char *copy;
  402.   char ch;
  403.   double dval;
  404.   extern double strtod ();
  405.   
  406.   /* Make local buffer in which to build the string to convert.  This is
  407.      required because underscores are valid in chill floating point numbers
  408.      but not in the string passed to strtod to convert.  The string will be
  409.      no longer than our input string. */
  410.      
  411.   copy = buf = (char *) alloca (strlen (tokptr) + 1);
  412.  
  413.   /* Transfer all leading digits to the conversion buffer, discarding any
  414.      underscores. */
  415.  
  416.   while (isdigit (*tokptr) || *tokptr == '_')
  417.     {
  418.       if (*tokptr != '_')
  419.     {
  420.       *copy++ = *tokptr;
  421.     }
  422.       tokptr++;
  423.     }
  424.  
  425.   /* Now accept either a '.', or one of [eEdD].  Dot is legal regardless
  426.      of whether we found any leading digits, and we simply accept it and
  427.      continue on to look for the fractional part and/or exponent.  One of
  428.      [eEdD] is legal only if we have seen digits, and means that there
  429.      is no fractional part.  If we find neither of these, then this is
  430.      not a floating point number, so return failure. */
  431.  
  432.   switch (*tokptr++)
  433.     {
  434.       case '.':
  435.         /* Accept and then look for fractional part and/or exponent. */
  436.     *copy++ = '.';
  437.     break;
  438.  
  439.       case 'e':
  440.       case 'E':
  441.       case 'd':
  442.       case 'D':
  443.     if (copy == buf)
  444.       {
  445.         return (0);
  446.       }
  447.     *copy++ = 'e';
  448.     goto collect_exponent;
  449.     break;
  450.  
  451.       default:
  452.     return (0);
  453.         break;
  454.     }
  455.  
  456.   /* We found a '.', copy any fractional digits to the conversion buffer, up
  457.      to the first nondigit, non-underscore character. */
  458.  
  459.   while (isdigit (*tokptr) || *tokptr == '_')
  460.     {
  461.       if (*tokptr != '_')
  462.     {
  463.       *copy++ = *tokptr;
  464.     }
  465.       tokptr++;
  466.     }
  467.  
  468.   /* Look for an exponent, which must start with one of [eEdD].  If none
  469.      is found, jump directly to trying to convert what we have collected
  470.      so far. */
  471.  
  472.   switch (*tokptr)
  473.     {
  474.       case 'e':
  475.       case 'E':
  476.       case 'd':
  477.       case 'D':
  478.     *copy++ = 'e';
  479.     tokptr++;
  480.     break;
  481.       default:
  482.     goto convert_float;
  483.     break;
  484.     }
  485.  
  486.   /* Accept an optional '-' or '+' following one of [eEdD]. */
  487.  
  488.   collect_exponent:
  489.   if (*tokptr == '+' || *tokptr == '-')
  490.     {
  491.       *copy++ = *tokptr++;
  492.     }
  493.  
  494.   /* Now copy an exponent into the conversion buffer.  Note that at the 
  495.      moment underscores are *not* allowed in exponents. */
  496.  
  497.   while (isdigit (*tokptr))
  498.     {
  499.       *copy++ = *tokptr++;
  500.     }
  501.  
  502.   /* If we transfered any chars to the conversion buffer, try to interpret its
  503.      contents as a floating point value.  If any characters remain, then we
  504.      must not have a valid floating point string. */
  505.  
  506.   convert_float:
  507.   *copy = '\0';
  508.   if (copy != buf)
  509.       {
  510.         dval = strtod (buf, ©);
  511.         if (*copy == '\0')
  512.       {
  513.         yylval.dval = dval;
  514.         lexptr = tokptr;
  515.         return (FLOAT_LITERAL);
  516.       }
  517.       }
  518.   return (0);
  519. }
  520.  
  521. /* Recognize a string literal.  A string literal is a nonzero sequence
  522.    of characters enclosed in matching single or double quotes, except that
  523.    a single character inside single quotes is a character literal, which
  524.    we reject as a string literal.  To embed the terminator character inside
  525.    a string, it is simply doubled (I.E. "this""is""one""string") */
  526.  
  527. static int
  528. match_string_literal ()
  529. {
  530.   char *tokptr = lexptr;
  531.  
  532.   for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
  533.     {
  534.       CHECKBUF (1);
  535.       if (*tokptr == *lexptr)
  536.     {
  537.       if (*(tokptr + 1) == *lexptr)
  538.         {
  539.           tokptr++;
  540.         }
  541.       else
  542.         {
  543.           break;
  544.         }
  545.     }
  546.       tempbuf[tempbufindex++] = *tokptr;
  547.     }
  548.   if (*tokptr == '\0'                    /* no terminator */
  549.       || tempbufindex == 0                /* no string */
  550.       || (tempbufindex == 1 && *tokptr == '\''))    /* char literal */
  551.     {
  552.       return (0);
  553.     }
  554.   else
  555.     {
  556.       tempbuf[tempbufindex] = '\0';
  557.       yylval.sval.ptr = tempbuf;
  558.       yylval.sval.length = tempbufindex;
  559.       lexptr = ++tokptr;
  560.       return (CHARACTER_STRING_LITERAL);
  561.     }
  562. }
  563.  
  564. /* Recognize a character literal.  A character literal is single character
  565.    or a control sequence, enclosed in single quotes.  A control sequence
  566.    is a comma separated list of one or more integer literals, enclosed
  567.    in parenthesis and introduced with a circumflex character.
  568.  
  569.    EX:  'a'  '^(7)'  '^(7,8)'
  570.  
  571.    As a GNU chill extension, the syntax C'xx' is also recognized as a 
  572.    character literal, where xx is a hex value for the character.
  573.  
  574.    Note that more than a single character, enclosed in single quotes, is
  575.    a string literal.
  576.  
  577.    Also note that the control sequence form is not in GNU Chill since it
  578.    is ambiguous with the string literal form using single quotes.  I.E.
  579.    is '^(7)' a character literal or a string literal.  In theory it it
  580.    possible to tell by context, but GNU Chill doesn't accept the control
  581.    sequence form, so neither do we (for now the code is disabled).
  582.  
  583.    Returns CHARACTER_LITERAL if a match is found.
  584.    */
  585.  
  586. static int
  587. match_character_literal ()
  588. {
  589.   char *tokptr = lexptr;
  590.   int ival = 0;
  591.   
  592.   if ((tolower (*tokptr) == 'c') && (*(tokptr + 1) == '\''))
  593.     {
  594.       /* We have a GNU chill extension form, so skip the leading "C'",
  595.      decode the hex value, and then ensure that we have a trailing
  596.      single quote character. */
  597.       tokptr += 2;
  598.       if (!decode_integer_value (16, &tokptr, &ival) || (*tokptr != '\''))
  599.     {
  600.       return (0);
  601.     }
  602.       tokptr++;
  603.     }
  604.   else if (*tokptr == '\'')
  605.     {
  606.       tokptr++;
  607.  
  608.       /* Determine which form we have, either a control sequence or the
  609.      single character form. */
  610.       
  611.       if ((*tokptr == '^') && (*(tokptr + 1) == '('))
  612.     {
  613. #if 0     /* Disable, see note above. -fnf */
  614.       /* Match and decode a control sequence.  Return zero if we don't
  615.          find a valid integer literal, or if the next unconsumed character
  616.          after the integer literal is not the trailing ')'.
  617.          FIXME:  We currently don't handle the multiple integer literal
  618.          form. */
  619.       tokptr += 2;
  620.       if (!decode_integer_literal (&ival, &tokptr) || (*tokptr++ != ')'))
  621.         {
  622.           return (0);
  623.         }
  624. #else
  625.       return (0);
  626. #endif
  627.     }
  628.       else
  629.     {
  630.       ival = *tokptr++;
  631.     }
  632.       
  633.       /* The trailing quote has not yet been consumed.  If we don't find
  634.      it, then we have no match. */
  635.       
  636.       if (*tokptr++ != '\'')
  637.     {
  638.       return (0);
  639.     }
  640.     }
  641.   else
  642.     {
  643.       /* Not a character literal. */
  644.       return (0);
  645.     }
  646.   yylval.typed_val.val = ival;
  647.   yylval.typed_val.type = builtin_type_chill_char;
  648.   lexptr = tokptr;
  649.   return (CHARACTER_LITERAL);
  650. }
  651.  
  652. /* Recognize an integer literal, as specified in Z.200 sec 5.2.4.2.
  653.    Note that according to 5.2.4.2, a single "_" is also a valid integer
  654.    literal, however GNU-chill requires there to be at least one "digit"
  655.    in any integer literal. */
  656.  
  657. static int
  658. match_integer_literal ()
  659. {
  660.   char *tokptr = lexptr;
  661.   int ival;
  662.   
  663.   if (!decode_integer_literal (&ival, &tokptr))
  664.     {
  665.       return (0);
  666.     }
  667.   else 
  668.     {
  669.       yylval.typed_val.val = ival;
  670.       yylval.typed_val.type = builtin_type_int;
  671.       lexptr = tokptr;
  672.       return (INTEGER_LITERAL);
  673.     }
  674. }
  675.  
  676. /* Recognize a bit-string literal, as specified in Z.200 sec 5.2.4.8
  677.    Note that according to 5.2.4.8, a single "_" is also a valid bit-string
  678.    literal, however GNU-chill requires there to be at least one "digit"
  679.    in any bit-string literal. */
  680.  
  681. static int
  682. match_bitstring_literal ()
  683. {
  684.   char *tokptr = lexptr;
  685.   int mask;
  686.   int bitoffset = 0;
  687.   int bitcount = 0;
  688.   int base;
  689.   int digit;
  690.   
  691.   tempbufindex = 0;
  692.  
  693.   /* Look for the required explicit base specifier. */
  694.   
  695.   switch (*tokptr++)
  696.     {
  697.     case 'b':
  698.     case 'B':
  699.       base = 2;
  700.       break;
  701.     case 'o':
  702.     case 'O':
  703.       base = 8;
  704.       break;
  705.     case 'h':
  706.     case 'H':
  707.       base = 16;
  708.       break;
  709.     default:
  710.       return (0);
  711.       break;
  712.     }
  713.   
  714.   /* Ensure that the character after the explicit base is a single quote. */
  715.   
  716.   if (*tokptr++ != '\'')
  717.     {
  718.       return (0);
  719.     }
  720.   
  721.   while (*tokptr != '\0' && *tokptr != '\'')
  722.     {
  723.       digit = tolower (*tokptr);
  724.       tokptr++;
  725.       switch (digit)
  726.     {
  727.       case '_':
  728.         continue;
  729.       case '0':  case '1':  case '2':  case '3':  case '4':
  730.       case '5':  case '6':  case '7':  case '8':  case '9':
  731.         digit -= '0';
  732.         break;
  733.       case 'a':  case 'b':  case 'c':  case 'd':  case 'e': case 'f':
  734.         digit -= 'a';
  735.         digit += 10;
  736.         break;
  737.       default:
  738.         return (0);
  739.         break;
  740.     }
  741.       if (digit >= base)
  742.     {
  743.       /* Found something not in domain for current base. */
  744.       return (0);
  745.     }
  746.       else
  747.     {
  748.       /* Extract bits from digit, starting with the msbit appropriate for
  749.          the current base, and packing them into the bitstring byte,
  750.          starting at the lsbit. */
  751.       for (mask = (base >> 1); mask > 0; mask >>= 1)
  752.         {
  753.           bitcount++;
  754.           CHECKBUF (1);
  755.           if (digit & mask)
  756.         {
  757.           tempbuf[tempbufindex] |= (1 << bitoffset);
  758.         }
  759.           bitoffset++;
  760.           if (bitoffset == HOST_CHAR_BIT)
  761.         {
  762.           bitoffset = 0;
  763.           tempbufindex++;
  764.         }
  765.         }
  766.     }
  767.     }
  768.   
  769.   /* Verify that we consumed everything up to the trailing single quote,
  770.      and that we found some bits (IE not just underbars). */
  771.  
  772.   if (*tokptr++ != '\'')
  773.     {
  774.       return (0);
  775.     }
  776.   else 
  777.     {
  778.       yylval.sval.ptr = tempbuf;
  779.       yylval.sval.length = bitcount;
  780.       lexptr = tokptr;
  781.       return (BIT_STRING_LITERAL);
  782.     }
  783. }
  784.  
  785. /* Recognize tokens that start with '$'.  These include:
  786.  
  787.     $regname    A native register name or a "standard
  788.             register name".
  789.             Return token GDB_REGNAME.
  790.  
  791.     $variable    A convenience variable with a name chosen
  792.             by the user.
  793.             Return token GDB_VARIABLE.
  794.  
  795.     $digits        Value history with index <digits>, starting
  796.             from the first value which has index 1.
  797.             Return GDB_LAST.
  798.  
  799.     $$digits    Value history with index <digits> relative
  800.             to the last value.  I.E. $$0 is the last
  801.             value, $$1 is the one previous to that, $$2
  802.             is the one previous to $$1, etc.
  803.             Return token GDB_LAST.
  804.  
  805.     $ | $0 | $$0    The last value in the value history.
  806.             Return token GDB_LAST.
  807.  
  808.     $$        An abbreviation for the second to the last
  809.             value in the value history, I.E. $$1
  810.             Return token GDB_LAST.
  811.  
  812.     Note that we currently assume that register names and convenience
  813.     variables follow the convention of starting with a letter or '_'.
  814.  
  815.    */
  816.  
  817. static int
  818. match_dollar_tokens ()
  819. {
  820.   char *tokptr;
  821.   int regno;
  822.   int namelength;
  823.   int negate;
  824.   int ival;
  825.  
  826.   /* We will always have a successful match, even if it is just for
  827.      a single '$', the abbreviation for $$0.  So advance lexptr. */
  828.  
  829.   tokptr = ++lexptr;
  830.  
  831.   if (*tokptr == '_' || isalpha (*tokptr))
  832.     {
  833.       /* Look for a match with a native register name, usually something
  834.      like "r0" for example. */
  835.  
  836.       for (regno = 0; regno < NUM_REGS; regno++)
  837.     {
  838.       namelength = strlen (reg_names[regno]);
  839.       if (STREQN (tokptr, reg_names[regno], namelength)
  840.           && !isalnum (tokptr[namelength]))
  841.         {
  842.           yylval.lval = regno;
  843.           lexptr += namelength + 1;
  844.           return (GDB_REGNAME);
  845.         }
  846.     }
  847.  
  848.       /* Look for a match with a standard register name, usually something
  849.      like "pc", which gdb always recognizes as the program counter
  850.      regardless of what the native register name is. */
  851.  
  852.       for (regno = 0; regno < num_std_regs; regno++)
  853.     {
  854.       namelength = strlen (std_regs[regno].name);
  855.       if (STREQN (tokptr, std_regs[regno].name, namelength)
  856.           && !isalnum (tokptr[namelength]))
  857.         {
  858.           yylval.lval = std_regs[regno].regnum;
  859.           lexptr += namelength;
  860.           return (GDB_REGNAME);
  861.         }
  862.     }
  863.  
  864.       /* Attempt to match against a convenience variable.  Note that
  865.      this will always succeed, because if no variable of that name
  866.      already exists, the lookup_internalvar will create one for us.
  867.      Also note that both lexptr and tokptr currently point to the
  868.      start of the input string we are trying to match, and that we
  869.      have already tested the first character for non-numeric, so we
  870.      don't have to treat it specially. */
  871.  
  872.       while (*tokptr == '_' || isalnum (*tokptr))
  873.     {
  874.       tokptr++;
  875.     }
  876.       yylval.sval.ptr = lexptr;
  877.       yylval.sval.length = tokptr - lexptr;
  878.       yylval.ivar = lookup_internalvar (copy_name (yylval.sval));
  879.       lexptr = tokptr;
  880.       return (GDB_VARIABLE);
  881.     }
  882.  
  883.   /* Since we didn't match against a register name or convenience
  884.      variable, our only choice left is a history value. */
  885.  
  886.   if (*tokptr == '$')
  887.     {
  888.       negate = 1;
  889.       ival = 1;
  890.       tokptr++;
  891.     }
  892.   else
  893.     {
  894.       negate = 0;
  895.       ival = 0;
  896.     }
  897.  
  898.   /* Attempt to decode more characters as an integer value giving
  899.      the index in the history list.  If successful, the value will
  900.      overwrite ival (currently 0 or 1), and if not, ival will be
  901.      left alone, which is good since it is currently correct for
  902.      the '$' or '$$' case. */
  903.  
  904.   decode_integer_literal (&ival, &tokptr);
  905.   yylval.lval = negate ? -ival : ival;
  906.   lexptr = tokptr;
  907.   return (GDB_LAST);
  908. }
  909.  
  910. struct token
  911. {
  912.   char *operator;
  913.   int token;
  914. };
  915.  
  916. static const struct token idtokentab[] =
  917. {
  918.     { "length", LENGTH },
  919.     { "lower", LOWER },
  920.     { "upper", UPPER },
  921.     { "andif", ANDIF },
  922.     { "pred", PRED },
  923.     { "succ", SUCC },
  924.     { "card", CARD },
  925.     { "size", SIZE },
  926.     { "orif", ORIF },
  927.     { "num", NUM },
  928.     { "abs", ABS },
  929.     { "max", MAX_TOKEN },
  930.     { "min", MIN_TOKEN },
  931.     { "mod", MOD },
  932.     { "rem", REM },
  933.     { "not", NOT },
  934.     { "xor", LOGXOR },
  935.     { "and", LOGAND },
  936.     { "in", IN },
  937.     { "or", LOGIOR }
  938. };
  939.  
  940. static const struct token tokentab2[] =
  941. {
  942.     { ":=", GDB_ASSIGNMENT },
  943.     { "//", SLASH_SLASH },
  944.     { "->", POINTER },
  945.     { "/=", NOTEQUAL },
  946.     { "<=", LEQ },
  947.     { ">=", GTR }
  948. };
  949.  
  950. /* Read one token, getting characters through lexptr.  */
  951. /* This is where we will check to make sure that the language and the
  952.    operators used are compatible.  */
  953.  
  954. static int
  955. yylex ()
  956. {
  957.     unsigned int i;
  958.     int token;
  959.     char *simplename;
  960.     struct symbol *sym;
  961.  
  962.     /* Skip over any leading whitespace. */
  963.     while (isspace (*lexptr))
  964.     {
  965.         lexptr++;
  966.     }
  967.     /* Look for special single character cases which can't be the first
  968.        character of some other multicharacter token. */
  969.     switch (*lexptr)
  970.     {
  971.         case '\0':
  972.             return (0);
  973.         case ',':
  974.         case '=':
  975.         case ';':
  976.         case '!':
  977.         case '+':
  978.         case '*':
  979.         case '(':
  980.         case ')':
  981.         case '[':
  982.         case ']':
  983.         return (*lexptr++);
  984.     }
  985.     /* Look for characters which start a particular kind of multicharacter
  986.        token, such as a character literal, register name, convenience
  987.        variable name, string literal, etc. */
  988.     switch (*lexptr)
  989.       {
  990.     case '\'':
  991.     case '\"':
  992.       /* First try to match a string literal, which is any nonzero
  993.          sequence of characters enclosed in matching single or double
  994.          quotes, except that a single character inside single quotes
  995.          is a character literal, so we have to catch that case also. */
  996.       token = match_string_literal ();
  997.       if (token != 0)
  998.         {
  999.           return (token);
  1000.         }
  1001.       if (*lexptr == '\'')
  1002.         {
  1003.           token = match_character_literal ();
  1004.           if (token != 0)
  1005.         {
  1006.           return (token);
  1007.         }
  1008.         }
  1009.       break;
  1010.         case 'C':
  1011.         case 'c':
  1012.       token = match_character_literal ();
  1013.       if (token != 0)
  1014.         {
  1015.           return (token);
  1016.         }
  1017.       break;
  1018.     case '$':
  1019.       token = match_dollar_tokens ();
  1020.       if (token != 0)
  1021.         {
  1022.           return (token);
  1023.         }
  1024.       break;
  1025.       }
  1026.     /* See if it is a special token of length 2.  */
  1027.     for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
  1028.     {
  1029.         if (STREQN (lexptr, tokentab2[i].operator, 2))
  1030.         {
  1031.             lexptr += 2;
  1032.             return (tokentab2[i].token);
  1033.         }
  1034.     }
  1035.     /* Look for single character cases which which could be the first
  1036.        character of some other multicharacter token, but aren't, or we
  1037.        would already have found it. */
  1038.     switch (*lexptr)
  1039.     {
  1040.         case '-':
  1041.         case ':':
  1042.         case '/':
  1043.         case '<':
  1044.         case '>':
  1045.         return (*lexptr++);
  1046.     }
  1047.     /* Look for a float literal before looking for an integer literal, so
  1048.        we match as much of the input stream as possible. */
  1049.     token = match_float_literal ();
  1050.     if (token != 0)
  1051.     {
  1052.         return (token);
  1053.     }
  1054.     token = match_bitstring_literal ();
  1055.     if (token != 0)
  1056.     {
  1057.         return (token);
  1058.     }
  1059.     token = match_integer_literal ();
  1060.     if (token != 0)
  1061.     {
  1062.         return (token);
  1063.     }
  1064.  
  1065.     /* Try to match a simple name string, and if a match is found, then
  1066.        further classify what sort of name it is and return an appropriate
  1067.        token.  Note that attempting to match a simple name string consumes
  1068.        the token from lexptr, so we can't back out if we later find that
  1069.        we can't classify what sort of name it is. */
  1070.  
  1071.     simplename = match_simple_name_string ();
  1072.  
  1073.     if (simplename != NULL)
  1074.       {
  1075.     /* See if it is a reserved identifier. */
  1076.     for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
  1077.         {
  1078.         if (STREQ (simplename, idtokentab[i].operator))
  1079.             {
  1080.             return (idtokentab[i].token);
  1081.             }
  1082.         }
  1083.  
  1084.     /* Look for other special tokens. */
  1085.     if (STREQ (simplename, "true"))
  1086.         {
  1087.         yylval.ulval = 1;
  1088.         return (BOOLEAN_LITERAL);
  1089.         }
  1090.     if (STREQ (simplename, "false"))
  1091.         {
  1092.         yylval.ulval = 0;
  1093.         return (BOOLEAN_LITERAL);
  1094.         }
  1095.  
  1096.     sym = lookup_symbol (simplename, expression_context_block,
  1097.                  VAR_NAMESPACE, (int *) NULL,
  1098.                  (struct symtab **) NULL);
  1099.     if (sym != NULL)
  1100.       {
  1101.         yylval.ssym.stoken.ptr = NULL;
  1102.         yylval.ssym.stoken.length = 0;
  1103.         yylval.ssym.sym = sym;
  1104.         yylval.ssym.is_a_field_of_this = 0;    /* FIXME, C++'ism */
  1105.         switch (SYMBOL_CLASS (sym))
  1106.           {
  1107.           case LOC_BLOCK:
  1108.         /* Found a procedure name. */
  1109.         return (GENERAL_PROCEDURE_NAME);
  1110.           case LOC_STATIC:
  1111.         /* Found a global or local static variable. */
  1112.         return (LOCATION_NAME);
  1113.           case LOC_REGISTER:
  1114.           case LOC_ARG:
  1115.           case LOC_REF_ARG:
  1116.           case LOC_REGPARM:
  1117.           case LOC_LOCAL:
  1118.           case LOC_LOCAL_ARG:
  1119.         if (innermost_block == NULL
  1120.             || contained_in (block_found, innermost_block))
  1121.           {
  1122.             innermost_block = block_found;
  1123.           }
  1124.         return (LOCATION_NAME);
  1125.         break;
  1126.           case LOC_CONST:
  1127.           case LOC_LABEL:
  1128.         return (LOCATION_NAME);
  1129.         break;
  1130.           case LOC_TYPEDEF:
  1131.         yylval.tsym.type = SYMBOL_TYPE (sym);
  1132.         return TYPENAME;
  1133.           case LOC_UNDEF:
  1134.           case LOC_CONST_BYTES:
  1135.           case LOC_OPTIMIZED_OUT:
  1136.         error ("Symbol \"%s\" names no location.", simplename);
  1137.         break;
  1138.           }
  1139.       }
  1140.     else if (!have_full_symbols () && !have_partial_symbols ())
  1141.       {
  1142.         error ("No symbol table is loaded.  Use the \"file\" command.");
  1143.       }
  1144.     else
  1145.       {
  1146.         error ("No symbol \"%s\" in current context.", simplename);
  1147.       }
  1148.       }
  1149.  
  1150.     /* Catch single character tokens which are not part of some
  1151.        longer token. */
  1152.  
  1153.     switch (*lexptr)
  1154.       {
  1155.     case '.':            /* Not float for example. */
  1156.       lexptr++;
  1157.       while (isspace (*lexptr)) lexptr++;
  1158.       simplename = match_simple_name_string ();
  1159.       if (!simplename)
  1160.         return '.';
  1161.       return FIELD_NAME;
  1162.       }
  1163.  
  1164.     return (ILLEGAL_TOKEN);
  1165. }
  1166.  
  1167. void
  1168. yyerror (msg)
  1169.      char *msg;    /* unused */
  1170. {
  1171.   printf ("Parsing:  %s\n", lexptr);
  1172.   if (yychar < 256)
  1173.     {
  1174.       error ("Invalid syntax in expression near character '%c'.", yychar);
  1175.     }
  1176.   else
  1177.     {
  1178.       error ("Invalid syntax in expression");
  1179.     }
  1180. }
  1181. int yyexca[] ={
  1182. -1, 1,
  1183.     0, -1,
  1184.     -2, 0,
  1185. -1, 17,
  1186.     40, 121,
  1187.     -2, 99,
  1188. -1, 130,
  1189.     297, 30,
  1190.     314, 30,
  1191.     40, 30,
  1192.     -2, 97,
  1193.     };
  1194. # define YYNPROD 142
  1195. # define YYLAST 753
  1196. int yyact[]={
  1197.  
  1198.     60,    89,   190,   237,   191,    79,   219,   141,   203,   107,
  1199.    252,   102,    87,    88,   108,    98,    94,    96,    84,    85,
  1200.     86,   142,   196,    45,    46,    47,    48,   197,   101,    49,
  1201.     50,    51,    52,   133,   193,    93,   103,    91,   104,   164,
  1202.    227,   165,   231,   225,   159,   160,   140,    90,    38,   200,
  1203.    192,    17,    83,   114,     3,   224,   183,    61,   251,   222,
  1204.     15,     2,    78,   250,   223,   202,   238,    11,   199,   247,
  1205.    246,   229,   228,   189,   228,   245,   244,   243,    60,    39,
  1206.    241,   240,   218,    79,   217,   216,   212,   211,   210,   209,
  1207.    208,    18,   207,   206,   205,   204,   166,    60,   215,   214,
  1208.    213,   125,   124,   123,   122,   121,   120,   119,   118,   117,
  1209.    116,   115,   112,   111,   161,     1,    26,     8,   132,   195,
  1210.     92,   179,   178,   177,   187,   175,   163,   230,   127,   127,
  1211.    127,   162,    55,   131,   226,   158,   157,    54,    43,    42,
  1212.     41,    40,   126,   129,     7,   194,     9,     5,   137,   138,
  1213.     37,   139,   134,   135,   136,   106,    60,    36,    57,    35,
  1214.     34,    79,    33,    83,    32,   153,   154,   155,   156,    31,
  1215.     60,   127,    30,    29,   131,    28,   176,   185,   185,    27,
  1216.     25,   186,    24,   150,   151,   152,   143,   144,   145,   146,
  1217.    147,   148,   149,    16,     0,     0,     0,     0,     0,     0,
  1218.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1219.      0,     0,     0,     0,     0,     0,     0,    10,     0,    23,
  1220.     53,    56,    58,    59,     0,    83,     0,    62,    63,    64,
  1221.     65,    66,     0,     0,    83,     0,     0,     0,     0,   221,
  1222.      0,   220,     0,     0,     0,     0,    45,    46,    47,    48,
  1223.     44,    19,    49,    50,    51,    52,     6,    60,    14,   232,
  1224.      0,    95,    97,    99,   100,   235,     0,     0,   236,     0,
  1225.      0,    60,     0,    80,    81,    82,     0,    13,   109,   110,
  1226.      0,     0,     0,    67,    68,    69,    70,    71,    72,    73,
  1227.     74,    75,    76,    77,    21,    20,    22,    23,    53,    56,
  1228.     58,    59,   198,   105,   249,    62,    63,    64,    65,    66,
  1229.    248,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1230.      0,     0,     0,     0,    45,    46,    47,    48,    44,    19,
  1231.     49,    50,    51,    52,     6,     0,    14,     0,     0,     0,
  1232.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1233.      0,    80,    81,    82,     0,    13,     0,     0,     0,     0,
  1234.      0,    67,    68,    69,    70,    71,    72,    73,    74,    75,
  1235.     76,    77,    21,    20,    22,    23,    53,    56,    58,    59,
  1236.      0,     0,     0,    62,    63,    64,    65,    66,     0,    23,
  1237.     53,    56,    58,    59,   180,   181,   182,    62,    63,    64,
  1238.     65,    66,    45,    46,    47,    48,    44,    19,    49,    50,
  1239.     51,    52,     6,     0,     0,     0,    45,    46,    47,    48,
  1240.     44,    19,    49,    50,    51,    52,     6,     0,     0,    80,
  1241.     81,    82,     0,     0,     0,     0,     0,     0,     0,    67,
  1242.     68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
  1243.     21,    20,    22,    67,    68,    69,    70,    71,    72,    73,
  1244.     74,    75,    76,    77,    21,    20,    22,     4,     0,     0,
  1245.      0,     0,     0,     0,     0,     0,    23,    53,    56,    58,
  1246.     59,     0,     0,     0,    62,    63,    64,    65,    66,     0,
  1247.     23,    53,    56,    58,    59,     0,     0,     0,    62,    63,
  1248.     64,    65,    66,    45,    46,    47,    48,    44,    19,    49,
  1249.     50,    51,    52,     6,   128,    12,     0,    45,    46,    47,
  1250.     48,    44,    19,    49,    50,    51,    52,     6,   113,     0,
  1251.      0,    81,    82,     0,     0,     0,     0,     0,     0,     0,
  1252.     67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
  1253.     77,    21,    20,    22,    67,    68,    69,    70,    71,    72,
  1254.     73,    74,    75,    76,    77,    21,    20,    22,     0,     0,
  1255.      0,     0,     0,     0,     0,    12,     0,     0,     0,     0,
  1256.      0,     0,     0,   167,   168,   169,   170,   171,   172,   173,
  1257.      0,   184,   184,   188,     0,     0,   130,     0,     0,     0,
  1258.      0,     0,     0,     0,    12,     0,     0,     0,     0,     0,
  1259.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1260.      0,     0,     0,     0,     0,     0,     0,     0,     0,   201,
  1261.     12,    12,    12,    12,    12,    12,    12,   174,    12,    12,
  1262.     12,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1263.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1264.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1265.      0,     0,     0,     0,     0,     0,    12,     0,     0,     0,
  1266.      0,   233,   234,   201,     0,     0,     0,     0,     0,     0,
  1267.      0,   239,     0,     0,     0,     0,   242,     0,     0,     0,
  1268.      0,     0,     0,     0,     0,   239,     0,     0,     0,     0,
  1269.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1270.      0,     0,     0,     0,     0,     0,     0,     0,    12,    12,
  1271.     12,     0,     0,     0,     0,     0,     0,     0,    12,     0,
  1272.      0,     0,     0,    12,     0,     0,     0,     0,     0,     0,
  1273.      0,     0,    12 };
  1274. int yypact[]={
  1275.  
  1276.    -40, -1000, -1000,    57, -1000, -1000, -1000,  -283, -1000, -1000,
  1277.  -1000,  -292,  -336,  -244,  -247,   -45, -1000,  -286,    -7, -1000,
  1278.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
  1279.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,  -263,   -33,
  1280.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
  1281.  -1000, -1000, -1000, -1000,    73,    72, -1000, -1000, -1000, -1000,
  1282.     38, -1000, -1000, -1000, -1000, -1000, -1000,    71,    70,    69,
  1283.     68,    67,    66,    65,    64,    63,    62,    61, -1000,   217,
  1284.    217,   231,  -252, -1000,   116,   116,   116,   116,   116,   -40,
  1285.   -311, -1000,  -278, -1000,   116,   116,   116,   116,   116,   116,
  1286.    116, -1000, -1000,   116,   116,   116, -1000,   116,   116,   116,
  1287.    116,  -228,  -237,    55,    57,    38,    38,    38,    38,    38,
  1288.     38,    38,   130,    38,    38,    38, -1000, -1000, -1000, -1000,
  1289.  -1000,  -286, -1000, -1000,  -292,  -292,  -292,   -45,   -45, -1000,
  1290.   -317,  -249,  -262,    -7,    -7,    -7,    -7,    -7,    -7,    -7,
  1291.    -33,   -33,   -33, -1000, -1000, -1000, -1000,   -14,    10, -1000,
  1292.  -1000,    38,     7,  -308, -1000, -1000, -1000,    54,    53,    52,
  1293.     51,    49,    48,    47,    46,    45,    57,    60,    59,    58,
  1294.  -1000, -1000, -1000,    44, -1000,    57,    43,    41, -1000,  -314,
  1295.   -249,  -244, -1000, -1000,   -32,     6, -1000, -1000,  -232,  -234,
  1296.     30, -1000,  -235,  -232, -1000, -1000, -1000, -1000, -1000, -1000,
  1297.  -1000, -1000, -1000,    38,    38,    38, -1000, -1000, -1000, -1000,
  1298.  -1000,  -311,  -316,    38,    40, -1000,    39, -1000,    38, -1000,
  1299.     36, -1000,    35,    34,    29,    28,  -317,    38,     4, -1000,
  1300.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,   -35,
  1301.  -1000,  -290, -1000 };
  1302. int yypgo[]={
  1303.  
  1304.      0,   514,   193,    51,   182,   180,   116,   179,   175,   173,
  1305.    172,   169,   164,   162,   160,   159,   158,   157,   150,    48,
  1306.     61,   147,   467,   146,    46,    73,    66,   145,   144,    67,
  1307.     60,    91,    79,    57,    62,   141,   140,   139,   138,   137,
  1308.    136,   135,   134,    55,   132,    49,   131,   127,   126,   125,
  1309.     56,   124,   123,   122,   121,    47,   120,    50,   119,   118,
  1310.    117,    53,   115,   114 };
  1311. int yyr1[]={
  1312.  
  1313.      0,    62,    62,    20,    20,    21,     1,     1,     2,     2,
  1314.      2,     2,     2,    45,    45,     3,     3,     3,     3,     3,
  1315.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1316.      4,     5,     5,     5,     5,     5,     6,     6,     6,     6,
  1317.      6,     6,     6,     6,     7,     8,     9,     9,    63,    10,
  1318.     11,    11,    12,    13,    14,    15,    17,    18,    19,    22,
  1319.     22,    22,    23,    23,    24,    25,    25,    26,    27,    28,
  1320.     28,    28,    28,    29,    29,    29,    30,    30,    30,    30,
  1321.     30,    30,    30,    30,    31,    31,    31,    31,    32,    32,
  1322.     32,    32,    32,    33,    33,    33,    33,    34,    34,    34,
  1323.     60,    16,    16,    16,    16,    16,    16,    16,    16,    16,
  1324.     16,    16,    16,    49,    49,    49,    49,    61,    50,    50,
  1325.     51,    44,    52,    53,    54,    35,    36,    37,    38,    39,
  1326.     40,    41,    42,    43,    46,    47,    48,    55,    56,    57,
  1327.     58,    59 };
  1328. int yyr2[]={
  1329.  
  1330.      0,     3,     3,     3,     3,     3,     2,     5,     3,     3,
  1331.      3,     3,     3,     3,     7,     3,     3,     3,     3,     3,
  1332.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1333.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1334.      3,     3,     3,     3,     3,     9,    13,    13,     1,    11,
  1335.     13,    13,     5,     5,     3,     3,     3,     3,     7,     3,
  1336.      3,     3,    11,    19,     5,     5,     9,     3,     9,     3,
  1337.      7,     7,     7,     3,     7,     7,     3,     7,     7,     7,
  1338.      7,     7,     7,     7,     3,     7,     7,     7,     3,     7,
  1339.      7,     7,     7,     3,     5,     5,     5,     5,     5,     3,
  1340.      7,     9,     9,     9,     9,     9,     9,     9,     9,     9,
  1341.      9,     9,     9,     3,     9,     9,     9,     2,     3,     3,
  1342.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1343.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1344.      3,     3 };
  1345. int yychk[]={
  1346.  
  1347.  -1000,   -62,   -20,   -61,   -22,   -21,   296,   -28,   -60,   -23,
  1348.    257,   -29,    -1,   317,   298,   -30,    -2,    -3,   -31,   291,
  1349.    335,   334,   336,   259,    -4,    -5,    -6,    -7,    -8,    -9,
  1350.    -10,   -11,   -12,   -13,   -14,   -15,   -17,   -18,   -19,   -32,
  1351.    -35,   -36,   -37,   -38,   290,   286,   287,   288,   289,   292,
  1352.    293,   294,   295,   260,   -39,   -44,   261,   -16,   262,   263,
  1353.     40,   -33,   267,   268,   269,   270,   271,   323,   324,   325,
  1354.    326,   327,   328,   329,   330,   331,   332,   333,   -34,    45,
  1355.    313,   314,   315,   -19,   301,   302,   303,   304,   305,   337,
  1356.    -55,   281,   -56,   282,    61,   306,    62,   307,    60,   308,
  1357.    309,   314,   297,    43,    45,   310,    -6,    42,    47,   311,
  1358.    312,    40,    40,   -22,   -61,    40,    40,    40,    40,    40,
  1359.     40,    40,    40,    40,    40,    40,   -34,   -19,    -1,   -34,
  1360.     -1,    -3,   -59,   285,   -29,   -29,   -29,   -30,   -30,   -20,
  1361.    -24,   318,   299,   -31,   -31,   -31,   -31,   -31,   -31,   -31,
  1362.    -32,   -32,   -32,   -33,   -33,   -33,   -33,   -40,   -41,   272,
  1363.    273,   -63,   -46,   -48,   276,   278,    41,   -22,   -22,   -22,
  1364.    -22,   -22,   -22,   -22,    -1,   -49,   -61,   -52,   -53,   -54,
  1365.    264,   265,   266,   -50,   -22,   -61,   -50,   -51,   -22,   -25,
  1366.    319,   321,   -57,   283,   -27,   -58,   284,    41,   316,    58,
  1367.    -45,   -22,    58,   316,    41,    41,    41,    41,    41,    41,
  1368.     41,    41,    41,    40,    40,    40,    41,    41,    41,   320,
  1369.    -57,   -55,    91,    58,   -43,   275,   -42,   274,    44,    41,
  1370.    -47,   277,   -43,   -22,   -22,   -45,   -24,   319,   -26,   -22,
  1371.     41,    41,   -22,    41,    41,    41,    41,    41,   -25,   -26,
  1372.     59,    93,   300 };
  1373. int yydef[]={
  1374.  
  1375.      0,    -2,     1,     2,     3,     4,   117,    59,    60,    61,
  1376.      5,    69,    30,     0,     0,    73,     6,    -2,    76,     8,
  1377.      9,    10,    11,    12,    15,    16,    17,    18,    19,    20,
  1378.     21,    22,    23,    24,    25,    26,    27,    28,    29,    84,
  1379.     31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
  1380.     41,    42,    43,    44,     0,     0,    54,    55,    56,    57,
  1381.      0,    88,   125,   126,   127,   128,   129,     0,     0,     0,
  1382.      0,     0,     0,     0,     0,     0,     0,     0,    93,     0,
  1383.      0,     0,     0,    53,     0,     0,     0,     0,     0,     0,
  1384.      0,   137,     0,   138,     0,     0,     0,     0,     0,     0,
  1385.      0,     7,    52,     0,     0,     0,    96,     0,     0,     0,
  1386.      0,     0,    48,     0,     0,     0,     0,     0,     0,     0,
  1387.      0,     0,     0,     0,     0,     0,    94,    29,    30,    95,
  1388.     -2,   121,    98,   141,    70,    71,    72,    74,    75,   100,
  1389.      0,     0,     0,    77,    78,    79,    80,    81,    82,    83,
  1390.     85,    86,    87,    89,    90,    91,    92,     0,     0,   130,
  1391.    131,     0,     0,     0,   134,   136,    58,     0,     0,     0,
  1392.      0,     0,     0,     0,    30,     0,   113,     0,     0,     0,
  1393.    122,   123,   124,     0,   118,   119,     0,     0,   120,     0,
  1394.      0,     0,    64,   139,     0,     0,   140,    45,     0,     0,
  1395.      0,    13,     0,     0,   101,   102,   103,   104,   105,   106,
  1396.    107,   108,   109,     0,     0,     0,   110,   111,   112,    62,
  1397.     65,     0,     0,     0,     0,   133,     0,   132,     0,    49,
  1398.      0,   135,     0,     0,     0,     0,     0,     0,     0,    67,
  1399.     47,    46,    14,    50,    51,   114,   115,   116,    66,     0,
  1400.     68,     0,    63 };
  1401. typedef struct { char *t_name; int t_val; } yytoktype;
  1402. #ifndef YYDEBUG
  1403. #    define YYDEBUG    0    /* don't allow debugging */
  1404. #endif
  1405.  
  1406. #if YYDEBUG
  1407.  
  1408. yytoktype yytoks[] =
  1409. {
  1410.     "FIXME_01",    257,
  1411.     "FIXME_02",    258,
  1412.     "FIXME_03",    259,
  1413.     "FIXME_04",    260,
  1414.     "FIXME_05",    261,
  1415.     "FIXME_06",    262,
  1416.     "FIXME_07",    263,
  1417.     "FIXME_08",    264,
  1418.     "FIXME_09",    265,
  1419.     "FIXME_10",    266,
  1420.     "FIXME_11",    267,
  1421.     "FIXME_12",    268,
  1422.     "FIXME_13",    269,
  1423.     "FIXME_14",    270,
  1424.     "FIXME_15",    271,
  1425.     "FIXME_16",    272,
  1426.     "FIXME_17",    273,
  1427.     "FIXME_18",    274,
  1428.     "FIXME_19",    275,
  1429.     "FIXME_20",    276,
  1430.     "FIXME_21",    277,
  1431.     "FIXME_22",    278,
  1432.     "FIXME_24",    279,
  1433.     "FIXME_25",    280,
  1434.     "FIXME_26",    281,
  1435.     "FIXME_27",    282,
  1436.     "FIXME_28",    283,
  1437.     "FIXME_29",    284,
  1438.     "FIXME_30",    285,
  1439.     "INTEGER_LITERAL",    286,
  1440.     "BOOLEAN_LITERAL",    287,
  1441.     "CHARACTER_LITERAL",    288,
  1442.     "FLOAT_LITERAL",    289,
  1443.     "GENERAL_PROCEDURE_NAME",    290,
  1444.     "LOCATION_NAME",    291,
  1445.     "SET_LITERAL",    292,
  1446.     "EMPTINESS_LITERAL",    293,
  1447.     "CHARACTER_STRING_LITERAL",    294,
  1448.     "BIT_STRING_LITERAL",    295,
  1449.     "TYPENAME",    296,
  1450.     "FIELD_NAME",    297,
  1451.     ".",    46,
  1452.     ";",    59,
  1453.     ":",    58,
  1454.     "CASE",    298,
  1455.     "OF",    299,
  1456.     "ESAC",    300,
  1457.     "LOGIOR",    301,
  1458.     "ORIF",    302,
  1459.     "LOGXOR",    303,
  1460.     "LOGAND",    304,
  1461.     "ANDIF",    305,
  1462.     "=",    61,
  1463.     "NOTEQUAL",    306,
  1464.     ">",    62,
  1465.     "GTR",    307,
  1466.     "<",    60,
  1467.     "LEQ",    308,
  1468.     "IN",    309,
  1469.     "+",    43,
  1470.     "-",    45,
  1471.     "*",    42,
  1472.     "/",    47,
  1473.     "SLASH_SLASH",    310,
  1474.     "MOD",    311,
  1475.     "REM",    312,
  1476.     "NOT",    313,
  1477.     "POINTER",    314,
  1478.     "RECEIVE",    315,
  1479.     "[",    91,
  1480.     "]",    93,
  1481.     "(",    40,
  1482.     ")",    41,
  1483.     "UP",    316,
  1484.     "IF",    317,
  1485.     "THEN",    318,
  1486.     "ELSE",    319,
  1487.     "FI",    320,
  1488.     "ELSIF",    321,
  1489.     "ILLEGAL_TOKEN",    322,
  1490.     "NUM",    323,
  1491.     "PRED",    324,
  1492.     "SUCC",    325,
  1493.     "ABS",    326,
  1494.     "CARD",    327,
  1495.     "MAX_TOKEN",    328,
  1496.     "MIN_TOKEN",    329,
  1497.     "SIZE",    330,
  1498.     "UPPER",    331,
  1499.     "LOWER",    332,
  1500.     "LENGTH",    333,
  1501.     "GDB_REGNAME",    334,
  1502.     "GDB_LAST",    335,
  1503.     "GDB_VARIABLE",    336,
  1504.     "GDB_ASSIGNMENT",    337,
  1505.     "-unknown-",    -1    /* ends search */
  1506. };
  1507.  
  1508. char * yyreds[] =
  1509. {
  1510.     "-no such reduction-",
  1511.     "start : value",
  1512.     "start : mode_name",
  1513.     "value : expression",
  1514.     "value : undefined_value",
  1515.     "undefined_value : FIXME_01",
  1516.     "location : access_name",
  1517.     "location : primitive_value POINTER",
  1518.     "access_name : LOCATION_NAME",
  1519.     "access_name : GDB_LAST",
  1520.     "access_name : GDB_REGNAME",
  1521.     "access_name : GDB_VARIABLE",
  1522.     "access_name : FIXME_03",
  1523.     "expression_list : expression",
  1524.     "expression_list : expression_list ',' expression",
  1525.     "primitive_value : location_contents",
  1526.     "primitive_value : value_name",
  1527.     "primitive_value : literal",
  1528.     "primitive_value : tuple",
  1529.     "primitive_value : value_string_element",
  1530.     "primitive_value : value_string_slice",
  1531.     "primitive_value : value_array_element",
  1532.     "primitive_value : value_array_slice",
  1533.     "primitive_value : value_structure_field",
  1534.     "primitive_value : expression_conversion",
  1535.     "primitive_value : value_procedure_call",
  1536.     "primitive_value : value_built_in_routine_call",
  1537.     "primitive_value : start_expression",
  1538.     "primitive_value : zero_adic_operator",
  1539.     "primitive_value : parenthesised_expression",
  1540.     "location_contents : location",
  1541.     "value_name : synonym_name",
  1542.     "value_name : value_enumeration_name",
  1543.     "value_name : value_do_with_name",
  1544.     "value_name : value_receive_name",
  1545.     "value_name : GENERAL_PROCEDURE_NAME",
  1546.     "literal : INTEGER_LITERAL",
  1547.     "literal : BOOLEAN_LITERAL",
  1548.     "literal : CHARACTER_LITERAL",
  1549.     "literal : FLOAT_LITERAL",
  1550.     "literal : SET_LITERAL",
  1551.     "literal : EMPTINESS_LITERAL",
  1552.     "literal : CHARACTER_STRING_LITERAL",
  1553.     "literal : BIT_STRING_LITERAL",
  1554.     "tuple : FIXME_04",
  1555.     "value_string_element : string_primitive_value '(' start_element ')'",
  1556.     "value_string_slice : string_primitive_value '(' left_element ':' right_element ')'",
  1557.     "value_string_slice : string_primitive_value '(' start_element UP slice_size ')'",
  1558.     "value_array_element : array_primitive_value '('",
  1559.     "value_array_element : array_primitive_value '(' expression_list ')'",
  1560.     "value_array_slice : array_primitive_value '(' lower_element ':' upper_element ')'",
  1561.     "value_array_slice : array_primitive_value '(' first_element UP slice_size ')'",
  1562.     "value_structure_field : primitive_value FIELD_NAME",
  1563.     "expression_conversion : mode_name parenthesised_expression",
  1564.     "value_procedure_call : FIXME_05",
  1565.     "value_built_in_routine_call : chill_value_built_in_routine_call",
  1566.     "start_expression : FIXME_06",
  1567.     "zero_adic_operator : FIXME_07",
  1568.     "parenthesised_expression : '(' expression ')'",
  1569.     "expression : operand_0",
  1570.     "expression : single_assignment_action",
  1571.     "expression : conditional_expression",
  1572.     "conditional_expression : IF boolean_expression then_alternative else_alternative FI",
  1573.     "conditional_expression : CASE case_selector_list OF value_case_alternative '[' ELSE sub_expression ']' ESAC",
  1574.     "then_alternative : THEN subexpression",
  1575.     "else_alternative : ELSE subexpression",
  1576.     "else_alternative : ELSIF boolean_expression then_alternative else_alternative",
  1577.     "sub_expression : expression",
  1578.     "value_case_alternative : case_label_specification ':' sub_expression ';'",
  1579.     "operand_0 : operand_1",
  1580.     "operand_0 : operand_0 LOGIOR operand_1",
  1581.     "operand_0 : operand_0 ORIF operand_1",
  1582.     "operand_0 : operand_0 LOGXOR operand_1",
  1583.     "operand_1 : operand_2",
  1584.     "operand_1 : operand_1 LOGAND operand_2",
  1585.     "operand_1 : operand_1 ANDIF operand_2",
  1586.     "operand_2 : operand_3",
  1587.     "operand_2 : operand_2 '=' operand_3",
  1588.     "operand_2 : operand_2 NOTEQUAL operand_3",
  1589.     "operand_2 : operand_2 '>' operand_3",
  1590.     "operand_2 : operand_2 GTR operand_3",
  1591.     "operand_2 : operand_2 '<' operand_3",
  1592.     "operand_2 : operand_2 LEQ operand_3",
  1593.     "operand_2 : operand_2 IN operand_3",
  1594.     "operand_3 : operand_4",
  1595.     "operand_3 : operand_3 '+' operand_4",
  1596.     "operand_3 : operand_3 '-' operand_4",
  1597.     "operand_3 : operand_3 SLASH_SLASH operand_4",
  1598.     "operand_4 : operand_5",
  1599.     "operand_4 : operand_4 '*' operand_5",
  1600.     "operand_4 : operand_4 '/' operand_5",
  1601.     "operand_4 : operand_4 MOD operand_5",
  1602.     "operand_4 : operand_4 REM operand_5",
  1603.     "operand_5 : operand_6",
  1604.     "operand_5 : '-' operand_6",
  1605.     "operand_5 : NOT operand_6",
  1606.     "operand_5 : parenthesised_expression literal",
  1607.     "operand_6 : POINTER location",
  1608.     "operand_6 : RECEIVE buffer_location",
  1609.     "operand_6 : primitive_value",
  1610.     "single_assignment_action : location GDB_ASSIGNMENT value",
  1611.     "chill_value_built_in_routine_call : NUM '(' expression ')'",
  1612.     "chill_value_built_in_routine_call : PRED '(' expression ')'",
  1613.     "chill_value_built_in_routine_call : SUCC '(' expression ')'",
  1614.     "chill_value_built_in_routine_call : ABS '(' expression ')'",
  1615.     "chill_value_built_in_routine_call : CARD '(' expression ')'",
  1616.     "chill_value_built_in_routine_call : MAX_TOKEN '(' expression ')'",
  1617.     "chill_value_built_in_routine_call : MIN_TOKEN '(' expression ')'",
  1618.     "chill_value_built_in_routine_call : SIZE '(' location ')'",
  1619.     "chill_value_built_in_routine_call : SIZE '(' mode_argument ')'",
  1620.     "chill_value_built_in_routine_call : UPPER '(' upper_lower_argument ')'",
  1621.     "chill_value_built_in_routine_call : LOWER '(' upper_lower_argument ')'",
  1622.     "chill_value_built_in_routine_call : LENGTH '(' length_argument ')'",
  1623.     "mode_argument : mode_name",
  1624.     "mode_argument : array_mode_name '(' expression ')'",
  1625.     "mode_argument : string_mode_name '(' expression ')'",
  1626.     "mode_argument : variant_structure_mode_name '(' expression_list ')'",
  1627.     "mode_name : TYPENAME",
  1628.     "upper_lower_argument : expression",
  1629.     "upper_lower_argument : mode_name",
  1630.     "length_argument : expression",
  1631.     "array_primitive_value : primitive_value",
  1632.     "array_mode_name : FIXME_08",
  1633.     "string_mode_name : FIXME_09",
  1634.     "variant_structure_mode_name : FIXME_10",
  1635.     "synonym_name : FIXME_11",
  1636.     "value_enumeration_name : FIXME_12",
  1637.     "value_do_with_name : FIXME_13",
  1638.     "value_receive_name : FIXME_14",
  1639.     "string_primitive_value : FIXME_15",
  1640.     "start_element : FIXME_16",
  1641.     "left_element : FIXME_17",
  1642.     "right_element : FIXME_18",
  1643.     "slice_size : FIXME_19",
  1644.     "lower_element : FIXME_20",
  1645.     "upper_element : FIXME_21",
  1646.     "first_element : FIXME_22",
  1647.     "boolean_expression : FIXME_26",
  1648.     "case_selector_list : FIXME_27",
  1649.     "subexpression : FIXME_28",
  1650.     "case_label_specification : FIXME_29",
  1651.     "buffer_location : FIXME_30",
  1652. };
  1653. #endif /* YYDEBUG */
  1654. #line 1 "/usr/lib/yaccpar"
  1655. /*    @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10    */
  1656.  
  1657. /*
  1658. ** Skeleton parser driver for yacc output
  1659. */
  1660.  
  1661. /*
  1662. ** yacc user known macros and defines
  1663. */
  1664. #define YYERROR        goto yyerrlab
  1665. #define YYACCEPT    { free(yys); free(yyv); return(0); }
  1666. #define YYABORT        { free(yys); free(yyv); return(1); }
  1667. #define YYBACKUP( newtoken, newvalue )\
  1668. {\
  1669.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  1670.     {\
  1671.         yyerror( "syntax error - cannot backup" );\
  1672.         goto yyerrlab;\
  1673.     }\
  1674.     yychar = newtoken;\
  1675.     yystate = *yyps;\
  1676.     yylval = newvalue;\
  1677.     goto yynewstate;\
  1678. }
  1679. #define YYRECOVERING()    (!!yyerrflag)
  1680. #ifndef YYDEBUG
  1681. #    define YYDEBUG    1    /* make debugging available */
  1682. #endif
  1683.  
  1684. /*
  1685. ** user known globals
  1686. */
  1687. int yydebug;            /* set to 1 to get debugging */
  1688.  
  1689. /*
  1690. ** driver internal defines
  1691. */
  1692. #define YYFLAG        (-1000)
  1693.  
  1694. /*
  1695. ** static variables used by the parser
  1696. */
  1697. static YYSTYPE *yyv;            /* value stack */
  1698. static int *yys;            /* state stack */
  1699.  
  1700. static YYSTYPE *yypv;            /* top of value stack */
  1701. static int *yyps;            /* top of state stack */
  1702.  
  1703. static int yystate;            /* current state */
  1704. static int yytmp;            /* extra var (lasts between blocks) */
  1705.  
  1706. int yynerrs;            /* number of errors */
  1707.  
  1708. int yyerrflag;            /* error recovery flag */
  1709. int yychar;            /* current input token number */
  1710.  
  1711.  
  1712. /*
  1713. ** yyparse - return 0 if worked, 1 if syntax error not recovered from
  1714. */
  1715. int
  1716. yyparse()
  1717. {
  1718.     register YYSTYPE *yypvt;    /* top of value stack for $vars */
  1719.     unsigned yymaxdepth = YYMAXDEPTH;
  1720.  
  1721.     /*
  1722.     ** Initialize externals - yyparse may be called more than once
  1723.     */
  1724.     yyv = (YYSTYPE*)xmalloc(yymaxdepth*sizeof(YYSTYPE));
  1725.     yys = (int*)xmalloc(yymaxdepth*sizeof(int));
  1726.     if (!yyv || !yys)
  1727.     {
  1728.         yyerror( "out of memory" );
  1729.         return(1);
  1730.     }
  1731.     yypv = &yyv[-1];
  1732.     yyps = &yys[-1];
  1733.     yystate = 0;
  1734.     yytmp = 0;
  1735.     yynerrs = 0;
  1736.     yyerrflag = 0;
  1737.     yychar = -1;
  1738.  
  1739.     goto yystack;
  1740.     {
  1741.         register YYSTYPE *yy_pv;    /* top of value stack */
  1742.         register int *yy_ps;        /* top of state stack */
  1743.         register int yy_state;        /* current state */
  1744.         register int  yy_n;        /* internal state number info */
  1745.  
  1746.         /*
  1747.         ** get globals into registers.
  1748.         ** branch to here only if YYBACKUP was called.
  1749.         */
  1750.     yynewstate:
  1751.         yy_pv = yypv;
  1752.         yy_ps = yyps;
  1753.         yy_state = yystate;
  1754.         goto yy_newstate;
  1755.  
  1756.         /*
  1757.         ** get globals into registers.
  1758.         ** either we just started, or we just finished a reduction
  1759.         */
  1760.     yystack:
  1761.         yy_pv = yypv;
  1762.         yy_ps = yyps;
  1763.         yy_state = yystate;
  1764.  
  1765.         /*
  1766.         ** top of for (;;) loop while no reductions done
  1767.         */
  1768.     yy_stack:
  1769.         /*
  1770.         ** put a state and value onto the stacks
  1771.         */
  1772. #if YYDEBUG
  1773.         /*
  1774.         ** if debugging, look up token value in list of value vs.
  1775.         ** name pairs.  0 and negative (-1) are special values.
  1776.         ** Note: linear search is used since time is not a real
  1777.         ** consideration while debugging.
  1778.         */
  1779.         if ( yydebug )
  1780.         {
  1781.             register int yy_i;
  1782.  
  1783.             (void)printf( "State %d, token ", yy_state );
  1784.             if ( yychar == 0 )
  1785.                 (void)printf( "end-of-file\n" );
  1786.             else if ( yychar < 0 )
  1787.                 (void)printf( "-none-\n" );
  1788.             else
  1789.             {
  1790.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1791.                     yy_i++ )
  1792.                 {
  1793.                     if ( yytoks[yy_i].t_val == yychar )
  1794.                         break;
  1795.                 }
  1796.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1797.             }
  1798.         }
  1799. #endif /* YYDEBUG */
  1800.         if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
  1801.         {
  1802.             /*
  1803.             ** xreallocate and recover.  Note that pointers
  1804.             ** have to be reset, or bad things will happen
  1805.             */
  1806.             int yyps_index = (yy_ps - yys);
  1807.             int yypv_index = (yy_pv - yyv);
  1808.             int yypvt_index = (yypvt - yyv);
  1809.             yymaxdepth += YYMAXDEPTH;
  1810.             yyv = (YYSTYPE*)xrealloc((char*)yyv,
  1811.                 yymaxdepth * sizeof(YYSTYPE));
  1812.             yys = (int*)xrealloc((char*)yys,
  1813.                 yymaxdepth * sizeof(int));
  1814.             if (!yyv || !yys)
  1815.             {
  1816.                 yyerror( "yacc stack overflow" );
  1817.                 return(1);
  1818.             }
  1819.             yy_ps = yys + yyps_index;
  1820.             yy_pv = yyv + yypv_index;
  1821.             yypvt = yyv + yypvt_index;
  1822.         }
  1823.         *yy_ps = yy_state;
  1824.         *++yy_pv = yyval;
  1825.  
  1826.         /*
  1827.         ** we have a new state - find out what to do
  1828.         */
  1829.     yy_newstate:
  1830.         if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
  1831.             goto yydefault;        /* simple state */
  1832. #if YYDEBUG
  1833.         /*
  1834.         ** if debugging, need to mark whether new token grabbed
  1835.         */
  1836.         yytmp = yychar < 0;
  1837. #endif
  1838.         if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1839.             yychar = 0;        /* reached EOF */
  1840. #if YYDEBUG
  1841.         if ( yydebug && yytmp )
  1842.         {
  1843.             register int yy_i;
  1844.  
  1845.             (void)printf( "Received token " );
  1846.             if ( yychar == 0 )
  1847.                 (void)printf( "end-of-file\n" );
  1848.             else if ( yychar < 0 )
  1849.                 (void)printf( "-none-\n" );
  1850.             else
  1851.             {
  1852.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1853.                     yy_i++ )
  1854.                 {
  1855.                     if ( yytoks[yy_i].t_val == yychar )
  1856.                         break;
  1857.                 }
  1858.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1859.             }
  1860.         }
  1861. #endif /* YYDEBUG */
  1862.         if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
  1863.             goto yydefault;
  1864.         if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )    /*valid shift*/
  1865.         {
  1866.             yychar = -1;
  1867.             yyval = yylval;
  1868.             yy_state = yy_n;
  1869.             if ( yyerrflag > 0 )
  1870.                 yyerrflag--;
  1871.             goto yy_stack;
  1872.         }
  1873.  
  1874.     yydefault:
  1875.         if ( ( yy_n = yydef[ yy_state ] ) == -2 )
  1876.         {
  1877. #if YYDEBUG
  1878.             yytmp = yychar < 0;
  1879. #endif
  1880.             if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1881.                 yychar = 0;        /* reached EOF */
  1882. #if YYDEBUG
  1883.             if ( yydebug && yytmp )
  1884.             {
  1885.                 register int yy_i;
  1886.  
  1887.                 (void)printf( "Received token " );
  1888.                 if ( yychar == 0 )
  1889.                     (void)printf( "end-of-file\n" );
  1890.                 else if ( yychar < 0 )
  1891.                     (void)printf( "-none-\n" );
  1892.                 else
  1893.                 {
  1894.                     for ( yy_i = 0;
  1895.                         yytoks[yy_i].t_val >= 0;
  1896.                         yy_i++ )
  1897.                     {
  1898.                         if ( yytoks[yy_i].t_val
  1899.                             == yychar )
  1900.                         {
  1901.                             break;
  1902.                         }
  1903.                     }
  1904.                     (void)printf( "%s\n", yytoks[yy_i].t_name );
  1905.                 }
  1906.             }
  1907. #endif /* YYDEBUG */
  1908.             /*
  1909.             ** look through exception table
  1910.             */
  1911.             {
  1912.                 register int *yyxi = yyexca;
  1913.  
  1914.                 while ( ( *yyxi != -1 ) ||
  1915.                     ( yyxi[1] != yy_state ) )
  1916.                 {
  1917.                     yyxi += 2;
  1918.                 }
  1919.                 while ( ( *(yyxi += 2) >= 0 ) &&
  1920.                     ( *yyxi != yychar ) )
  1921.                     ;
  1922.                 if ( ( yy_n = yyxi[1] ) < 0 )
  1923.                     YYACCEPT;
  1924.             }
  1925.         }
  1926.  
  1927.         /*
  1928.         ** check for syntax error
  1929.         */
  1930.         if ( yy_n == 0 )    /* have an error */
  1931.         {
  1932.             /* no worry about speed here! */
  1933.             switch ( yyerrflag )
  1934.             {
  1935.             case 0:        /* new error */
  1936.                 yyerror( "syntax error" );
  1937.                 goto skip_init;
  1938.             yyerrlab:
  1939.                 /*
  1940.                 ** get globals into registers.
  1941.                 ** we have a user generated syntax type error
  1942.                 */
  1943.                 yy_pv = yypv;
  1944.                 yy_ps = yyps;
  1945.                 yy_state = yystate;
  1946.                 yynerrs++;
  1947.             skip_init:
  1948.             case 1:
  1949.             case 2:        /* incompletely recovered error */
  1950.                     /* try again... */
  1951.                 yyerrflag = 3;
  1952.                 /*
  1953.                 ** find state where "error" is a legal
  1954.                 ** shift action
  1955.                 */
  1956.                 while ( yy_ps >= yys )
  1957.                 {
  1958.                     yy_n = yypact[ *yy_ps ] + YYERRCODE;
  1959.                     if ( yy_n >= 0 && yy_n < YYLAST &&
  1960.                         yychk[yyact[yy_n]] == YYERRCODE)                    {
  1961.                         /*
  1962.                         ** simulate shift of "error"
  1963.                         */
  1964.                         yy_state = yyact[ yy_n ];
  1965.                         goto yy_stack;
  1966.                     }
  1967.                     /*
  1968.                     ** current state has no shift on
  1969.                     ** "error", pop stack
  1970.                     */
  1971. #if YYDEBUG
  1972. #    define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  1973.                     if ( yydebug )
  1974.                         (void)printf( _POP_, *yy_ps,
  1975.                             yy_ps[-1] );
  1976. #    undef _POP_
  1977. #endif
  1978.                     yy_ps--;
  1979.                     yy_pv--;
  1980.                 }
  1981.                 /*
  1982.                 ** there is no state on stack with "error" as
  1983.                 ** a valid shift.  give up.
  1984.                 */
  1985.                 YYABORT;
  1986.             case 3:        /* no shift yet; eat a token */
  1987. #if YYDEBUG
  1988.                 /*
  1989.                 ** if debugging, look up token in list of
  1990.                 ** pairs.  0 and negative shouldn't occur,
  1991.                 ** but since timing doesn't matter when
  1992.                 ** debugging, it doesn't hurt to leave the
  1993.                 ** tests here.
  1994.                 */
  1995.                 if ( yydebug )
  1996.                 {
  1997.                     register int yy_i;
  1998.  
  1999.                     (void)printf( "Error recovery discards " );
  2000.                     if ( yychar == 0 )
  2001.                         (void)printf( "token end-of-file\n" );
  2002.                     else if ( yychar < 0 )
  2003.                         (void)printf( "token -none-\n" );
  2004.                     else
  2005.                     {
  2006.                         for ( yy_i = 0;
  2007.                             yytoks[yy_i].t_val >= 0;
  2008.                             yy_i++ )
  2009.                         {
  2010.                             if ( yytoks[yy_i].t_val
  2011.                                 == yychar )
  2012.                             {
  2013.                                 break;
  2014.                             }
  2015.                         }
  2016.                         (void)printf( "token %s\n",
  2017.                             yytoks[yy_i].t_name );
  2018.                     }
  2019.                 }
  2020. #endif /* YYDEBUG */
  2021.                 if ( yychar == 0 )    /* reached EOF. quit */
  2022.                     YYABORT;
  2023.                 yychar = -1;
  2024.                 goto yy_newstate;
  2025.             }
  2026.         }/* end if ( yy_n == 0 ) */
  2027.         /*
  2028.         ** reduction by production yy_n
  2029.         ** put stack tops, etc. so things right after switch
  2030.         */
  2031. #if YYDEBUG
  2032.         /*
  2033.         ** if debugging, print the string that is the user's
  2034.         ** specification of the reduction which is just about
  2035.         ** to be done.
  2036.         */
  2037.         if ( yydebug )
  2038.             (void)printf( "Reduce by (%d) \"%s\"\n",
  2039.                 yy_n, yyreds[ yy_n ] );
  2040. #endif
  2041.         yytmp = yy_n;            /* value to switch over */
  2042.         yypvt = yy_pv;            /* $vars top of value stack */
  2043.         /*
  2044.         ** Look in goto table for next state
  2045.         ** Sorry about using yy_state here as temporary
  2046.         ** register variable, but why not, if it works...
  2047.         ** If yyr2[ yy_n ] doesn't have the low order bit
  2048.         ** set, then there is no action to be done for
  2049.         ** this reduction.  So, no saving & unsaving of
  2050.         ** registers done.  The only difference between the
  2051.         ** code just after the if and the body of the if is
  2052.         ** the goto yy_stack in the body.  This way the test
  2053.         ** can be made before the choice of what to do is needed.
  2054.         */
  2055.         {
  2056.             /* length of production doubled with extra bit */
  2057.             register int yy_len = yyr2[ yy_n ];
  2058.  
  2059.             if ( !( yy_len & 01 ) )
  2060.             {
  2061.                 yy_len >>= 1;
  2062.                 yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  2063.                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  2064.                     *( yy_ps -= yy_len ) + 1;
  2065.                 if ( yy_state >= YYLAST ||
  2066.                     yychk[ yy_state =
  2067.                     yyact[ yy_state ] ] != -yy_n )
  2068.                 {
  2069.                     yy_state = yyact[ yypgo[ yy_n ] ];
  2070.                 }
  2071.                 goto yy_stack;
  2072.             }
  2073.             yy_len >>= 1;
  2074.             yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  2075.             yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  2076.                 *( yy_ps -= yy_len ) + 1;
  2077.             if ( yy_state >= YYLAST ||
  2078.                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
  2079.             {
  2080.                 yy_state = yyact[ yypgo[ yy_n ] ];
  2081.             }
  2082.         }
  2083.                     /* save until reenter driver code */
  2084.         yystate = yy_state;
  2085.         yyps = yy_ps;
  2086.         yypv = yy_pv;
  2087.     }
  2088.     /*
  2089.     ** code supplied by user is placed in this switch
  2090.     */
  2091.     switch( yytmp )
  2092.     {
  2093.         
  2094. case 1:
  2095. # line 312 "./ch-exp.y"
  2096. { } break;
  2097. case 2:
  2098. # line 314 "./ch-exp.y"
  2099. { write_exp_elt_opcode(OP_TYPE);
  2100.               write_exp_elt_type(yypvt[-0].tsym.type);
  2101.               write_exp_elt_opcode(OP_TYPE);} break;
  2102. case 3:
  2103. # line 320 "./ch-exp.y"
  2104. {
  2105.               yyval.voidval = 0;    /* FIXME */
  2106.             } break;
  2107. case 4:
  2108. # line 324 "./ch-exp.y"
  2109. {
  2110.               yyval.voidval = 0;    /* FIXME */
  2111.             } break;
  2112. case 5:
  2113. # line 330 "./ch-exp.y"
  2114. {
  2115.               yyval.voidval = 0;    /* FIXME */
  2116.             } break;
  2117. case 7:
  2118. # line 339 "./ch-exp.y"
  2119. {
  2120.               write_exp_elt_opcode (UNOP_IND);
  2121.             } break;
  2122. case 8:
  2123. # line 347 "./ch-exp.y"
  2124. {
  2125.               write_exp_elt_opcode (OP_VAR_VALUE);
  2126.               write_exp_elt_sym (yypvt[-0].ssym.sym);
  2127.               write_exp_elt_opcode (OP_VAR_VALUE);
  2128.             } break;
  2129. case 9:
  2130. # line 353 "./ch-exp.y"
  2131. {
  2132.               write_exp_elt_opcode (OP_LAST);
  2133.               write_exp_elt_longcst (yypvt[-0].lval);
  2134.               write_exp_elt_opcode (OP_LAST); 
  2135.             } break;
  2136. case 10:
  2137. # line 359 "./ch-exp.y"
  2138. {
  2139.               write_exp_elt_opcode (OP_REGISTER);
  2140.               write_exp_elt_longcst (yypvt[-0].lval);
  2141.               write_exp_elt_opcode (OP_REGISTER); 
  2142.             } break;
  2143. case 11:
  2144. # line 365 "./ch-exp.y"
  2145. {
  2146.               write_exp_elt_opcode (OP_INTERNALVAR);
  2147.               write_exp_elt_intern (yypvt[-0].ivar);
  2148.               write_exp_elt_opcode (OP_INTERNALVAR); 
  2149.             } break;
  2150. case 12:
  2151. # line 371 "./ch-exp.y"
  2152. {
  2153.               yyval.voidval = 0;    /* FIXME */
  2154.             } break;
  2155. case 13:
  2156. # line 379 "./ch-exp.y"
  2157. {
  2158.               arglist_len = 1;
  2159.             } break;
  2160. case 14:
  2161. # line 383 "./ch-exp.y"
  2162. {
  2163.               arglist_len++;
  2164.             } break;
  2165. case 15:
  2166. # line 390 "./ch-exp.y"
  2167. {
  2168.               yyval.voidval = 0;    /* FIXME */
  2169.             } break;
  2170. case 16:
  2171. # line 394 "./ch-exp.y"
  2172. {
  2173.               yyval.voidval = 0;    /* FIXME */
  2174.             } break;
  2175. case 17:
  2176. # line 398 "./ch-exp.y"
  2177. {
  2178.               yyval.voidval = 0;    /* FIXME */
  2179.             } break;
  2180. case 18:
  2181. # line 402 "./ch-exp.y"
  2182. {
  2183.               yyval.voidval = 0;    /* FIXME */
  2184.             } break;
  2185. case 19:
  2186. # line 406 "./ch-exp.y"
  2187. {
  2188.               yyval.voidval = 0;    /* FIXME */
  2189.             } break;
  2190. case 20:
  2191. # line 410 "./ch-exp.y"
  2192. {
  2193.               yyval.voidval = 0;    /* FIXME */
  2194.             } break;
  2195. case 21:
  2196. # line 414 "./ch-exp.y"
  2197. {
  2198.               yyval.voidval = 0;    /* FIXME */
  2199.             } break;
  2200. case 22:
  2201. # line 418 "./ch-exp.y"
  2202. {
  2203.               yyval.voidval = 0;    /* FIXME */
  2204.             } break;
  2205. case 23:
  2206. # line 422 "./ch-exp.y"
  2207. {
  2208.               yyval.voidval = 0;    /* FIXME */
  2209.             } break;
  2210. case 24:
  2211. # line 426 "./ch-exp.y"
  2212. {
  2213.               yyval.voidval = 0;    /* FIXME */
  2214.             } break;
  2215. case 25:
  2216. # line 430 "./ch-exp.y"
  2217. {
  2218.               yyval.voidval = 0;    /* FIXME */
  2219.             } break;
  2220. case 26:
  2221. # line 434 "./ch-exp.y"
  2222. {
  2223.               yyval.voidval = 0;    /* FIXME */
  2224.             } break;
  2225. case 27:
  2226. # line 438 "./ch-exp.y"
  2227. {
  2228.               yyval.voidval = 0;    /* FIXME */
  2229.             } break;
  2230. case 28:
  2231. # line 442 "./ch-exp.y"
  2232. {
  2233.               yyval.voidval = 0;    /* FIXME */
  2234.             } break;
  2235. case 29:
  2236. # line 446 "./ch-exp.y"
  2237. {
  2238.               yyval.voidval = 0;    /* FIXME */
  2239.             } break;
  2240. case 30:
  2241. # line 454 "./ch-exp.y"
  2242. {
  2243.               yyval.voidval = 0;    /* FIXME */
  2244.             } break;
  2245. case 31:
  2246. # line 462 "./ch-exp.y"
  2247. {
  2248.               yyval.voidval = 0;    /* FIXME */
  2249.             } break;
  2250. case 32:
  2251. # line 466 "./ch-exp.y"
  2252. {
  2253.               yyval.voidval = 0;    /* FIXME */
  2254.             } break;
  2255. case 33:
  2256. # line 470 "./ch-exp.y"
  2257. {
  2258.               yyval.voidval = 0;    /* FIXME */
  2259.             } break;
  2260. case 34:
  2261. # line 474 "./ch-exp.y"
  2262. {
  2263.               yyval.voidval = 0;    /* FIXME */
  2264.             } break;
  2265. case 35:
  2266. # line 478 "./ch-exp.y"
  2267. {
  2268.               write_exp_elt_opcode (OP_VAR_VALUE);
  2269.               write_exp_elt_sym (yypvt[-0].ssym.sym);
  2270.               write_exp_elt_opcode (OP_VAR_VALUE);
  2271.             } break;
  2272. case 36:
  2273. # line 488 "./ch-exp.y"
  2274. {
  2275.               write_exp_elt_opcode (OP_LONG);
  2276.               write_exp_elt_type (yypvt[-0].typed_val.type);
  2277.               write_exp_elt_longcst ((LONGEST) (yypvt[-0].typed_val.val));
  2278.               write_exp_elt_opcode (OP_LONG);
  2279.             } break;
  2280. case 37:
  2281. # line 495 "./ch-exp.y"
  2282. {
  2283.               write_exp_elt_opcode (OP_BOOL);
  2284.               write_exp_elt_longcst ((LONGEST) yypvt[-0].ulval);
  2285.               write_exp_elt_opcode (OP_BOOL);
  2286.             } break;
  2287. case 38:
  2288. # line 501 "./ch-exp.y"
  2289. {
  2290.               write_exp_elt_opcode (OP_LONG);
  2291.               write_exp_elt_type (yypvt[-0].typed_val.type);
  2292.               write_exp_elt_longcst ((LONGEST) (yypvt[-0].typed_val.val));
  2293.               write_exp_elt_opcode (OP_LONG);
  2294.             } break;
  2295. case 39:
  2296. # line 508 "./ch-exp.y"
  2297. {
  2298.               write_exp_elt_opcode (OP_DOUBLE);
  2299.               write_exp_elt_type (builtin_type_double);
  2300.               write_exp_elt_dblcst (yypvt[-0].dval);
  2301.               write_exp_elt_opcode (OP_DOUBLE);
  2302.             } break;
  2303. case 40:
  2304. # line 515 "./ch-exp.y"
  2305. {
  2306.               yyval.voidval = 0;    /* FIXME */
  2307.             } break;
  2308. case 41:
  2309. # line 519 "./ch-exp.y"
  2310. {
  2311.               yyval.voidval = 0;    /* FIXME */
  2312.             } break;
  2313. case 42:
  2314. # line 523 "./ch-exp.y"
  2315. {
  2316.               write_exp_elt_opcode (OP_STRING);
  2317.               write_exp_string (yypvt[-0].sval);
  2318.               write_exp_elt_opcode (OP_STRING);
  2319.             } break;
  2320. case 43:
  2321. # line 529 "./ch-exp.y"
  2322. {
  2323.               write_exp_elt_opcode (OP_BITSTRING);
  2324.               write_exp_bitstring (yypvt[-0].sval);
  2325.               write_exp_elt_opcode (OP_BITSTRING);
  2326.             } break;
  2327. case 44:
  2328. # line 539 "./ch-exp.y"
  2329. {
  2330.               yyval.voidval = 0;    /* FIXME */
  2331.             } break;
  2332. case 45:
  2333. # line 548 "./ch-exp.y"
  2334. {
  2335.               yyval.voidval = 0;    /* FIXME */
  2336.             } break;
  2337. case 46:
  2338. # line 556 "./ch-exp.y"
  2339. {
  2340.               yyval.voidval = 0;    /* FIXME */
  2341.             } break;
  2342. case 47:
  2343. # line 560 "./ch-exp.y"
  2344. {
  2345.               yyval.voidval = 0;    /* FIXME */
  2346.             } break;
  2347. case 48:
  2348. # line 570 "./ch-exp.y"
  2349. { start_arglist (); } break;
  2350. case 49:
  2351. # line 572 "./ch-exp.y"
  2352. {
  2353.               write_exp_elt_opcode (MULTI_SUBSCRIPT);
  2354.               write_exp_elt_longcst ((LONGEST) end_arglist ());
  2355.               write_exp_elt_opcode (MULTI_SUBSCRIPT);
  2356.             } break;
  2357. case 50:
  2358. # line 582 "./ch-exp.y"
  2359. {
  2360.               yyval.voidval = 0;    /* FIXME */
  2361.             } break;
  2362. case 51:
  2363. # line 586 "./ch-exp.y"
  2364. {
  2365.               yyval.voidval = 0;    /* FIXME */
  2366.             } break;
  2367. case 52:
  2368. # line 594 "./ch-exp.y"
  2369. { write_exp_elt_opcode (STRUCTOP_STRUCT);
  2370.               write_exp_string (yypvt[-0].sval);
  2371.               write_exp_elt_opcode (STRUCTOP_STRUCT);
  2372.             } break;
  2373. case 53:
  2374. # line 603 "./ch-exp.y"
  2375. {
  2376.               write_exp_elt_opcode (UNOP_CAST);
  2377.               write_exp_elt_type (yypvt[-1].tsym.type);
  2378.               write_exp_elt_opcode (UNOP_CAST);
  2379.             } break;
  2380. case 54:
  2381. # line 613 "./ch-exp.y"
  2382. {
  2383.               yyval.voidval = 0;    /* FIXME */
  2384.             } break;
  2385. case 55:
  2386. # line 621 "./ch-exp.y"
  2387. {
  2388.               yyval.voidval = 0;    /* FIXME */
  2389.             } break;
  2390. case 56:
  2391. # line 629 "./ch-exp.y"
  2392. {
  2393.               yyval.voidval = 0;    /* FIXME */
  2394.             } break;
  2395. case 57:
  2396. # line 637 "./ch-exp.y"
  2397. {
  2398.               yyval.voidval = 0;    /* FIXME */
  2399.             } break;
  2400. case 58:
  2401. # line 645 "./ch-exp.y"
  2402. {
  2403.               yyval.voidval = 0;    /* FIXME */
  2404.             } break;
  2405. case 59:
  2406. # line 653 "./ch-exp.y"
  2407. {
  2408.               yyval.voidval = 0;    /* FIXME */
  2409.             } break;
  2410. case 60:
  2411. # line 657 "./ch-exp.y"
  2412. {
  2413.               yyval.voidval = 0;    /* FIXME */
  2414.             } break;
  2415. case 61:
  2416. # line 661 "./ch-exp.y"
  2417. {
  2418.               yyval.voidval = 0;    /* FIXME */
  2419.             } break;
  2420. case 62:
  2421. # line 667 "./ch-exp.y"
  2422. {
  2423.               yyval.voidval = 0;    /* FIXME */
  2424.             } break;
  2425. case 63:
  2426. # line 671 "./ch-exp.y"
  2427. {
  2428.               yyval.voidval = 0;    /* FIXME */
  2429.             } break;
  2430. case 64:
  2431. # line 677 "./ch-exp.y"
  2432. {
  2433.               yyval.voidval = 0;    /* FIXME */
  2434.             } break;
  2435. case 65:
  2436. # line 683 "./ch-exp.y"
  2437. {
  2438.               yyval.voidval = 0;    /* FIXME */
  2439.             } break;
  2440. case 66:
  2441. # line 687 "./ch-exp.y"
  2442. {
  2443.               yyval.voidval = 0;    /* FIXME */
  2444.             } break;
  2445. case 67:
  2446. # line 693 "./ch-exp.y"
  2447. {
  2448.               yyval.voidval = 0;    /* FIXME */
  2449.             } break;
  2450. case 68:
  2451. # line 699 "./ch-exp.y"
  2452. {
  2453.               yyval.voidval = 0;    /* FIXME */
  2454.             } break;
  2455. case 69:
  2456. # line 707 "./ch-exp.y"
  2457. {
  2458.               yyval.voidval = 0;    /* FIXME */
  2459.             } break;
  2460. case 70:
  2461. # line 711 "./ch-exp.y"
  2462. {
  2463.               write_exp_elt_opcode (BINOP_BITWISE_IOR);
  2464.             } break;
  2465. case 71:
  2466. # line 715 "./ch-exp.y"
  2467. {
  2468.               yyval.voidval = 0;    /* FIXME */
  2469.             } break;
  2470. case 72:
  2471. # line 719 "./ch-exp.y"
  2472. {
  2473.               write_exp_elt_opcode (BINOP_BITWISE_XOR);
  2474.             } break;
  2475. case 73:
  2476. # line 727 "./ch-exp.y"
  2477. {
  2478.               yyval.voidval = 0;    /* FIXME */
  2479.             } break;
  2480. case 74:
  2481. # line 731 "./ch-exp.y"
  2482. {
  2483.               write_exp_elt_opcode (BINOP_BITWISE_AND);
  2484.             } break;
  2485. case 75:
  2486. # line 735 "./ch-exp.y"
  2487. {
  2488.               yyval.voidval = 0;    /* FIXME */
  2489.             } break;
  2490. case 76:
  2491. # line 743 "./ch-exp.y"
  2492. {
  2493.               yyval.voidval = 0;    /* FIXME */
  2494.             } break;
  2495. case 77:
  2496. # line 747 "./ch-exp.y"
  2497. {
  2498.               write_exp_elt_opcode (BINOP_EQUAL);
  2499.             } break;
  2500. case 78:
  2501. # line 751 "./ch-exp.y"
  2502. {
  2503.               write_exp_elt_opcode (BINOP_NOTEQUAL);
  2504.             } break;
  2505. case 79:
  2506. # line 755 "./ch-exp.y"
  2507. {
  2508.               write_exp_elt_opcode (BINOP_GTR);
  2509.             } break;
  2510. case 80:
  2511. # line 759 "./ch-exp.y"
  2512. {
  2513.               write_exp_elt_opcode (BINOP_GEQ);
  2514.             } break;
  2515. case 81:
  2516. # line 763 "./ch-exp.y"
  2517. {
  2518.               write_exp_elt_opcode (BINOP_LESS);
  2519.             } break;
  2520. case 82:
  2521. # line 767 "./ch-exp.y"
  2522. {
  2523.               write_exp_elt_opcode (BINOP_LEQ);
  2524.             } break;
  2525. case 83:
  2526. # line 771 "./ch-exp.y"
  2527. {
  2528.               yyval.voidval = 0;    /* FIXME */
  2529.             } break;
  2530. case 84:
  2531. # line 780 "./ch-exp.y"
  2532. {
  2533.               yyval.voidval = 0;    /* FIXME */
  2534.             } break;
  2535. case 85:
  2536. # line 784 "./ch-exp.y"
  2537. {
  2538.               write_exp_elt_opcode (BINOP_ADD);
  2539.             } break;
  2540. case 86:
  2541. # line 788 "./ch-exp.y"
  2542. {
  2543.               write_exp_elt_opcode (BINOP_SUB);
  2544.             } break;
  2545. case 87:
  2546. # line 792 "./ch-exp.y"
  2547. {
  2548.               write_exp_elt_opcode (BINOP_CONCAT);
  2549.             } break;
  2550. case 88:
  2551. # line 800 "./ch-exp.y"
  2552. {
  2553.               yyval.voidval = 0;    /* FIXME */
  2554.             } break;
  2555. case 89:
  2556. # line 804 "./ch-exp.y"
  2557. {
  2558.               write_exp_elt_opcode (BINOP_MUL);
  2559.             } break;
  2560. case 90:
  2561. # line 808 "./ch-exp.y"
  2562. {
  2563.               write_exp_elt_opcode (BINOP_DIV);
  2564.             } break;
  2565. case 91:
  2566. # line 812 "./ch-exp.y"
  2567. {
  2568.               write_exp_elt_opcode (BINOP_MOD);
  2569.             } break;
  2570. case 92:
  2571. # line 816 "./ch-exp.y"
  2572. {
  2573.               write_exp_elt_opcode (BINOP_REM);
  2574.             } break;
  2575. case 93:
  2576. # line 824 "./ch-exp.y"
  2577. {
  2578.               yyval.voidval = 0;    /* FIXME */
  2579.             } break;
  2580. case 94:
  2581. # line 828 "./ch-exp.y"
  2582. {
  2583.               write_exp_elt_opcode (UNOP_NEG);
  2584.             } break;
  2585. case 95:
  2586. # line 832 "./ch-exp.y"
  2587. {
  2588.               write_exp_elt_opcode (UNOP_LOGICAL_NOT);
  2589.             } break;
  2590. case 96:
  2591. # line 838 "./ch-exp.y"
  2592. {
  2593.               write_exp_elt_opcode (BINOP_CONCAT);
  2594.             } break;
  2595. case 97:
  2596. # line 846 "./ch-exp.y"
  2597. {
  2598.               write_exp_elt_opcode (UNOP_ADDR);
  2599.             } break;
  2600. case 98:
  2601. # line 850 "./ch-exp.y"
  2602. {
  2603.               yyval.voidval = 0;    /* FIXME */
  2604.             } break;
  2605. case 99:
  2606. # line 854 "./ch-exp.y"
  2607. {
  2608.               yyval.voidval = 0;    /* FIXME */
  2609.             } break;
  2610. case 100:
  2611. # line 864 "./ch-exp.y"
  2612. {
  2613.               write_exp_elt_opcode (BINOP_ASSIGN);
  2614.             } break;
  2615. case 101:
  2616. # line 873 "./ch-exp.y"
  2617. {
  2618.               yyval.voidval = 0;    /* FIXME */
  2619.             } break;
  2620. case 102:
  2621. # line 877 "./ch-exp.y"
  2622. {
  2623.               yyval.voidval = 0;    /* FIXME */
  2624.             } break;
  2625. case 103:
  2626. # line 881 "./ch-exp.y"
  2627. {
  2628.               yyval.voidval = 0;    /* FIXME */
  2629.             } break;
  2630. case 104:
  2631. # line 885 "./ch-exp.y"
  2632. {
  2633.               yyval.voidval = 0;    /* FIXME */
  2634.             } break;
  2635. case 105:
  2636. # line 889 "./ch-exp.y"
  2637. {
  2638.               yyval.voidval = 0;    /* FIXME */
  2639.             } break;
  2640. case 106:
  2641. # line 893 "./ch-exp.y"
  2642. {
  2643.               yyval.voidval = 0;    /* FIXME */
  2644.             } break;
  2645. case 107:
  2646. # line 897 "./ch-exp.y"
  2647. {
  2648.               yyval.voidval = 0;    /* FIXME */
  2649.             } break;
  2650. case 108:
  2651. # line 901 "./ch-exp.y"
  2652. {
  2653.               yyval.voidval = 0;    /* FIXME */
  2654.             } break;
  2655. case 109:
  2656. # line 905 "./ch-exp.y"
  2657. {
  2658.               yyval.voidval = 0;    /* FIXME */
  2659.             } break;
  2660. case 110:
  2661. # line 909 "./ch-exp.y"
  2662. {
  2663.               yyval.voidval = 0;    /* FIXME */
  2664.             } break;
  2665. case 111:
  2666. # line 913 "./ch-exp.y"
  2667. {
  2668.               yyval.voidval = 0;    /* FIXME */
  2669.             } break;
  2670. case 112:
  2671. # line 917 "./ch-exp.y"
  2672. {
  2673.               yyval.voidval = 0;    /* FIXME */
  2674.             } break;
  2675. case 113:
  2676. # line 923 "./ch-exp.y"
  2677. {
  2678.               yyval.voidval = 0;    /* FIXME */
  2679.             } break;
  2680. case 114:
  2681. # line 927 "./ch-exp.y"
  2682. {
  2683.               yyval.voidval = 0;    /* FIXME */
  2684.             } break;
  2685. case 115:
  2686. # line 931 "./ch-exp.y"
  2687. {
  2688.               yyval.voidval = 0;    /* FIXME */
  2689.             } break;
  2690. case 116:
  2691. # line 935 "./ch-exp.y"
  2692. {
  2693.               yyval.voidval = 0;    /* FIXME */
  2694.             } break;
  2695. case 118:
  2696. # line 944 "./ch-exp.y"
  2697. {
  2698.               yyval.voidval = 0;    /* FIXME */
  2699.             } break;
  2700. case 119:
  2701. # line 948 "./ch-exp.y"
  2702. {
  2703.               yyval.voidval = 0;    /* FIXME */
  2704.             } break;
  2705. case 120:
  2706. # line 954 "./ch-exp.y"
  2707. {
  2708.               yyval.voidval = 0;    /* FIXME */
  2709.             } break;
  2710. case 121:
  2711. # line 962 "./ch-exp.y"
  2712. {
  2713.               yyval.voidval = 0;
  2714.             } break;
  2715. case 122:
  2716. # line 970 "./ch-exp.y"
  2717. { yyval.voidval = 0; } break;
  2718. case 123:
  2719. # line 971 "./ch-exp.y"
  2720. { yyval.voidval = 0; } break;
  2721. case 124:
  2722. # line 972 "./ch-exp.y"
  2723. { yyval.voidval = 0; } break;
  2724. case 125:
  2725. # line 973 "./ch-exp.y"
  2726. { yyval.voidval = 0; } break;
  2727. case 126:
  2728. # line 974 "./ch-exp.y"
  2729. { yyval.voidval = 0; } break;
  2730. case 127:
  2731. # line 975 "./ch-exp.y"
  2732. { yyval.voidval = 0; } break;
  2733. case 128:
  2734. # line 976 "./ch-exp.y"
  2735. { yyval.voidval = 0; } break;
  2736. case 129:
  2737. # line 977 "./ch-exp.y"
  2738. { yyval.voidval = 0; } break;
  2739. case 130:
  2740. # line 978 "./ch-exp.y"
  2741. { yyval.voidval = 0; } break;
  2742. case 131:
  2743. # line 979 "./ch-exp.y"
  2744. { yyval.voidval = 0; } break;
  2745. case 132:
  2746. # line 980 "./ch-exp.y"
  2747. { yyval.voidval = 0; } break;
  2748. case 133:
  2749. # line 981 "./ch-exp.y"
  2750. { yyval.voidval = 0; } break;
  2751. case 134:
  2752. # line 982 "./ch-exp.y"
  2753. { yyval.voidval = 0; } break;
  2754. case 135:
  2755. # line 983 "./ch-exp.y"
  2756. { yyval.voidval = 0; } break;
  2757. case 136:
  2758. # line 984 "./ch-exp.y"
  2759. { yyval.voidval = 0; } break;
  2760. case 137:
  2761. # line 985 "./ch-exp.y"
  2762. { yyval.voidval = 0; } break;
  2763. case 138:
  2764. # line 986 "./ch-exp.y"
  2765. { yyval.voidval = 0; } break;
  2766. case 139:
  2767. # line 987 "./ch-exp.y"
  2768. { yyval.voidval = 0; } break;
  2769. case 140:
  2770. # line 988 "./ch-exp.y"
  2771. { yyval.voidval = 0; } break;
  2772. case 141:
  2773. # line 989 "./ch-exp.y"
  2774. { yyval.voidval = 0; } break;
  2775.     }
  2776.     goto yystack;        /* reset registers in driver code */
  2777. }
  2778.