home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / gdb / c-exp.tab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-04  |  79.9 KB  |  2,685 lines

  1.  
  2. /*  A Bison parser, made from ./c-exp.y with Bison version GNU Bison version 1.22
  3.   */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define    INT    258
  8. #define    FLOAT    259
  9. #define    STRING    260
  10. #define    NAME    261
  11. #define    TYPENAME    262
  12. #define    NAME_OR_INT    263
  13. #define    STRUCT    264
  14. #define    CLASS    265
  15. #define    UNION    266
  16. #define    ENUM    267
  17. #define    SIZEOF    268
  18. #define    UNSIGNED    269
  19. #define    COLONCOLON    270
  20. #define    TEMPLATE    271
  21. #define    ERROR    272
  22. #define    SIGNED_KEYWORD    273
  23. #define    LONG    274
  24. #define    SHORT    275
  25. #define    INT_KEYWORD    276
  26. #define    CONST_KEYWORD    277
  27. #define    VOLATILE_KEYWORD    278
  28. #define    LAST    279
  29. #define    REGNAME    280
  30. #define    VARIABLE    281
  31. #define    ASSIGN_MODIFY    282
  32. #define    THIS    283
  33. #define    ABOVE_COMMA    284
  34. #define    OROR    285
  35. #define    ANDAND    286
  36. #define    EQUAL    287
  37. #define    NOTEQUAL    288
  38. #define    LEQ    289
  39. #define    GEQ    290
  40. #define    LSH    291
  41. #define    RSH    292
  42. #define    UNARY    293
  43. #define    INCREMENT    294
  44. #define    DECREMENT    295
  45. #define    ARROW    296
  46. #define    BLOCKNAME    297
  47.  
  48. #line 38 "./c-exp.y"
  49.  
  50.  
  51. #include "defs.h"
  52. #include <string.h>
  53. #include "expression.h"
  54. #include "value.h"
  55. #include "parser-defs.h"
  56. #include "language.h"
  57. #include "c-lang.h"
  58. #include "bfd.h" /* Required by objfiles.h.  */
  59. #include "symfile.h" /* Required by objfiles.h.  */
  60. #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
  61.  
  62. /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
  63.    as well as gratuitiously global symbol names, so we can have multiple
  64.    yacc generated parsers in gdb.  Note that these are only the variables
  65.    produced by yacc.  If other parser generators (bison, byacc, etc) produce
  66.    additional global names that conflict at link time, then those parser
  67.    generators need to be fixed instead of adding those names to this list. */
  68.  
  69. #define    yymaxdepth c_maxdepth
  70. #define    yyparse    c_parse
  71. #define    yylex    c_lex
  72. #define    yyerror    c_error
  73. #define    yylval    c_lval
  74. #define    yychar    c_char
  75. #define    yydebug    c_debug
  76. #define    yypact    c_pact    
  77. #define    yyr1    c_r1            
  78. #define    yyr2    c_r2            
  79. #define    yydef    c_def        
  80. #define    yychk    c_chk        
  81. #define    yypgo    c_pgo        
  82. #define    yyact    c_act        
  83. #define    yyexca    c_exca
  84. #define yyerrflag c_errflag
  85. #define yynerrs    c_nerrs
  86. #define    yyps    c_ps
  87. #define    yypv    c_pv
  88. #define    yys    c_s
  89. #define    yy_yys    c_yys
  90. #define    yystate    c_state
  91. #define    yytmp    c_tmp
  92. #define    yyv    c_v
  93. #define    yy_yyv    c_yyv
  94. #define    yyval    c_val
  95. #define    yylloc    c_lloc
  96. #define yyreds    c_reds        /* With YYDEBUG defined */
  97. #define yytoks    c_toks        /* With YYDEBUG defined */
  98.  
  99. #ifndef YYDEBUG
  100. #define    YYDEBUG    0        /* Default to no yydebug support */
  101. #endif
  102.  
  103. int
  104. yyparse PARAMS ((void));
  105.  
  106. static int
  107. yylex PARAMS ((void));
  108.  
  109. void
  110. yyerror PARAMS ((char *));
  111.  
  112.  
  113. #line 107 "./c-exp.y"
  114. typedef union
  115.   {
  116.     LONGEST lval;
  117.     struct {
  118.       LONGEST val;
  119.       struct type *type;
  120.     } typed_val;
  121.     double dval;
  122.     struct symbol *sym;
  123.     struct type *tval;
  124.     struct stoken sval;
  125.     struct ttype tsym;
  126.     struct symtoken ssym;
  127.     int voidval;
  128.     struct block *bval;
  129.     enum exp_opcode opcode;
  130.     struct internalvar *ivar;
  131.  
  132.     struct type **tvec;
  133.     int *ivec;
  134.   } YYSTYPE;
  135. #line 129 "./c-exp.y"
  136.  
  137. /* YYSTYPE gets defined by %union */
  138. static int
  139. parse_number PARAMS ((char *, int, int, YYSTYPE *));
  140.  
  141. #ifndef YYLTYPE
  142. typedef
  143.   struct yyltype
  144.     {
  145.       int timestamp;
  146.       int first_line;
  147.       int first_column;
  148.       int last_line;
  149.       int last_column;
  150.       char *text;
  151.    }
  152.   yyltype;
  153.  
  154. #define YYLTYPE yyltype
  155. #endif
  156.  
  157. #include <stdio.h>
  158.  
  159. #ifndef __cplusplus
  160. #ifndef __STDC__
  161. #define const
  162. #endif
  163. #endif
  164.  
  165.  
  166.  
  167. #define    YYFINAL        211
  168. #define    YYFLAG        -32768
  169. #define    YYNTBASE    67
  170.  
  171. #define YYTRANSLATE(x) ((unsigned)(x) <= 297 ? yytranslate[x] : 89)
  172.  
  173. static const char yytranslate[] = {     0,
  174.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  175.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  176.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  177.      2,     2,    60,     2,     2,     2,    51,    37,     2,    58,
  178.     63,    49,    47,    29,    48,    56,    50,     2,     2,     2,
  179.      2,     2,     2,     2,     2,     2,     2,    66,     2,    40,
  180.     31,    41,    32,    46,     2,     2,     2,     2,     2,     2,
  181.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  182.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  183.     57,     2,    62,    36,     2,     2,     2,     2,     2,     2,
  184.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  185.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  186.      2,     2,    64,    35,    65,    61,     2,     2,     2,     2,
  187.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  188.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  189.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  190.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  191.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  192.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  193.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  194.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  195.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  196.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  197.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  198.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  199.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  200.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  201.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  202.     26,    27,    28,    30,    33,    34,    38,    39,    42,    43,
  203.     44,    45,    52,    53,    54,    55,    59
  204. };
  205.  
  206. #if YYDEBUG != 0
  207. static const short yyprhs[] = {     0,
  208.      0,     2,     4,     6,     8,    12,    15,    18,    21,    24,
  209.     27,    30,    33,    36,    39,    42,    46,    50,    55,    59,
  210.     63,    68,    73,    74,    80,    82,    83,    85,    89,    91,
  211.     95,   100,   105,   109,   113,   117,   121,   125,   129,   133,
  212.    137,   141,   145,   149,   153,   157,   161,   165,   169,   173,
  213.    177,   181,   185,   191,   195,   199,   201,   203,   205,   207,
  214.    209,   211,   213,   218,   220,   222,   224,   228,   232,   236,
  215.    241,   243,   246,   248,   250,   253,   256,   259,   263,   267,
  216.    269,   272,   274,   277,   279,   283,   286,   288,   291,   293,
  217.    296,   300,   303,   307,   309,   313,   315,   317,   319,   321,
  218.    324,   328,   331,   335,   339,   344,   347,   351,   354,   357,
  219.    360,   363,   366,   368,   371,   373,   379,   382,   385,   387,
  220.    389,   391,   393,   395,   399,   401,   403,   405,   407,   409
  221. };
  222.  
  223. static const short yyrhs[] = {    69,
  224.      0,    68,     0,    83,     0,    70,     0,    69,    29,    70,
  225.      0,    49,    70,     0,    37,    70,     0,    48,    70,     0,
  226.     60,    70,     0,    61,    70,     0,    53,    70,     0,    54,
  227.     70,     0,    70,    53,     0,    70,    54,     0,    13,    70,
  228.      0,    70,    55,    87,     0,    70,    55,    77,     0,    70,
  229.     55,    49,    70,     0,    70,    56,    87,     0,    70,    56,
  230.     77,     0,    70,    56,    49,    70,     0,    70,    57,    69,
  231.     62,     0,     0,    70,    58,    71,    73,    63,     0,    64,
  232.      0,     0,    70,     0,    73,    29,    70,     0,    65,     0,
  233.     72,    73,    74,     0,    72,    83,    74,    70,     0,    58,
  234.     83,    63,    70,     0,    58,    69,    63,     0,    70,    46,
  235.     70,     0,    70,    49,    70,     0,    70,    50,    70,     0,
  236.     70,    51,    70,     0,    70,    47,    70,     0,    70,    48,
  237.     70,     0,    70,    44,    70,     0,    70,    45,    70,     0,
  238.     70,    38,    70,     0,    70,    39,    70,     0,    70,    42,
  239.     70,     0,    70,    43,    70,     0,    70,    40,    70,     0,
  240.     70,    41,    70,     0,    70,    37,    70,     0,    70,    36,
  241.     70,     0,    70,    35,    70,     0,    70,    34,    70,     0,
  242.     70,    33,    70,     0,    70,    32,    70,    66,    70,     0,
  243.     70,    31,    70,     0,    70,    27,    70,     0,     3,     0,
  244.      8,     0,     4,     0,    76,     0,    24,     0,    25,     0,
  245.     26,     0,    13,    58,    83,    63,     0,     5,     0,    28,
  246.      0,    59,     0,    75,    15,    87,     0,    75,    15,    87,
  247.      0,    84,    15,    87,     0,    84,    15,    61,    87,     0,
  248.     77,     0,    15,    87,     0,    88,     0,    84,     0,    84,
  249.     22,     0,    84,    23,     0,    84,    79,     0,    84,    22,
  250.     79,     0,    84,    23,    79,     0,    49,     0,    49,    79,
  251.      0,    37,     0,    37,    79,     0,    80,     0,    58,    79,
  252.     63,     0,    80,    81,     0,    81,     0,    80,    82,     0,
  253.     82,     0,    57,    62,     0,    57,     3,    62,     0,    58,
  254.     63,     0,    58,    86,    63,     0,    78,     0,    84,    15,
  255.     49,     0,     7,     0,    21,     0,    19,     0,    20,     0,
  256.     19,    21,     0,    14,    19,    21,     0,    19,    19,     0,
  257.     19,    19,    21,     0,    14,    19,    19,     0,    14,    19,
  258.     19,    21,     0,    20,    21,     0,    14,    20,    21,     0,
  259.      9,    87,     0,    10,    87,     0,    11,    87,     0,    12,
  260.     87,     0,    14,    85,     0,    14,     0,    18,    85,     0,
  261.     18,     0,    16,    87,    40,    83,    41,     0,    22,    84,
  262.      0,    23,    84,     0,     7,     0,    21,     0,    19,     0,
  263.     20,     0,    83,     0,    86,    29,    83,     0,     6,     0,
  264.     59,     0,     7,     0,     8,     0,     6,     0,    59,     0
  265. };
  266.  
  267. #endif
  268.  
  269. #if YYDEBUG != 0
  270. static const short yyrline[] = { 0,
  271.    211,   212,   215,   222,   223,   228,   231,   234,   238,   242,
  272.    246,   250,   254,   258,   262,   266,   272,   279,   283,   289,
  273.    297,   301,   305,   309,   315,   319,   322,   326,   330,   333,
  274.    340,   346,   352,   358,   362,   366,   370,   374,   378,   382,
  275.    386,   390,   394,   398,   402,   406,   410,   414,   418,   422,
  276.    426,   430,   434,   438,   442,   448,   455,   466,   473,   476,
  277.    482,   488,   494,   501,   526,   533,   551,   562,   578,   591,
  278.    616,   617,   651,   709,   715,   716,   717,   719,   721,   725,
  279.    727,   729,   731,   733,   736,   738,   743,   750,   752,   756,
  280.    758,   762,   764,   776,   777,   782,   784,   786,   788,   790,
  281.    792,   794,   796,   798,   800,   802,   804,   806,   809,   812,
  282.    815,   818,   820,   822,   824,   826,   833,   834,   837,   838,
  283.    844,   850,   859,   864,   871,   872,   873,   874,   877,   878
  284. };
  285.  
  286. static const char * const yytname[] = {   "$","error","$illegal.","INT","FLOAT",
  287. "STRING","NAME","TYPENAME","NAME_OR_INT","STRUCT","CLASS","UNION","ENUM","SIZEOF",
  288. "UNSIGNED","COLONCOLON","TEMPLATE","ERROR","SIGNED_KEYWORD","LONG","SHORT","INT_KEYWORD",
  289. "CONST_KEYWORD","VOLATILE_KEYWORD","LAST","REGNAME","VARIABLE","ASSIGN_MODIFY",
  290. "THIS","','","ABOVE_COMMA","'='","'?'","OROR","ANDAND","'|'","'^'","'&'","EQUAL",
  291. "NOTEQUAL","'<'","'>'","LEQ","GEQ","LSH","RSH","'@'","'+'","'-'","'*'","'/'",
  292. "'%'","UNARY","INCREMENT","DECREMENT","ARROW","'.'","'['","'('","BLOCKNAME",
  293. "'!'","'~'","']'","')'","'{'","'}'","':'","start","type_exp","exp1","exp","@1",
  294. "lcurly","arglist","rcurly","block","variable","qualified_name","ptype","abs_decl",
  295. "direct_abs_decl","array_mod","func_mod","type","typebase","typename","nonempty_typelist",
  296. "name","name_not_typename",""
  297. };
  298. #endif
  299.  
  300. static const short yyr1[] = {     0,
  301.     67,    67,    68,    69,    69,    70,    70,    70,    70,    70,
  302.     70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
  303.     70,    70,    71,    70,    72,    73,    73,    73,    74,    70,
  304.     70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
  305.     70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
  306.     70,    70,    70,    70,    70,    70,    70,    70,    70,    70,
  307.     70,    70,    70,    70,    70,    75,    75,    76,    77,    77,
  308.     76,    76,    76,    78,    78,    78,    78,    78,    78,    79,
  309.     79,    79,    79,    79,    80,    80,    80,    80,    80,    81,
  310.     81,    82,    82,    83,    83,    84,    84,    84,    84,    84,
  311.     84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
  312.     84,    84,    84,    84,    84,    84,    84,    84,    85,    85,
  313.     85,    85,    86,    86,    87,    87,    87,    87,    88,    88
  314. };
  315.  
  316. static const short yyr2[] = {     0,
  317.      1,     1,     1,     1,     3,     2,     2,     2,     2,     2,
  318.      2,     2,     2,     2,     2,     3,     3,     4,     3,     3,
  319.      4,     4,     0,     5,     1,     0,     1,     3,     1,     3,
  320.      4,     4,     3,     3,     3,     3,     3,     3,     3,     3,
  321.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  322.      3,     3,     5,     3,     3,     1,     1,     1,     1,     1,
  323.      1,     1,     4,     1,     1,     1,     3,     3,     3,     4,
  324.      1,     2,     1,     1,     2,     2,     2,     3,     3,     1,
  325.      2,     1,     2,     1,     3,     2,     1,     2,     1,     2,
  326.      3,     2,     3,     1,     3,     1,     1,     1,     1,     2,
  327.      3,     2,     3,     3,     4,     2,     3,     2,     2,     2,
  328.      2,     2,     1,     2,     1,     5,     2,     2,     1,     1,
  329.      1,     1,     1,     3,     1,     1,     1,     1,     1,     1
  330. };
  331.  
  332. static const short yydefact[] = {     0,
  333.     56,    58,    64,   129,    96,    57,     0,     0,     0,     0,
  334.      0,   113,     0,     0,   115,    98,    99,    97,     0,     0,
  335.     60,    61,    62,    65,     0,     0,     0,     0,     0,     0,
  336.    130,     0,     0,    25,     2,     1,     4,    26,     0,    59,
  337.     71,    94,     3,    74,    73,   125,   127,   128,   126,   108,
  338.    109,   110,   111,     0,    15,     0,   119,   121,   122,   120,
  339.    112,    72,     0,   121,   122,   114,   102,   100,   106,   117,
  340.    118,     7,     8,     6,    11,    12,     0,     0,     9,    10,
  341.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  342.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  343.      0,     0,     0,    13,    14,     0,     0,     0,    23,    27,
  344.      0,     0,     0,     0,    75,    76,    82,    80,     0,     0,
  345.     77,    84,    87,    89,     0,     0,   104,   101,   107,     0,
  346.    103,    33,     0,     5,    55,    54,     0,    52,    51,    50,
  347.     49,    48,    42,    43,    46,    47,    44,    45,    40,    41,
  348.     34,    38,    39,    35,    36,    37,   127,     0,    17,    16,
  349.      0,    20,    19,     0,    26,     0,    29,    30,     0,    68,
  350.     95,     0,    69,    78,    79,    83,    81,     0,    90,    92,
  351.      0,   123,    74,     0,     0,    86,    88,    63,   105,     0,
  352.     32,     0,    18,    21,    22,     0,    28,    31,    70,    91,
  353.     85,     0,     0,    93,   116,    53,    24,   124,     0,     0,
  354.      0
  355. };
  356.  
  357. static const short yydefgoto[] = {   209,
  358.     35,    77,    37,   165,    38,   111,   168,    39,    40,    41,
  359.     42,   121,   122,   123,   124,   182,    56,    61,   184,   173,
  360.     45
  361. };
  362.  
  363. static const short yypact[] = {   202,
  364. -32768,-32768,-32768,-32768,-32768,-32768,     8,     8,     8,     8,
  365.    264,    29,     8,     8,   103,    14,    -8,-32768,   222,   222,
  366. -32768,-32768,-32768,-32768,   202,   202,   202,   202,   202,   202,
  367.     11,   202,   202,-32768,-32768,     3,   466,   202,    22,-32768,
  368. -32768,-32768,-32768,   373,-32768,-32768,-32768,-32768,-32768,-32768,
  369. -32768,-32768,-32768,   202,   -13,    38,-32768,    98,    44,-32768,
  370. -32768,-32768,    36,-32768,-32768,-32768,    79,-32768,-32768,-32768,
  371. -32768,   -13,   -13,   -13,   -13,   -13,   -17,    58,   -13,   -13,
  372.    202,   202,   202,   202,   202,   202,   202,   202,   202,   202,
  373.    202,   202,   202,   202,   202,   202,   202,   202,   202,   202,
  374.    202,   202,   202,-32768,-32768,   349,   393,   202,-32768,   466,
  375.    -18,    42,     8,    97,    69,    69,    69,    69,     7,   129,
  376. -32768,    55,-32768,-32768,    62,    50,    95,-32768,-32768,   222,
  377. -32768,-32768,   202,   466,   466,   466,   430,   518,   542,   565,
  378.    587,   608,   627,   627,   249,   249,   249,   249,   640,   640,
  379.    652,   119,   119,   -13,   -13,   -13,   113,   202,-32768,-32768,
  380.    202,-32768,-32768,    -2,   202,   202,-32768,-32768,   202,   127,
  381. -32768,     8,-32768,-32768,-32768,-32768,-32768,    82,-32768,-32768,
  382.     90,-32768,   402,   -12,    52,-32768,-32768,   326,-32768,   114,
  383.    -13,   202,   -13,   -13,-32768,   -11,   466,   -13,-32768,-32768,
  384. -32768,   115,   222,-32768,-32768,   493,-32768,-32768,   163,   171,
  385. -32768
  386. };
  387.  
  388. static const short yypgoto[] = {-32768,
  389. -32768,     6,    -4,-32768,-32768,    15,    67,-32768,-32768,    53,
  390. -32768,    17,-32768,    59,    60,     1,     0,   168,-32768,    -5,
  391. -32768
  392. };
  393.  
  394.  
  395. #define    YYLAST        710
  396.  
  397.  
  398. static const short yytable[] = {    44,
  399.     43,    50,    51,    52,    53,    36,    55,    62,    63,   178,
  400.    166,    81,    69,    46,    47,    48,   203,   166,    70,    71,
  401.     72,    73,    74,    75,    76,   -66,    81,    79,    80,    44,
  402.     78,    81,    67,   110,    68,    57,   113,    44,   112,   104,
  403.    105,   106,   107,   108,   109,   132,   167,    58,    59,    60,
  404.    204,   207,   126,    44,   125,    46,    47,    48,     5,   195,
  405.      7,     8,     9,    10,   129,    12,    49,    14,   179,    15,
  406.     16,    17,    18,    19,    20,   130,   134,   135,   136,   137,
  407.    138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
  408.    148,   149,   150,   151,   152,   153,   154,   155,   156,   131,
  409.    160,   163,    46,    47,    48,   117,   167,   170,    49,    57,
  410.    172,   119,   185,   164,   180,   189,   127,   118,   128,   183,
  411.    133,    64,    65,    60,   188,   119,   120,   -96,   191,   183,
  412.    190,   174,   175,   176,   177,     5,   181,     7,     8,     9,
  413.     10,   -67,    12,   200,    14,   171,    15,    16,    17,    18,
  414.     19,    20,   201,   193,   205,    49,   194,   172,   159,   162,
  415.    110,   197,   210,   171,   198,   117,   199,   101,   102,   103,
  416.    211,   104,   105,   106,   107,   108,   109,   118,   169,   196,
  417.    186,   187,    66,   191,   183,   119,   120,   206,     0,     0,
  418.      0,   180,     0,     0,     0,     0,     0,     0,     0,     0,
  419.      0,     0,   183,   208,     1,     2,     3,     4,     5,     6,
  420.      7,     8,     9,    10,    11,    12,    13,    14,     0,    15,
  421.     16,    17,    18,    19,    20,    21,    22,    23,     5,    24,
  422.      7,     8,     9,    10,     0,    12,     0,    14,    25,    15,
  423.     16,    17,    18,    19,    20,     0,     0,     0,     0,    26,
  424.     27,     0,     0,     0,    28,    29,     0,     0,     0,    30,
  425.     31,    32,    33,     0,     0,    34,     1,     2,     3,     4,
  426.      5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  427.      0,    15,    16,    17,    18,    19,    20,    21,    22,    23,
  428.      0,    24,    96,    97,    98,    99,   100,   101,   102,   103,
  429.     25,   104,   105,   106,   107,   108,   109,     0,     0,     0,
  430.      0,    26,    27,     0,     0,     0,    28,    29,     0,     0,
  431.      0,    54,    31,    32,    33,     0,     0,    34,     1,     2,
  432.      3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
  433.     13,    14,     0,    15,    16,    17,    18,    19,    20,    21,
  434.     22,    23,     0,    24,    46,   157,    48,     7,     8,     9,
  435.     10,     0,    12,     0,    14,     0,    15,    16,    17,    18,
  436.     19,    20,     0,     0,     0,     0,     0,     0,    28,    29,
  437.      0,     0,     0,    30,    31,    32,    33,   114,     0,    34,
  438.      0,     0,     0,     0,   115,   116,     0,   158,    46,   157,
  439.     48,     7,     8,     9,    10,     0,    12,    49,    14,   117,
  440.     15,    16,    17,    18,    19,    20,   202,     0,     0,     0,
  441.      0,   118,     0,   115,   116,     0,     0,     0,     0,   119,
  442.    120,     0,     0,     0,     0,     0,     0,     0,   117,     0,
  443.      0,   161,     0,     0,     0,     0,     0,     0,     0,     0,
  444.    118,    49,     0,     0,     0,     0,    82,     0,   119,   120,
  445.     83,    84,    85,    86,    87,    88,    89,    90,    91,    92,
  446.     93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
  447.    103,     0,   104,   105,   106,   107,   108,   109,     0,     0,
  448.      0,     0,    82,     0,     0,   192,    83,    84,    85,    86,
  449.     87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
  450.     97,    98,    99,   100,   101,   102,   103,     0,   104,   105,
  451.    106,   107,   108,   109,    84,    85,    86,    87,    88,    89,
  452.     90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
  453.    100,   101,   102,   103,     0,   104,   105,   106,   107,   108,
  454.    109,    86,    87,    88,    89,    90,    91,    92,    93,    94,
  455.     95,    96,    97,    98,    99,   100,   101,   102,   103,     0,
  456.    104,   105,   106,   107,   108,   109,    87,    88,    89,    90,
  457.     91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
  458.    101,   102,   103,     0,   104,   105,   106,   107,   108,   109,
  459.     88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
  460.     98,    99,   100,   101,   102,   103,     0,   104,   105,   106,
  461.    107,   108,   109,    89,    90,    91,    92,    93,    94,    95,
  462.     96,    97,    98,    99,   100,   101,   102,   103,     0,   104,
  463.    105,   106,   107,   108,   109,    90,    91,    92,    93,    94,
  464.     95,    96,    97,    98,    99,   100,   101,   102,   103,     0,
  465.    104,   105,   106,   107,   108,   109,    92,    93,    94,    95,
  466.     96,    97,    98,    99,   100,   101,   102,   103,     0,   104,
  467.    105,   106,   107,   108,   109,    98,    99,   100,   101,   102,
  468.    103,     0,   104,   105,   106,   107,   108,   109,    99,   100,
  469.    101,   102,   103,     0,   104,   105,   106,   107,   108,   109
  470. };
  471.  
  472. static const short yycheck[] = {     0,
  473.      0,     7,     8,     9,    10,     0,    11,    13,    14,     3,
  474.     29,    29,    21,     6,     7,     8,    29,    29,    19,    20,
  475.     25,    26,    27,    28,    29,    15,    29,    32,    33,    30,
  476.     30,    29,    19,    38,    21,     7,    15,    38,    38,    53,
  477.     54,    55,    56,    57,    58,    63,    65,    19,    20,    21,
  478.     63,    63,    15,    54,    54,     6,     7,     8,     7,    62,
  479.      9,    10,    11,    12,    21,    14,    59,    16,    62,    18,
  480.     19,    20,    21,    22,    23,    40,    81,    82,    83,    84,
  481.     85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
  482.     95,    96,    97,    98,    99,   100,   101,   102,   103,    21,
  483.    106,   107,     6,     7,     8,    37,    65,   113,    59,     7,
  484.     61,    57,    58,   108,    63,    21,    19,    49,    21,   120,
  485.     63,    19,    20,    21,    63,    57,    58,    15,   133,   130,
  486.    130,   115,   116,   117,   118,     7,   120,     9,    10,    11,
  487.     12,    15,    14,    62,    16,    49,    18,    19,    20,    21,
  488.     22,    23,    63,   158,    41,    59,   161,    61,   106,   107,
  489.    165,   166,     0,    49,   169,    37,   172,    49,    50,    51,
  490.      0,    53,    54,    55,    56,    57,    58,    49,   112,   165,
  491.    122,   122,    15,   188,   185,    57,    58,   192,    -1,    -1,
  492.     -1,    63,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  493.     -1,    -1,   203,   203,     3,     4,     5,     6,     7,     8,
  494.      9,    10,    11,    12,    13,    14,    15,    16,    -1,    18,
  495.     19,    20,    21,    22,    23,    24,    25,    26,     7,    28,
  496.      9,    10,    11,    12,    -1,    14,    -1,    16,    37,    18,
  497.     19,    20,    21,    22,    23,    -1,    -1,    -1,    -1,    48,
  498.     49,    -1,    -1,    -1,    53,    54,    -1,    -1,    -1,    58,
  499.     59,    60,    61,    -1,    -1,    64,     3,     4,     5,     6,
  500.      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
  501.     -1,    18,    19,    20,    21,    22,    23,    24,    25,    26,
  502.     -1,    28,    44,    45,    46,    47,    48,    49,    50,    51,
  503.     37,    53,    54,    55,    56,    57,    58,    -1,    -1,    -1,
  504.     -1,    48,    49,    -1,    -1,    -1,    53,    54,    -1,    -1,
  505.     -1,    58,    59,    60,    61,    -1,    -1,    64,     3,     4,
  506.      5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  507.     15,    16,    -1,    18,    19,    20,    21,    22,    23,    24,
  508.     25,    26,    -1,    28,     6,     7,     8,     9,    10,    11,
  509.     12,    -1,    14,    -1,    16,    -1,    18,    19,    20,    21,
  510.     22,    23,    -1,    -1,    -1,    -1,    -1,    -1,    53,    54,
  511.     -1,    -1,    -1,    58,    59,    60,    61,    15,    -1,    64,
  512.     -1,    -1,    -1,    -1,    22,    23,    -1,    49,     6,     7,
  513.      8,     9,    10,    11,    12,    -1,    14,    59,    16,    37,
  514.     18,    19,    20,    21,    22,    23,    15,    -1,    -1,    -1,
  515.     -1,    49,    -1,    22,    23,    -1,    -1,    -1,    -1,    57,
  516.     58,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    37,    -1,
  517.     -1,    49,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  518.     49,    59,    -1,    -1,    -1,    -1,    27,    -1,    57,    58,
  519.     31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
  520.     41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
  521.     51,    -1,    53,    54,    55,    56,    57,    58,    -1,    -1,
  522.     -1,    -1,    27,    -1,    -1,    66,    31,    32,    33,    34,
  523.     35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
  524.     45,    46,    47,    48,    49,    50,    51,    -1,    53,    54,
  525.     55,    56,    57,    58,    32,    33,    34,    35,    36,    37,
  526.     38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
  527.     48,    49,    50,    51,    -1,    53,    54,    55,    56,    57,
  528.     58,    34,    35,    36,    37,    38,    39,    40,    41,    42,
  529.     43,    44,    45,    46,    47,    48,    49,    50,    51,    -1,
  530.     53,    54,    55,    56,    57,    58,    35,    36,    37,    38,
  531.     39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
  532.     49,    50,    51,    -1,    53,    54,    55,    56,    57,    58,
  533.     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  534.     46,    47,    48,    49,    50,    51,    -1,    53,    54,    55,
  535.     56,    57,    58,    37,    38,    39,    40,    41,    42,    43,
  536.     44,    45,    46,    47,    48,    49,    50,    51,    -1,    53,
  537.     54,    55,    56,    57,    58,    38,    39,    40,    41,    42,
  538.     43,    44,    45,    46,    47,    48,    49,    50,    51,    -1,
  539.     53,    54,    55,    56,    57,    58,    40,    41,    42,    43,
  540.     44,    45,    46,    47,    48,    49,    50,    51,    -1,    53,
  541.     54,    55,    56,    57,    58,    46,    47,    48,    49,    50,
  542.     51,    -1,    53,    54,    55,    56,    57,    58,    47,    48,
  543.     49,    50,    51,    -1,    53,    54,    55,    56,    57,    58
  544. };
  545. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  546. #line 3 "/usr/unsupported/lib/bison.simple"
  547.  
  548. /* Skeleton output parser for bison,
  549.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  550.  
  551.    This program is free software; you can redistribute it and/or modify
  552.    it under the terms of the GNU General Public License as published by
  553.    the Free Software Foundation; either version 1, or (at your option)
  554.    any later version.
  555.  
  556.    This program is distributed in the hope that it will be useful,
  557.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  558.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  559.    GNU General Public License for more details.
  560.  
  561.    You should have received a copy of the GNU General Public License
  562.    along with this program; if not, write to the Free Software
  563.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  564.  
  565.  
  566. #ifndef alloca
  567. #ifdef __GNUC__
  568. #define alloca __builtin_alloca
  569. #else /* not GNU C.  */
  570. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
  571. #include <alloca.h>
  572. #else /* not sparc */
  573. #if defined (MSDOS) && !defined (__TURBOC__)
  574. #else /* not MSDOS, or __TURBOC__ */
  575. #if defined(_AIX)
  576.  #pragma alloca
  577. #else /* not MSDOS, __TURBOC__, or _AIX */
  578. #ifdef __hpux
  579. #ifdef __cplusplus
  580. extern "C" {
  581. void *alloca (unsigned int);
  582. };
  583. #else /* not __cplusplus */
  584. void *alloca ();
  585. #endif /* not __cplusplus */
  586. #endif /* __hpux */
  587. #endif /* not _AIX */
  588. #endif /* not MSDOS, or __TURBOC__ */
  589. #endif /* not sparc.  */
  590. #endif /* not GNU C.  */
  591. #endif /* alloca not defined.  */
  592.  
  593. /* This is the parser code that is written into each bison parser
  594.   when the %semantic_parser declaration is not specified in the grammar.
  595.   It was written by Richard Stallman by simplifying the hairy parser
  596.   used when %semantic_parser is specified.  */
  597.  
  598. /* Note: there must be only one dollar sign in this file.
  599.    It is replaced by the list of actions, each action
  600.    as one case of the switch.  */
  601.  
  602. #define yyerrok        (yyerrstatus = 0)
  603. #define yyclearin    (yychar = YYEMPTY)
  604. #define YYEMPTY        -2
  605. #define YYEOF        0
  606. #define YYACCEPT    return(0)
  607. #define YYABORT     return(1)
  608. #define YYERROR        goto yyerrlab1
  609. /* Like YYERROR except do call yyerror.
  610.    This remains here temporarily to ease the
  611.    transition to the new meaning of YYERROR, for GCC.
  612.    Once GCC version 2 has supplanted version 1, this can go.  */
  613. #define YYFAIL        goto yyerrlab
  614. #define YYRECOVERING()  (!!yyerrstatus)
  615. #define YYBACKUP(token, value) \
  616. do                                \
  617.   if (yychar == YYEMPTY && yylen == 1)                \
  618.     { yychar = (token), yylval = (value);            \
  619.       yychar1 = YYTRANSLATE (yychar);                \
  620.       YYPOPSTACK;                        \
  621.       goto yybackup;                        \
  622.     }                                \
  623.   else                                \
  624.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  625. while (0)
  626.  
  627. #define YYTERROR    1
  628. #define YYERRCODE    256
  629.  
  630. #ifndef YYPURE
  631. #define YYLEX        yylex()
  632. #endif
  633.  
  634. #ifdef YYPURE
  635. #ifdef YYLSP_NEEDED
  636. #define YYLEX        yylex(&yylval, &yylloc)
  637. #else
  638. #define YYLEX        yylex(&yylval)
  639. #endif
  640. #endif
  641.  
  642. /* If nonreentrant, generate the variables here */
  643.  
  644. #ifndef YYPURE
  645.  
  646. int    yychar;            /*  the lookahead symbol        */
  647. YYSTYPE    yylval;            /*  the semantic value of the        */
  648.                 /*  lookahead symbol            */
  649.  
  650. #ifdef YYLSP_NEEDED
  651. YYLTYPE yylloc;            /*  location data for the lookahead    */
  652.                 /*  symbol                */
  653. #endif
  654.  
  655. int yynerrs;            /*  number of parse errors so far       */
  656. #endif  /* not YYPURE */
  657.  
  658. #if YYDEBUG != 0
  659. int yydebug;            /*  nonzero means print parse trace    */
  660. /* Since this is uninitialized, it does not stop multiple parsers
  661.    from coexisting.  */
  662. #endif
  663.  
  664. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  665.  
  666. #ifndef    YYINITDEPTH
  667. #define YYINITDEPTH 200
  668. #endif
  669.  
  670. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  671.     (effective only if the built-in stack extension method is used).  */
  672.  
  673. #if YYMAXDEPTH == 0
  674. #undef YYMAXDEPTH
  675. #endif
  676.  
  677. #ifndef YYMAXDEPTH
  678. #define YYMAXDEPTH 10000
  679. #endif
  680.  
  681. /* Prevent warning if -Wstrict-prototypes.  */
  682. #ifdef __GNUC__
  683. int yyparse (void);
  684. #endif
  685.  
  686. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  687. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  688. #else                /* not GNU C or C++ */
  689. #ifndef __cplusplus
  690.  
  691. /* This is the most reliable way to avoid incompatibilities
  692.    in available built-in functions on various systems.  */
  693. static void
  694. __yy_bcopy (from, to, count)
  695.      char *from;
  696.      char *to;
  697.      int count;
  698. {
  699.   register char *f = from;
  700.   register char *t = to;
  701.   register int i = count;
  702.  
  703.   while (i-- > 0)
  704.     *t++ = *f++;
  705. }
  706.  
  707. #else /* __cplusplus */
  708.  
  709. /* This is the most reliable way to avoid incompatibilities
  710.    in available built-in functions on various systems.  */
  711. static void
  712. __yy_bcopy (char *from, char *to, int count)
  713. {
  714.   register char *f = from;
  715.   register char *t = to;
  716.   register int i = count;
  717.  
  718.   while (i-- > 0)
  719.     *t++ = *f++;
  720. }
  721.  
  722. #endif
  723. #endif
  724.  
  725. #line 184 "/usr/unsupported/lib/bison.simple"
  726. int
  727. yyparse()
  728. {
  729.   register int yystate;
  730.   register int yyn;
  731.   register short *yyssp;
  732.   register YYSTYPE *yyvsp;
  733.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  734.   int yychar1 = 0;        /*  lookahead token as an internal (translated) token number */
  735.  
  736.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  737.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  738.  
  739.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  740.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to xreallocate them elsewhere */
  741.  
  742. #ifdef YYLSP_NEEDED
  743.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  744.   YYLTYPE *yyls = yylsa;
  745.   YYLTYPE *yylsp;
  746.  
  747. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  748. #else
  749. #define YYPOPSTACK   (yyvsp--, yyssp--)
  750. #endif
  751.  
  752.   int yystacksize = YYINITDEPTH;
  753.  
  754. #ifdef YYPURE
  755.   int yychar;
  756.   YYSTYPE yylval;
  757.   int yynerrs;
  758. #ifdef YYLSP_NEEDED
  759.   YYLTYPE yylloc;
  760. #endif
  761. #endif
  762.  
  763.   YYSTYPE yyval;        /*  the variable used to return        */
  764.                 /*  semantic values from the action    */
  765.                 /*  routines                */
  766.  
  767.   int yylen;
  768.  
  769. #if YYDEBUG != 0
  770.   if (yydebug)
  771.     fprintf(stderr, "Starting parse\n");
  772. #endif
  773.  
  774.   yystate = 0;
  775.   yyerrstatus = 0;
  776.   yynerrs = 0;
  777.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  778.  
  779.   /* Initialize stack pointers.
  780.      Waste one element of value and location stack
  781.      so that they stay on the same level as the state stack.
  782.      The wasted elements are never initialized.  */
  783.  
  784.   yyssp = yyss - 1;
  785.   yyvsp = yyvs;
  786. #ifdef YYLSP_NEEDED
  787.   yylsp = yyls;
  788. #endif
  789.  
  790. /* Push a new state, which is found in  yystate  .  */
  791. /* In all cases, when you get here, the value and location stacks
  792.    have just been pushed. so pushing a state here evens the stacks.  */
  793. yynewstate:
  794.  
  795.   *++yyssp = yystate;
  796.  
  797.   if (yyssp >= yyss + yystacksize - 1)
  798.     {
  799.       /* Give user a chance to xreallocate the stack */
  800.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  801.       YYSTYPE *yyvs1 = yyvs;
  802.       short *yyss1 = yyss;
  803. #ifdef YYLSP_NEEDED
  804.       YYLTYPE *yyls1 = yyls;
  805. #endif
  806.  
  807.       /* Get the current used size of the three stacks, in elements.  */
  808.       int size = yyssp - yyss + 1;
  809.  
  810. #ifdef yyoverflow
  811.       /* Each stack pointer address is followed by the size of
  812.      the data in use in that stack, in bytes.  */
  813. #ifdef YYLSP_NEEDED
  814.       /* This used to be a conditional around just the two extra args,
  815.      but that might be undefined if yyoverflow is a macro.  */
  816.       yyoverflow("parser stack overflow",
  817.          &yyss1, size * sizeof (*yyssp),
  818.          &yyvs1, size * sizeof (*yyvsp),
  819.          &yyls1, size * sizeof (*yylsp),
  820.          &yystacksize);
  821. #else
  822.       yyoverflow("parser stack overflow",
  823.          &yyss1, size * sizeof (*yyssp),
  824.          &yyvs1, size * sizeof (*yyvsp),
  825.          &yystacksize);
  826. #endif
  827.  
  828.       yyss = yyss1; yyvs = yyvs1;
  829. #ifdef YYLSP_NEEDED
  830.       yyls = yyls1;
  831. #endif
  832. #else /* no yyoverflow */
  833.       /* Extend the stack our own way.  */
  834.       if (yystacksize >= YYMAXDEPTH)
  835.     {
  836.       yyerror("parser stack overflow");
  837.       return 2;
  838.     }
  839.       yystacksize *= 2;
  840.       if (yystacksize > YYMAXDEPTH)
  841.     yystacksize = YYMAXDEPTH;
  842.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  843.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  844.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  845.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  846. #ifdef YYLSP_NEEDED
  847.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  848.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  849. #endif
  850. #endif /* no yyoverflow */
  851.  
  852.       yyssp = yyss + size - 1;
  853.       yyvsp = yyvs + size - 1;
  854. #ifdef YYLSP_NEEDED
  855.       yylsp = yyls + size - 1;
  856. #endif
  857.  
  858. #if YYDEBUG != 0
  859.       if (yydebug)
  860.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  861. #endif
  862.  
  863.       if (yyssp >= yyss + yystacksize - 1)
  864.     YYABORT;
  865.     }
  866.  
  867. #if YYDEBUG != 0
  868.   if (yydebug)
  869.     fprintf(stderr, "Entering state %d\n", yystate);
  870. #endif
  871.  
  872.   goto yybackup;
  873.  yybackup:
  874.  
  875. /* Do appropriate processing given the current state.  */
  876. /* Read a lookahead token if we need one and don't already have one.  */
  877. /* yyresume: */
  878.  
  879.   /* First try to decide what to do without reference to lookahead token.  */
  880.  
  881.   yyn = yypact[yystate];
  882.   if (yyn == YYFLAG)
  883.     goto yydefault;
  884.  
  885.   /* Not known => get a lookahead token if don't already have one.  */
  886.  
  887.   /* yychar is either YYEMPTY or YYEOF
  888.      or a valid token in external form.  */
  889.  
  890.   if (yychar == YYEMPTY)
  891.     {
  892. #if YYDEBUG != 0
  893.       if (yydebug)
  894.     fprintf(stderr, "Reading a token: ");
  895. #endif
  896.       yychar = YYLEX;
  897.     }
  898.  
  899.   /* Convert token to internal form (in yychar1) for indexing tables with */
  900.  
  901.   if (yychar <= 0)        /* This means end of input. */
  902.     {
  903.       yychar1 = 0;
  904.       yychar = YYEOF;        /* Don't call YYLEX any more */
  905.  
  906. #if YYDEBUG != 0
  907.       if (yydebug)
  908.     fprintf(stderr, "Now at end of input.\n");
  909. #endif
  910.     }
  911.   else
  912.     {
  913.       yychar1 = YYTRANSLATE(yychar);
  914.  
  915. #if YYDEBUG != 0
  916.       if (yydebug)
  917.     {
  918.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  919.       /* Give the individual parser a way to print the precise meaning
  920.          of a token, for further debugging info.  */
  921. #ifdef YYPRINT
  922.       YYPRINT (stderr, yychar, yylval);
  923. #endif
  924.       fprintf (stderr, ")\n");
  925.     }
  926. #endif
  927.     }
  928.  
  929.   yyn += yychar1;
  930.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  931.     goto yydefault;
  932.  
  933.   yyn = yytable[yyn];
  934.  
  935.   /* yyn is what to do for this token type in this state.
  936.      Negative => reduce, -yyn is rule number.
  937.      Positive => shift, yyn is new state.
  938.        New state is final state => don't bother to shift,
  939.        just return success.
  940.      0, or most negative number => error.  */
  941.  
  942.   if (yyn < 0)
  943.     {
  944.       if (yyn == YYFLAG)
  945.     goto yyerrlab;
  946.       yyn = -yyn;
  947.       goto yyreduce;
  948.     }
  949.   else if (yyn == 0)
  950.     goto yyerrlab;
  951.  
  952.   if (yyn == YYFINAL)
  953.     YYACCEPT;
  954.  
  955.   /* Shift the lookahead token.  */
  956.  
  957. #if YYDEBUG != 0
  958.   if (yydebug)
  959.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  960. #endif
  961.  
  962.   /* Discard the token being shifted unless it is eof.  */
  963.   if (yychar != YYEOF)
  964.     yychar = YYEMPTY;
  965.  
  966.   *++yyvsp = yylval;
  967. #ifdef YYLSP_NEEDED
  968.   *++yylsp = yylloc;
  969. #endif
  970.  
  971.   /* count tokens shifted since error; after three, turn off error status.  */
  972.   if (yyerrstatus) yyerrstatus--;
  973.  
  974.   yystate = yyn;
  975.   goto yynewstate;
  976.  
  977. /* Do the default action for the current state.  */
  978. yydefault:
  979.  
  980.   yyn = yydefact[yystate];
  981.   if (yyn == 0)
  982.     goto yyerrlab;
  983.  
  984. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  985. yyreduce:
  986.   yylen = yyr2[yyn];
  987.   if (yylen > 0)
  988.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  989.  
  990. #if YYDEBUG != 0
  991.   if (yydebug)
  992.     {
  993.       int i;
  994.  
  995.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  996.            yyn, yyrline[yyn]);
  997.  
  998.       /* Print the symbols being reduced, and their result.  */
  999.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  1000.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  1001.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  1002.     }
  1003. #endif
  1004.  
  1005.  
  1006.   switch (yyn) {
  1007.  
  1008. case 3:
  1009. #line 216 "./c-exp.y"
  1010. { write_exp_elt_opcode(OP_TYPE);
  1011.               write_exp_elt_type(yyvsp[0].tval);
  1012.               write_exp_elt_opcode(OP_TYPE);;
  1013.     break;}
  1014. case 5:
  1015. #line 224 "./c-exp.y"
  1016. { write_exp_elt_opcode (BINOP_COMMA); ;
  1017.     break;}
  1018. case 6:
  1019. #line 229 "./c-exp.y"
  1020. { write_exp_elt_opcode (UNOP_IND); ;
  1021.     break;}
  1022. case 7:
  1023. #line 232 "./c-exp.y"
  1024. { write_exp_elt_opcode (UNOP_ADDR); ;
  1025.     break;}
  1026. case 8:
  1027. #line 235 "./c-exp.y"
  1028. { write_exp_elt_opcode (UNOP_NEG); ;
  1029.     break;}
  1030. case 9:
  1031. #line 239 "./c-exp.y"
  1032. { write_exp_elt_opcode (UNOP_LOGICAL_NOT); ;
  1033.     break;}
  1034. case 10:
  1035. #line 243 "./c-exp.y"
  1036. { write_exp_elt_opcode (UNOP_COMPLEMENT); ;
  1037.     break;}
  1038. case 11:
  1039. #line 247 "./c-exp.y"
  1040. { write_exp_elt_opcode (UNOP_PREINCREMENT); ;
  1041.     break;}
  1042. case 12:
  1043. #line 251 "./c-exp.y"
  1044. { write_exp_elt_opcode (UNOP_PREDECREMENT); ;
  1045.     break;}
  1046. case 13:
  1047. #line 255 "./c-exp.y"
  1048. { write_exp_elt_opcode (UNOP_POSTINCREMENT); ;
  1049.     break;}
  1050. case 14:
  1051. #line 259 "./c-exp.y"
  1052. { write_exp_elt_opcode (UNOP_POSTDECREMENT); ;
  1053.     break;}
  1054. case 15:
  1055. #line 263 "./c-exp.y"
  1056. { write_exp_elt_opcode (UNOP_SIZEOF); ;
  1057.     break;}
  1058. case 16:
  1059. #line 267 "./c-exp.y"
  1060. { write_exp_elt_opcode (STRUCTOP_PTR);
  1061.               write_exp_string (yyvsp[0].sval);
  1062.               write_exp_elt_opcode (STRUCTOP_PTR); ;
  1063.     break;}
  1064. case 17:
  1065. #line 273 "./c-exp.y"
  1066. { /* exp->type::name becomes exp->*(&type::name) */
  1067.               /* Note: this doesn't work if name is a
  1068.                  static member!  FIXME */
  1069.               write_exp_elt_opcode (UNOP_ADDR);
  1070.               write_exp_elt_opcode (STRUCTOP_MPTR); ;
  1071.     break;}
  1072. case 18:
  1073. #line 280 "./c-exp.y"
  1074. { write_exp_elt_opcode (STRUCTOP_MPTR); ;
  1075.     break;}
  1076. case 19:
  1077. #line 284 "./c-exp.y"
  1078. { write_exp_elt_opcode (STRUCTOP_STRUCT);
  1079.               write_exp_string (yyvsp[0].sval);
  1080.               write_exp_elt_opcode (STRUCTOP_STRUCT); ;
  1081.     break;}
  1082. case 20:
  1083. #line 290 "./c-exp.y"
  1084. { /* exp.type::name becomes exp.*(&type::name) */
  1085.               /* Note: this doesn't work if name is a
  1086.                  static member!  FIXME */
  1087.               write_exp_elt_opcode (UNOP_ADDR);
  1088.               write_exp_elt_opcode (STRUCTOP_MEMBER); ;
  1089.     break;}
  1090. case 21:
  1091. #line 298 "./c-exp.y"
  1092. { write_exp_elt_opcode (STRUCTOP_MEMBER); ;
  1093.     break;}
  1094. case 22:
  1095. #line 302 "./c-exp.y"
  1096. { write_exp_elt_opcode (BINOP_SUBSCRIPT); ;
  1097.     break;}
  1098. case 23:
  1099. #line 308 "./c-exp.y"
  1100. { start_arglist (); ;
  1101.     break;}
  1102. case 24:
  1103. #line 310 "./c-exp.y"
  1104. { write_exp_elt_opcode (OP_FUNCALL);
  1105.               write_exp_elt_longcst ((LONGEST) end_arglist ());
  1106.               write_exp_elt_opcode (OP_FUNCALL); ;
  1107.     break;}
  1108. case 25:
  1109. #line 316 "./c-exp.y"
  1110. { start_arglist (); ;
  1111.     break;}
  1112. case 27:
  1113. #line 323 "./c-exp.y"
  1114. { arglist_len = 1; ;
  1115.     break;}
  1116. case 28:
  1117. #line 327 "./c-exp.y"
  1118. { arglist_len++; ;
  1119.     break;}
  1120. case 29:
  1121. #line 331 "./c-exp.y"
  1122. { yyval.lval = end_arglist () - 1; ;
  1123.     break;}
  1124. case 30:
  1125. #line 334 "./c-exp.y"
  1126. { write_exp_elt_opcode (OP_ARRAY);
  1127.               write_exp_elt_longcst ((LONGEST) 0);
  1128.               write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
  1129.               write_exp_elt_opcode (OP_ARRAY); ;
  1130.     break;}
  1131. case 31:
  1132. #line 341 "./c-exp.y"
  1133. { write_exp_elt_opcode (UNOP_MEMVAL);
  1134.               write_exp_elt_type (yyvsp[-2].tval);
  1135.               write_exp_elt_opcode (UNOP_MEMVAL); ;
  1136.     break;}
  1137. case 32:
  1138. #line 347 "./c-exp.y"
  1139. { write_exp_elt_opcode (UNOP_CAST);
  1140.               write_exp_elt_type (yyvsp[-2].tval);
  1141.               write_exp_elt_opcode (UNOP_CAST); ;
  1142.     break;}
  1143. case 33:
  1144. #line 353 "./c-exp.y"
  1145. { ;
  1146.     break;}
  1147. case 34:
  1148. #line 359 "./c-exp.y"
  1149. { write_exp_elt_opcode (BINOP_REPEAT); ;
  1150.     break;}
  1151. case 35:
  1152. #line 363 "./c-exp.y"
  1153. { write_exp_elt_opcode (BINOP_MUL); ;
  1154.     break;}
  1155. case 36:
  1156. #line 367 "./c-exp.y"
  1157. { write_exp_elt_opcode (BINOP_DIV); ;
  1158.     break;}
  1159. case 37:
  1160. #line 371 "./c-exp.y"
  1161. { write_exp_elt_opcode (BINOP_REM); ;
  1162.     break;}
  1163. case 38:
  1164. #line 375 "./c-exp.y"
  1165. { write_exp_elt_opcode (BINOP_ADD); ;
  1166.     break;}
  1167. case 39:
  1168. #line 379 "./c-exp.y"
  1169. { write_exp_elt_opcode (BINOP_SUB); ;
  1170.     break;}
  1171. case 40:
  1172. #line 383 "./c-exp.y"
  1173. { write_exp_elt_opcode (BINOP_LSH); ;
  1174.     break;}
  1175. case 41:
  1176. #line 387 "./c-exp.y"
  1177. { write_exp_elt_opcode (BINOP_RSH); ;
  1178.     break;}
  1179. case 42:
  1180. #line 391 "./c-exp.y"
  1181. { write_exp_elt_opcode (BINOP_EQUAL); ;
  1182.     break;}
  1183. case 43:
  1184. #line 395 "./c-exp.y"
  1185. { write_exp_elt_opcode (BINOP_NOTEQUAL); ;
  1186.     break;}
  1187. case 44:
  1188. #line 399 "./c-exp.y"
  1189. { write_exp_elt_opcode (BINOP_LEQ); ;
  1190.     break;}
  1191. case 45:
  1192. #line 403 "./c-exp.y"
  1193. { write_exp_elt_opcode (BINOP_GEQ); ;
  1194.     break;}
  1195. case 46:
  1196. #line 407 "./c-exp.y"
  1197. { write_exp_elt_opcode (BINOP_LESS); ;
  1198.     break;}
  1199. case 47:
  1200. #line 411 "./c-exp.y"
  1201. { write_exp_elt_opcode (BINOP_GTR); ;
  1202.     break;}
  1203. case 48:
  1204. #line 415 "./c-exp.y"
  1205. { write_exp_elt_opcode (BINOP_BITWISE_AND); ;
  1206.     break;}
  1207. case 49:
  1208. #line 419 "./c-exp.y"
  1209. { write_exp_elt_opcode (BINOP_BITWISE_XOR); ;
  1210.     break;}
  1211. case 50:
  1212. #line 423 "./c-exp.y"
  1213. { write_exp_elt_opcode (BINOP_BITWISE_IOR); ;
  1214.     break;}
  1215. case 51:
  1216. #line 427 "./c-exp.y"
  1217. { write_exp_elt_opcode (BINOP_LOGICAL_AND); ;
  1218.     break;}
  1219. case 52:
  1220. #line 431 "./c-exp.y"
  1221. { write_exp_elt_opcode (BINOP_LOGICAL_OR); ;
  1222.     break;}
  1223. case 53:
  1224. #line 435 "./c-exp.y"
  1225. { write_exp_elt_opcode (TERNOP_COND); ;
  1226.     break;}
  1227. case 54:
  1228. #line 439 "./c-exp.y"
  1229. { write_exp_elt_opcode (BINOP_ASSIGN); ;
  1230.     break;}
  1231. case 55:
  1232. #line 443 "./c-exp.y"
  1233. { write_exp_elt_opcode (BINOP_ASSIGN_MODIFY);
  1234.               write_exp_elt_opcode (yyvsp[-1].opcode);
  1235.               write_exp_elt_opcode (BINOP_ASSIGN_MODIFY); ;
  1236.     break;}
  1237. case 56:
  1238. #line 449 "./c-exp.y"
  1239. { write_exp_elt_opcode (OP_LONG);
  1240.               write_exp_elt_type (yyvsp[0].typed_val.type);
  1241.               write_exp_elt_longcst ((LONGEST)(yyvsp[0].typed_val.val));
  1242.               write_exp_elt_opcode (OP_LONG); ;
  1243.     break;}
  1244. case 57:
  1245. #line 456 "./c-exp.y"
  1246. { YYSTYPE val;
  1247.               parse_number (yyvsp[0].ssym.stoken.ptr, yyvsp[0].ssym.stoken.length, 0, &val);
  1248.               write_exp_elt_opcode (OP_LONG);
  1249.               write_exp_elt_type (val.typed_val.type);
  1250.               write_exp_elt_longcst ((LONGEST)val.typed_val.val);
  1251.               write_exp_elt_opcode (OP_LONG);
  1252.             ;
  1253.     break;}
  1254. case 58:
  1255. #line 467 "./c-exp.y"
  1256. { write_exp_elt_opcode (OP_DOUBLE);
  1257.               write_exp_elt_type (builtin_type_double);
  1258.               write_exp_elt_dblcst (yyvsp[0].dval);
  1259.               write_exp_elt_opcode (OP_DOUBLE); ;
  1260.     break;}
  1261. case 60:
  1262. #line 477 "./c-exp.y"
  1263. { write_exp_elt_opcode (OP_LAST);
  1264.               write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
  1265.               write_exp_elt_opcode (OP_LAST); ;
  1266.     break;}
  1267. case 61:
  1268. #line 483 "./c-exp.y"
  1269. { write_exp_elt_opcode (OP_REGISTER);
  1270.               write_exp_elt_longcst ((LONGEST) yyvsp[0].lval);
  1271.               write_exp_elt_opcode (OP_REGISTER); ;
  1272.     break;}
  1273. case 62:
  1274. #line 489 "./c-exp.y"
  1275. { write_exp_elt_opcode (OP_INTERNALVAR);
  1276.               write_exp_elt_intern (yyvsp[0].ivar);
  1277.               write_exp_elt_opcode (OP_INTERNALVAR); ;
  1278.     break;}
  1279. case 63:
  1280. #line 495 "./c-exp.y"
  1281. { write_exp_elt_opcode (OP_LONG);
  1282.               write_exp_elt_type (builtin_type_int);
  1283.               write_exp_elt_longcst ((LONGEST) TYPE_LENGTH (yyvsp[-1].tval));
  1284.               write_exp_elt_opcode (OP_LONG); ;
  1285.     break;}
  1286. case 64:
  1287. #line 502 "./c-exp.y"
  1288. { /* C strings are converted into array constants with
  1289.                  an explicit null byte added at the end.  Thus
  1290.                  the array upper bound is the string length.
  1291.                  There is no such thing in C as a completely empty
  1292.                  string. */
  1293.               char *sp = yyvsp[0].sval.ptr; int count = yyvsp[0].sval.length;
  1294.               while (count-- > 0)
  1295.                 {
  1296.                   write_exp_elt_opcode (OP_LONG);
  1297.                   write_exp_elt_type (builtin_type_char);
  1298.                   write_exp_elt_longcst ((LONGEST)(*sp++));
  1299.                   write_exp_elt_opcode (OP_LONG);
  1300.                 }
  1301.               write_exp_elt_opcode (OP_LONG);
  1302.               write_exp_elt_type (builtin_type_char);
  1303.               write_exp_elt_longcst ((LONGEST)'\0');
  1304.               write_exp_elt_opcode (OP_LONG);
  1305.               write_exp_elt_opcode (OP_ARRAY);
  1306.               write_exp_elt_longcst ((LONGEST) 0);
  1307.               write_exp_elt_longcst ((LONGEST) (yyvsp[0].sval.length));
  1308.               write_exp_elt_opcode (OP_ARRAY); ;
  1309.     break;}
  1310. case 65:
  1311. #line 527 "./c-exp.y"
  1312. { write_exp_elt_opcode (OP_THIS);
  1313.               write_exp_elt_opcode (OP_THIS); ;
  1314.     break;}
  1315. case 66:
  1316. #line 534 "./c-exp.y"
  1317. {
  1318.               if (yyvsp[0].ssym.sym != 0)
  1319.                   yyval.bval = SYMBOL_BLOCK_VALUE (yyvsp[0].ssym.sym);
  1320.               else
  1321.                 {
  1322.                   struct symtab *tem =
  1323.                   lookup_symtab (copy_name (yyvsp[0].ssym.stoken));
  1324.                   if (tem)
  1325.                 yyval.bval = BLOCKVECTOR_BLOCK
  1326.                      (BLOCKVECTOR (tem), STATIC_BLOCK);
  1327.                   else
  1328.                 error ("No file or function \"%s\".",
  1329.                        copy_name (yyvsp[0].ssym.stoken));
  1330.                 }
  1331.             ;
  1332.     break;}
  1333. case 67:
  1334. #line 552 "./c-exp.y"
  1335. { struct symbol *tem
  1336.                 = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
  1337.                          VAR_NAMESPACE, (int *) NULL,
  1338.                          (struct symtab **) NULL);
  1339.               if (!tem || SYMBOL_CLASS (tem) != LOC_BLOCK)
  1340.                 error ("No function \"%s\" in specified context.",
  1341.                    copy_name (yyvsp[0].sval));
  1342.               yyval.bval = SYMBOL_BLOCK_VALUE (tem); ;
  1343.     break;}
  1344. case 68:
  1345. #line 563 "./c-exp.y"
  1346. { struct symbol *sym;
  1347.               sym = lookup_symbol (copy_name (yyvsp[0].sval), yyvsp[-2].bval,
  1348.                            VAR_NAMESPACE, (int *) NULL,
  1349.                            (struct symtab **) NULL);
  1350.               if (sym == 0)
  1351.                 error ("No symbol \"%s\" in specified context.",
  1352.                    copy_name (yyvsp[0].sval));
  1353.  
  1354.               write_exp_elt_opcode (OP_VAR_VALUE);
  1355.               /* block_found is set by lookup_symbol.  */
  1356.               write_exp_elt_block (block_found);
  1357.               write_exp_elt_sym (sym);
  1358.               write_exp_elt_opcode (OP_VAR_VALUE); ;
  1359.     break;}
  1360. case 69:
  1361. #line 579 "./c-exp.y"
  1362. {
  1363.               struct type *type = yyvsp[-2].tval;
  1364.               if (TYPE_CODE (type) != TYPE_CODE_STRUCT
  1365.                   && TYPE_CODE (type) != TYPE_CODE_UNION)
  1366.                 error ("`%s' is not defined as an aggregate type.",
  1367.                    TYPE_NAME (type));
  1368.  
  1369.               write_exp_elt_opcode (OP_SCOPE);
  1370.               write_exp_elt_type (type);
  1371.               write_exp_string (yyvsp[0].sval);
  1372.               write_exp_elt_opcode (OP_SCOPE);
  1373.             ;
  1374.     break;}
  1375. case 70:
  1376. #line 592 "./c-exp.y"
  1377. {
  1378.               struct type *type = yyvsp[-3].tval;
  1379.               struct stoken tmp_token;
  1380.               if (TYPE_CODE (type) != TYPE_CODE_STRUCT
  1381.                   && TYPE_CODE (type) != TYPE_CODE_UNION)
  1382.                 error ("`%s' is not defined as an aggregate type.",
  1383.                    TYPE_NAME (type));
  1384.  
  1385.               if (!STREQ (type_name_no_tag (type), yyvsp[0].sval.ptr))
  1386.                 error ("invalid destructor `%s::~%s'",
  1387.                    type_name_no_tag (type), yyvsp[0].sval.ptr);
  1388.  
  1389.               tmp_token.ptr = (char*) alloca (yyvsp[0].sval.length + 2);
  1390.               tmp_token.length = yyvsp[0].sval.length + 1;
  1391.               tmp_token.ptr[0] = '~';
  1392.               memcpy (tmp_token.ptr+1, yyvsp[0].sval.ptr, yyvsp[0].sval.length);
  1393.               tmp_token.ptr[tmp_token.length] = 0;
  1394.               write_exp_elt_opcode (OP_SCOPE);
  1395.               write_exp_elt_type (type);
  1396.               write_exp_string (tmp_token);
  1397.               write_exp_elt_opcode (OP_SCOPE);
  1398.             ;
  1399.     break;}
  1400. case 72:
  1401. #line 618 "./c-exp.y"
  1402. {
  1403.               char *name = copy_name (yyvsp[0].sval);
  1404.               struct symbol *sym;
  1405.               struct minimal_symbol *msymbol;
  1406.  
  1407.               sym =
  1408.                 lookup_symbol (name, (const struct block *) NULL,
  1409.                        VAR_NAMESPACE, (int *) NULL,
  1410.                        (struct symtab **) NULL);
  1411.               if (sym)
  1412.                 {
  1413.                   write_exp_elt_opcode (OP_VAR_VALUE);
  1414.                   write_exp_elt_block (NULL);
  1415.                   write_exp_elt_sym (sym);
  1416.                   write_exp_elt_opcode (OP_VAR_VALUE);
  1417.                   break;
  1418.                 }
  1419.  
  1420.               msymbol = lookup_minimal_symbol (name, NULL, NULL);
  1421.               if (msymbol != NULL)
  1422.                 {
  1423.                   write_exp_msymbol (msymbol,
  1424.                          lookup_function_type (builtin_type_int),
  1425.                          builtin_type_int);
  1426.                 }
  1427.               else
  1428.                 if (!have_full_symbols () && !have_partial_symbols ())
  1429.                   error ("No symbol table is loaded.  Use the \"file\" command.");
  1430.                 else
  1431.                   error ("No symbol \"%s\" in current context.", name);
  1432.             ;
  1433.     break;}
  1434. case 73:
  1435. #line 652 "./c-exp.y"
  1436. { struct symbol *sym = yyvsp[0].ssym.sym;
  1437.  
  1438.               if (sym)
  1439.                 {
  1440.                   if (symbol_read_needs_frame (sym))
  1441.                 {
  1442.                   if (innermost_block == 0 ||
  1443.                       contained_in (block_found, 
  1444.                             innermost_block))
  1445.                     innermost_block = block_found;
  1446.                 }
  1447.  
  1448.                   write_exp_elt_opcode (OP_VAR_VALUE);
  1449.                   /* We want to use the selected frame, not
  1450.                  another more inner frame which happens to
  1451.                  be in the same block.  */
  1452.                   write_exp_elt_block (NULL);
  1453.                   write_exp_elt_sym (sym);
  1454.                   write_exp_elt_opcode (OP_VAR_VALUE);
  1455.                 }
  1456.               else if (yyvsp[0].ssym.is_a_field_of_this)
  1457.                 {
  1458.                   /* C++: it hangs off of `this'.  Must
  1459.                      not inadvertently convert from a method call
  1460.                  to data ref.  */
  1461.                   if (innermost_block == 0 || 
  1462.                   contained_in (block_found, innermost_block))
  1463.                 innermost_block = block_found;
  1464.                   write_exp_elt_opcode (OP_THIS);
  1465.                   write_exp_elt_opcode (OP_THIS);
  1466.                   write_exp_elt_opcode (STRUCTOP_PTR);
  1467.                   write_exp_string (yyvsp[0].ssym.stoken);
  1468.                   write_exp_elt_opcode (STRUCTOP_PTR);
  1469.                 }
  1470.               else
  1471.                 {
  1472.                   struct minimal_symbol *msymbol;
  1473.                   register char *arg = copy_name (yyvsp[0].ssym.stoken);
  1474.  
  1475.                   msymbol =
  1476.                 lookup_minimal_symbol (arg, NULL, NULL);
  1477.                   if (msymbol != NULL)
  1478.                 {
  1479.                   write_exp_msymbol (msymbol,
  1480.                              lookup_function_type (builtin_type_int),
  1481.                              builtin_type_int);
  1482.                 }
  1483.                   else if (!have_full_symbols () && !have_partial_symbols ())
  1484.                 error ("No symbol table is loaded.  Use the \"file\" command.");
  1485.                   else
  1486.                 error ("No symbol \"%s\" in current context.",
  1487.                        copy_name (yyvsp[0].ssym.stoken));
  1488.                 }
  1489.             ;
  1490.     break;}
  1491. case 77:
  1492. #line 718 "./c-exp.y"
  1493. { yyval.tval = follow_types (yyvsp[-1].tval); ;
  1494.     break;}
  1495. case 78:
  1496. #line 720 "./c-exp.y"
  1497. { yyval.tval = follow_types (yyvsp[-2].tval); ;
  1498.     break;}
  1499. case 79:
  1500. #line 722 "./c-exp.y"
  1501. { yyval.tval = follow_types (yyvsp[-2].tval); ;
  1502.     break;}
  1503. case 80:
  1504. #line 726 "./c-exp.y"
  1505. { push_type (tp_pointer); yyval.voidval = 0; ;
  1506.     break;}
  1507. case 81:
  1508. #line 728 "./c-exp.y"
  1509. { push_type (tp_pointer); yyval.voidval = yyvsp[0].voidval; ;
  1510.     break;}
  1511. case 82:
  1512. #line 730 "./c-exp.y"
  1513. { push_type (tp_reference); yyval.voidval = 0; ;
  1514.     break;}
  1515. case 83:
  1516. #line 732 "./c-exp.y"
  1517. { push_type (tp_reference); yyval.voidval = yyvsp[0].voidval; ;
  1518.     break;}
  1519. case 85:
  1520. #line 737 "./c-exp.y"
  1521. { yyval.voidval = yyvsp[-1].voidval; ;
  1522.     break;}
  1523. case 86:
  1524. #line 739 "./c-exp.y"
  1525. {
  1526.               push_type_int (yyvsp[0].lval);
  1527.               push_type (tp_array);
  1528.             ;
  1529.     break;}
  1530. case 87:
  1531. #line 744 "./c-exp.y"
  1532. {
  1533.               push_type_int (yyvsp[0].lval);
  1534.               push_type (tp_array);
  1535.               yyval.voidval = 0;
  1536.             ;
  1537.     break;}
  1538. case 88:
  1539. #line 751 "./c-exp.y"
  1540. { push_type (tp_function); ;
  1541.     break;}
  1542. case 89:
  1543. #line 753 "./c-exp.y"
  1544. { push_type (tp_function); ;
  1545.     break;}
  1546. case 90:
  1547. #line 757 "./c-exp.y"
  1548. { yyval.lval = -1; ;
  1549.     break;}
  1550. case 91:
  1551. #line 759 "./c-exp.y"
  1552. { yyval.lval = yyvsp[-1].typed_val.val; ;
  1553.     break;}
  1554. case 92:
  1555. #line 763 "./c-exp.y"
  1556. { yyval.voidval = 0; ;
  1557.     break;}
  1558. case 93:
  1559. #line 765 "./c-exp.y"
  1560. { free ((PTR)yyvsp[-1].tvec); yyval.voidval = 0; ;
  1561.     break;}
  1562. case 95:
  1563. #line 778 "./c-exp.y"
  1564. { yyval.tval = lookup_member_type (builtin_type_int, yyvsp[-2].tval); ;
  1565.     break;}
  1566. case 96:
  1567. #line 783 "./c-exp.y"
  1568. { yyval.tval = yyvsp[0].tsym.type; ;
  1569.     break;}
  1570. case 97:
  1571. #line 785 "./c-exp.y"
  1572. { yyval.tval = builtin_type_int; ;
  1573.     break;}
  1574. case 98:
  1575. #line 787 "./c-exp.y"
  1576. { yyval.tval = builtin_type_long; ;
  1577.     break;}
  1578. case 99:
  1579. #line 789 "./c-exp.y"
  1580. { yyval.tval = builtin_type_short; ;
  1581.     break;}
  1582. case 100:
  1583. #line 791 "./c-exp.y"
  1584. { yyval.tval = builtin_type_long; ;
  1585.     break;}
  1586. case 101:
  1587. #line 793 "./c-exp.y"
  1588. { yyval.tval = builtin_type_unsigned_long; ;
  1589.     break;}
  1590. case 102:
  1591. #line 795 "./c-exp.y"
  1592. { yyval.tval = builtin_type_long_long; ;
  1593.     break;}
  1594. case 103:
  1595. #line 797 "./c-exp.y"
  1596. { yyval.tval = builtin_type_long_long; ;
  1597.     break;}
  1598. case 104:
  1599. #line 799 "./c-exp.y"
  1600. { yyval.tval = builtin_type_unsigned_long_long; ;
  1601.     break;}
  1602. case 105:
  1603. #line 801 "./c-exp.y"
  1604. { yyval.tval = builtin_type_unsigned_long_long; ;
  1605.     break;}
  1606. case 106:
  1607. #line 803 "./c-exp.y"
  1608. { yyval.tval = builtin_type_short; ;
  1609.     break;}
  1610. case 107:
  1611. #line 805 "./c-exp.y"
  1612. { yyval.tval = builtin_type_unsigned_short; ;
  1613.     break;}
  1614. case 108:
  1615. #line 807 "./c-exp.y"
  1616. { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
  1617.                           expression_context_block); ;
  1618.     break;}
  1619. case 109:
  1620. #line 810 "./c-exp.y"
  1621. { yyval.tval = lookup_struct (copy_name (yyvsp[0].sval),
  1622.                           expression_context_block); ;
  1623.     break;}
  1624. case 110:
  1625. #line 813 "./c-exp.y"
  1626. { yyval.tval = lookup_union (copy_name (yyvsp[0].sval),
  1627.                          expression_context_block); ;
  1628.     break;}
  1629. case 111:
  1630. #line 816 "./c-exp.y"
  1631. { yyval.tval = lookup_enum (copy_name (yyvsp[0].sval),
  1632.                         expression_context_block); ;
  1633.     break;}
  1634. case 112:
  1635. #line 819 "./c-exp.y"
  1636. { yyval.tval = lookup_unsigned_typename (TYPE_NAME(yyvsp[0].tsym.type)); ;
  1637.     break;}
  1638. case 113:
  1639. #line 821 "./c-exp.y"
  1640. { yyval.tval = builtin_type_unsigned_int; ;
  1641.     break;}
  1642. case 114:
  1643. #line 823 "./c-exp.y"
  1644. { yyval.tval = lookup_signed_typename (TYPE_NAME(yyvsp[0].tsym.type)); ;
  1645.     break;}
  1646. case 115:
  1647. #line 825 "./c-exp.y"
  1648. { yyval.tval = builtin_type_int; ;
  1649.     break;}
  1650. case 116:
  1651. #line 827 "./c-exp.y"
  1652. { yyval.tval = lookup_template_type(copy_name(yyvsp[-3].sval), yyvsp[-1].tval,
  1653.                             expression_context_block);
  1654.             ;
  1655.     break;}
  1656. case 117:
  1657. #line 833 "./c-exp.y"
  1658. { yyval.tval = yyvsp[0].tval; ;
  1659.     break;}
  1660. case 118:
  1661. #line 834 "./c-exp.y"
  1662. { yyval.tval = yyvsp[0].tval; ;
  1663.     break;}
  1664. case 120:
  1665. #line 839 "./c-exp.y"
  1666. {
  1667.           yyval.tsym.stoken.ptr = "int";
  1668.           yyval.tsym.stoken.length = 3;
  1669.           yyval.tsym.type = builtin_type_int;
  1670.         ;
  1671.     break;}
  1672. case 121:
  1673. #line 845 "./c-exp.y"
  1674. {
  1675.           yyval.tsym.stoken.ptr = "long";
  1676.           yyval.tsym.stoken.length = 4;
  1677.           yyval.tsym.type = builtin_type_long;
  1678.         ;
  1679.     break;}
  1680. case 122:
  1681. #line 851 "./c-exp.y"
  1682. {
  1683.           yyval.tsym.stoken.ptr = "short";
  1684.           yyval.tsym.stoken.length = 5;
  1685.           yyval.tsym.type = builtin_type_short;
  1686.         ;
  1687.     break;}
  1688. case 123:
  1689. #line 860 "./c-exp.y"
  1690. { yyval.tvec = (struct type **) xmalloc (sizeof (struct type *) * 2);
  1691.           yyval.ivec[0] = 1;    /* Number of types in vector */
  1692.           yyval.tvec[1] = yyvsp[0].tval;
  1693.         ;
  1694.     break;}
  1695. case 124:
  1696. #line 865 "./c-exp.y"
  1697. { int len = sizeof (struct type *) * (++(yyvsp[-2].ivec[0]) + 1);
  1698.           yyval.tvec = (struct type **) xrealloc ((char *) yyvsp[-2].tvec, len);
  1699.           yyval.tvec[yyval.ivec[0]] = yyvsp[0].tval;
  1700.         ;
  1701.     break;}
  1702. case 125:
  1703. #line 871 "./c-exp.y"
  1704. { yyval.sval = yyvsp[0].ssym.stoken; ;
  1705.     break;}
  1706. case 126:
  1707. #line 872 "./c-exp.y"
  1708. { yyval.sval = yyvsp[0].ssym.stoken; ;
  1709.     break;}
  1710. case 127:
  1711. #line 873 "./c-exp.y"
  1712. { yyval.sval = yyvsp[0].tsym.stoken; ;
  1713.     break;}
  1714. case 128:
  1715. #line 874 "./c-exp.y"
  1716. { yyval.sval = yyvsp[0].ssym.stoken; ;
  1717.     break;}
  1718. }
  1719.    /* the action file gets copied in in place of this dollarsign */
  1720. #line 465 "/usr/unsupported/lib/bison.simple"
  1721.  
  1722.   yyvsp -= yylen;
  1723.   yyssp -= yylen;
  1724. #ifdef YYLSP_NEEDED
  1725.   yylsp -= yylen;
  1726. #endif
  1727.  
  1728. #if YYDEBUG != 0
  1729.   if (yydebug)
  1730.     {
  1731.       short *ssp1 = yyss - 1;
  1732.       fprintf (stderr, "state stack now");
  1733.       while (ssp1 != yyssp)
  1734.     fprintf (stderr, " %d", *++ssp1);
  1735.       fprintf (stderr, "\n");
  1736.     }
  1737. #endif
  1738.  
  1739.   *++yyvsp = yyval;
  1740.  
  1741. #ifdef YYLSP_NEEDED
  1742.   yylsp++;
  1743.   if (yylen == 0)
  1744.     {
  1745.       yylsp->first_line = yylloc.first_line;
  1746.       yylsp->first_column = yylloc.first_column;
  1747.       yylsp->last_line = (yylsp-1)->last_line;
  1748.       yylsp->last_column = (yylsp-1)->last_column;
  1749.       yylsp->text = 0;
  1750.     }
  1751.   else
  1752.     {
  1753.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1754.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1755.     }
  1756. #endif
  1757.  
  1758.   /* Now "shift" the result of the reduction.
  1759.      Determine what state that goes to,
  1760.      based on the state we popped back to
  1761.      and the rule number reduced by.  */
  1762.  
  1763.   yyn = yyr1[yyn];
  1764.  
  1765.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1766.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1767.     yystate = yytable[yystate];
  1768.   else
  1769.     yystate = yydefgoto[yyn - YYNTBASE];
  1770.  
  1771.   goto yynewstate;
  1772.  
  1773. yyerrlab:   /* here on detecting error */
  1774.  
  1775.   if (! yyerrstatus)
  1776.     /* If not already recovering from an error, report this error.  */
  1777.     {
  1778.       ++yynerrs;
  1779.  
  1780. #ifdef YYERROR_VERBOSE
  1781.       yyn = yypact[yystate];
  1782.  
  1783.       if (yyn > YYFLAG && yyn < YYLAST)
  1784.     {
  1785.       int size = 0;
  1786.       char *msg;
  1787.       int x, count;
  1788.  
  1789.       count = 0;
  1790.       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  1791.       for (x = (yyn < 0 ? -yyn : 0);
  1792.            x < (sizeof(yytname) / sizeof(char *)); x++)
  1793.         if (yycheck[x + yyn] == x)
  1794.           size += strlen(yytname[x]) + 15, count++;
  1795.       msg = (char *) xmalloc(size + 15);
  1796.       if (msg != 0)
  1797.         {
  1798.           strcpy(msg, "parse error");
  1799.  
  1800.           if (count < 5)
  1801.         {
  1802.           count = 0;
  1803.           for (x = (yyn < 0 ? -yyn : 0);
  1804.                x < (sizeof(yytname) / sizeof(char *)); x++)
  1805.             if (yycheck[x + yyn] == x)
  1806.               {
  1807.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1808.             strcat(msg, yytname[x]);
  1809.             strcat(msg, "'");
  1810.             count++;
  1811.               }
  1812.         }
  1813.           yyerror(msg);
  1814.           free(msg);
  1815.         }
  1816.       else
  1817.         yyerror ("parse error; also virtual memory exceeded");
  1818.     }
  1819.       else
  1820. #endif /* YYERROR_VERBOSE */
  1821.     yyerror("parse error");
  1822.     }
  1823.  
  1824.   goto yyerrlab1;
  1825. yyerrlab1:   /* here on error raised explicitly by an action */
  1826.  
  1827.   if (yyerrstatus == 3)
  1828.     {
  1829.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1830.  
  1831.       /* return failure if at end of input */
  1832.       if (yychar == YYEOF)
  1833.     YYABORT;
  1834.  
  1835. #if YYDEBUG != 0
  1836.       if (yydebug)
  1837.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1838. #endif
  1839.  
  1840.       yychar = YYEMPTY;
  1841.     }
  1842.  
  1843.   /* Else will try to reuse lookahead token
  1844.      after shifting the error token.  */
  1845.  
  1846.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1847.  
  1848.   goto yyerrhandle;
  1849.  
  1850. yyerrdefault:  /* current state does not do anything special for the error token. */
  1851.  
  1852. #if 0
  1853.   /* This is wrong; only states that explicitly want error tokens
  1854.      should shift them.  */
  1855.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1856.   if (yyn) goto yydefault;
  1857. #endif
  1858.  
  1859. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1860.  
  1861.   if (yyssp == yyss) YYABORT;
  1862.   yyvsp--;
  1863.   yystate = *--yyssp;
  1864. #ifdef YYLSP_NEEDED
  1865.   yylsp--;
  1866. #endif
  1867.  
  1868. #if YYDEBUG != 0
  1869.   if (yydebug)
  1870.     {
  1871.       short *ssp1 = yyss - 1;
  1872.       fprintf (stderr, "Error: state stack now");
  1873.       while (ssp1 != yyssp)
  1874.     fprintf (stderr, " %d", *++ssp1);
  1875.       fprintf (stderr, "\n");
  1876.     }
  1877. #endif
  1878.  
  1879. yyerrhandle:
  1880.  
  1881.   yyn = yypact[yystate];
  1882.   if (yyn == YYFLAG)
  1883.     goto yyerrdefault;
  1884.  
  1885.   yyn += YYTERROR;
  1886.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1887.     goto yyerrdefault;
  1888.  
  1889.   yyn = yytable[yyn];
  1890.   if (yyn < 0)
  1891.     {
  1892.       if (yyn == YYFLAG)
  1893.     goto yyerrpop;
  1894.       yyn = -yyn;
  1895.       goto yyreduce;
  1896.     }
  1897.   else if (yyn == 0)
  1898.     goto yyerrpop;
  1899.  
  1900.   if (yyn == YYFINAL)
  1901.     YYACCEPT;
  1902.  
  1903. #if YYDEBUG != 0
  1904.   if (yydebug)
  1905.     fprintf(stderr, "Shifting error token, ");
  1906. #endif
  1907.  
  1908.   *++yyvsp = yylval;
  1909. #ifdef YYLSP_NEEDED
  1910.   *++yylsp = yylloc;
  1911. #endif
  1912.  
  1913.   yystate = yyn;
  1914.   goto yynewstate;
  1915. }
  1916. #line 888 "./c-exp.y"
  1917.  
  1918.  
  1919. /* Take care of parsing a number (anything that starts with a digit).
  1920.    Set yylval and return the token type; update lexptr.
  1921.    LEN is the number of characters in it.  */
  1922.  
  1923. /*** Needs some error checking for the float case ***/
  1924.  
  1925. static int
  1926. parse_number (p, len, parsed_float, putithere)
  1927.      register char *p;
  1928.      register int len;
  1929.      int parsed_float;
  1930.      YYSTYPE *putithere;
  1931. {
  1932.   /* FIXME: Shouldn't these be unsigned?  We don't deal with negative values
  1933.      here, and we do kind of silly things like cast to unsigned.  */
  1934.   register LONGEST n = 0;
  1935.   register LONGEST prevn = 0;
  1936.   unsigned LONGEST un;
  1937.  
  1938.   register int i = 0;
  1939.   register int c;
  1940.   register int base = input_radix;
  1941.   int unsigned_p = 0;
  1942.  
  1943.   /* Number of "L" suffixes encountered.  */
  1944.   int long_p = 0;
  1945.  
  1946.   /* We have found a "L" or "U" suffix.  */
  1947.   int found_suffix = 0;
  1948.  
  1949.   unsigned LONGEST high_bit;
  1950.   struct type *signed_type;
  1951.   struct type *unsigned_type;
  1952.  
  1953.   if (parsed_float)
  1954.     {
  1955.       /* It's a float since it contains a point or an exponent.  */
  1956.       putithere->dval = atof (p);
  1957.       return FLOAT;
  1958.     }
  1959.  
  1960.   /* Handle base-switching prefixes 0x, 0t, 0d, 0 */
  1961.   if (p[0] == '0')
  1962.     switch (p[1])
  1963.       {
  1964.       case 'x':
  1965.       case 'X':
  1966.     if (len >= 3)
  1967.       {
  1968.         p += 2;
  1969.         base = 16;
  1970.         len -= 2;
  1971.       }
  1972.     break;
  1973.  
  1974.       case 't':
  1975.       case 'T':
  1976.       case 'd':
  1977.       case 'D':
  1978.     if (len >= 3)
  1979.       {
  1980.         p += 2;
  1981.         base = 10;
  1982.         len -= 2;
  1983.       }
  1984.     break;
  1985.  
  1986.       default:
  1987.     base = 8;
  1988.     break;
  1989.       }
  1990.  
  1991.   while (len-- > 0)
  1992.     {
  1993.       c = *p++;
  1994.       if (c >= 'A' && c <= 'Z')
  1995.     c += 'a' - 'A';
  1996.       if (c != 'l' && c != 'u')
  1997.     n *= base;
  1998.       if (c >= '0' && c <= '9')
  1999.     {
  2000.       if (found_suffix)
  2001.         return ERROR;
  2002.       n += i = c - '0';
  2003.     }
  2004.       else
  2005.     {
  2006.       if (base > 10 && c >= 'a' && c <= 'f')
  2007.         {
  2008.           if (found_suffix)
  2009.         return ERROR;
  2010.           n += i = c - 'a' + 10;
  2011.         }
  2012.       else if (c == 'l')
  2013.         {
  2014.           ++long_p;
  2015.           found_suffix = 1;
  2016.         }
  2017.       else if (c == 'u')
  2018.         {
  2019.           unsigned_p = 1;
  2020.           found_suffix = 1;
  2021.         }
  2022.       else
  2023.         return ERROR;    /* Char not a digit */
  2024.     }
  2025.       if (i >= base)
  2026.     return ERROR;        /* Invalid digit in this base */
  2027.  
  2028.       /* Portably test for overflow (only works for nonzero values, so make
  2029.      a second check for zero).  FIXME: Can't we just make n and prevn
  2030.      unsigned and avoid this?  */
  2031.       if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
  2032.     unsigned_p = 1;        /* Try something unsigned */
  2033.  
  2034.       /* Portably test for unsigned overflow.
  2035.      FIXME: This check is wrong; for example it doesn't find overflow
  2036.      on 0x123456789 when LONGEST is 32 bits.  */
  2037.       if (c != 'l' && c != 'u' && n != 0)
  2038.     {    
  2039.       if ((unsigned_p && (unsigned LONGEST) prevn >= (unsigned LONGEST) n))
  2040.         error ("Numeric constant too large.");
  2041.     }
  2042.       prevn = n;
  2043.     }
  2044.  
  2045.   /* An integer constant is an int, a long, or a long long.  An L
  2046.      suffix forces it to be long; an LL suffix forces it to be long
  2047.      long.  If not forced to a larger size, it gets the first type of
  2048.      the above that it fits in.  To figure out whether it fits, we
  2049.      shift it right and see whether anything remains.  Note that we
  2050.      can't shift sizeof (LONGEST) * HOST_CHAR_BIT bits or more in one
  2051.      operation, because many compilers will warn about such a shift
  2052.      (which always produces a zero result).  Sometimes TARGET_INT_BIT
  2053.      or TARGET_LONG_BIT will be that big, sometimes not.  To deal with
  2054.      the case where it is we just always shift the value more than
  2055.      once, with fewer bits each time.  */
  2056.  
  2057.   un = (unsigned LONGEST)n >> 2;
  2058.   if (long_p == 0
  2059.       && (un >> (TARGET_INT_BIT - 2)) == 0)
  2060.     {
  2061.       high_bit = ((unsigned LONGEST)1) << (TARGET_INT_BIT-1);
  2062.  
  2063.       /* A large decimal (not hex or octal) constant (between INT_MAX
  2064.      and UINT_MAX) is a long or unsigned long, according to ANSI,
  2065.      never an unsigned int, but this code treats it as unsigned
  2066.      int.  This probably should be fixed.  GCC gives a warning on
  2067.      such constants.  */
  2068.  
  2069.       unsigned_type = builtin_type_unsigned_int;
  2070.       signed_type = builtin_type_int;
  2071.     }
  2072.   else if (long_p <= 1
  2073.        && (un >> (TARGET_LONG_BIT - 2)) == 0)
  2074.     {
  2075.       high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_BIT-1);
  2076.       unsigned_type = builtin_type_unsigned_long;
  2077.       signed_type = builtin_type_long;
  2078.     }
  2079.   else
  2080.     {
  2081.       high_bit = (((unsigned LONGEST)1)
  2082.           << (TARGET_LONG_LONG_BIT - 32 - 1)
  2083.           << 16
  2084.           << 16);
  2085.       if (high_bit == 0)
  2086.     /* A long long does not fit in a LONGEST.  */
  2087.     high_bit =
  2088.       (unsigned LONGEST)1 << (sizeof (LONGEST) * HOST_CHAR_BIT - 1);
  2089.       unsigned_type = builtin_type_unsigned_long_long;
  2090.       signed_type = builtin_type_long_long;
  2091.     }
  2092.  
  2093.    putithere->typed_val.val = n;
  2094.  
  2095.    /* If the high bit of the worked out type is set then this number
  2096.       has to be unsigned. */
  2097.  
  2098.    if (unsigned_p || (n & high_bit)) 
  2099.      {
  2100.        putithere->typed_val.type = unsigned_type;
  2101.      }
  2102.    else 
  2103.      {
  2104.        putithere->typed_val.type = signed_type;
  2105.      }
  2106.  
  2107.    return INT;
  2108. }
  2109.  
  2110. struct token
  2111. {
  2112.   char *operator;
  2113.   int token;
  2114.   enum exp_opcode opcode;
  2115. };
  2116.  
  2117. static const struct token tokentab3[] =
  2118.   {
  2119.     {">>=", ASSIGN_MODIFY, BINOP_RSH},
  2120.     {"<<=", ASSIGN_MODIFY, BINOP_LSH}
  2121.   };
  2122.  
  2123. static const struct token tokentab2[] =
  2124.   {
  2125.     {"+=", ASSIGN_MODIFY, BINOP_ADD},
  2126.     {"-=", ASSIGN_MODIFY, BINOP_SUB},
  2127.     {"*=", ASSIGN_MODIFY, BINOP_MUL},
  2128.     {"/=", ASSIGN_MODIFY, BINOP_DIV},
  2129.     {"%=", ASSIGN_MODIFY, BINOP_REM},
  2130.     {"|=", ASSIGN_MODIFY, BINOP_BITWISE_IOR},
  2131.     {"&=", ASSIGN_MODIFY, BINOP_BITWISE_AND},
  2132.     {"^=", ASSIGN_MODIFY, BINOP_BITWISE_XOR},
  2133.     {"++", INCREMENT, BINOP_END},
  2134.     {"--", DECREMENT, BINOP_END},
  2135.     {"->", ARROW, BINOP_END},
  2136.     {"&&", ANDAND, BINOP_END},
  2137.     {"||", OROR, BINOP_END},
  2138.     {"::", COLONCOLON, BINOP_END},
  2139.     {"<<", LSH, BINOP_END},
  2140.     {">>", RSH, BINOP_END},
  2141.     {"==", EQUAL, BINOP_END},
  2142.     {"!=", NOTEQUAL, BINOP_END},
  2143.     {"<=", LEQ, BINOP_END},
  2144.     {">=", GEQ, BINOP_END}
  2145.   };
  2146.  
  2147. /* Read one token, getting characters through lexptr.  */
  2148.  
  2149. static int
  2150. yylex ()
  2151. {
  2152.   int c;
  2153.   int namelen;
  2154.   unsigned int i;
  2155.   char *tokstart;
  2156.   char *tokptr;
  2157.   int tempbufindex;
  2158.   static char *tempbuf;
  2159.   static int tempbufsize;
  2160.   
  2161.  retry:
  2162.  
  2163.   tokstart = lexptr;
  2164.   /* See if it is a special token of length 3.  */
  2165.   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
  2166.     if (STREQN (tokstart, tokentab3[i].operator, 3))
  2167.       {
  2168.     lexptr += 3;
  2169.     yylval.opcode = tokentab3[i].opcode;
  2170.     return tokentab3[i].token;
  2171.       }
  2172.  
  2173.   /* See if it is a special token of length 2.  */
  2174.   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
  2175.     if (STREQN (tokstart, tokentab2[i].operator, 2))
  2176.       {
  2177.     lexptr += 2;
  2178.     yylval.opcode = tokentab2[i].opcode;
  2179.     return tokentab2[i].token;
  2180.       }
  2181.  
  2182.   switch (c = *tokstart)
  2183.     {
  2184.     case 0:
  2185.       return 0;
  2186.  
  2187.     case ' ':
  2188.     case '\t':
  2189.     case '\n':
  2190.       lexptr++;
  2191.       goto retry;
  2192.  
  2193.     case '\'':
  2194.       /* We either have a character constant ('0' or '\177' for example)
  2195.      or we have a quoted symbol reference ('foo(int,int)' in C++
  2196.      for example). */
  2197.       lexptr++;
  2198.       c = *lexptr++;
  2199.       if (c == '\\')
  2200.     c = parse_escape (&lexptr);
  2201.  
  2202.       yylval.typed_val.val = c;
  2203.       yylval.typed_val.type = builtin_type_char;
  2204.  
  2205.       c = *lexptr++;
  2206.       if (c != '\'')
  2207.     {
  2208.       namelen = skip_quoted (tokstart) - tokstart;
  2209.       if (namelen > 2)
  2210.         {
  2211.           lexptr = tokstart + namelen;
  2212.           if (lexptr[-1] != '\'')
  2213.         error ("Unmatched single quote.");
  2214.           namelen -= 2;
  2215.           tokstart++;
  2216.           goto tryname;
  2217.         }
  2218.       error ("Invalid character constant.");
  2219.     }
  2220.       return INT;
  2221.  
  2222.     case '(':
  2223.       paren_depth++;
  2224.       lexptr++;
  2225.       return c;
  2226.  
  2227.     case ')':
  2228.       if (paren_depth == 0)
  2229.     return 0;
  2230.       paren_depth--;
  2231.       lexptr++;
  2232.       return c;
  2233.  
  2234.     case ',':
  2235.       if (comma_terminates && paren_depth == 0)
  2236.     return 0;
  2237.       lexptr++;
  2238.       return c;
  2239.  
  2240.     case '.':
  2241.       /* Might be a floating point number.  */
  2242.       if (lexptr[1] < '0' || lexptr[1] > '9')
  2243.     goto symbol;        /* Nope, must be a symbol. */
  2244.       /* FALL THRU into number case.  */
  2245.  
  2246.     case '0':
  2247.     case '1':
  2248.     case '2':
  2249.     case '3':
  2250.     case '4':
  2251.     case '5':
  2252.     case '6':
  2253.     case '7':
  2254.     case '8':
  2255.     case '9':
  2256.       {
  2257.     /* It's a number.  */
  2258.     int got_dot = 0, got_e = 0, toktype;
  2259.     register char *p = tokstart;
  2260.     int hex = input_radix > 10;
  2261.  
  2262.     if (c == '0' && (p[1] == 'x' || p[1] == 'X'))
  2263.       {
  2264.         p += 2;
  2265.         hex = 1;
  2266.       }
  2267.     else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
  2268.       {
  2269.         p += 2;
  2270.         hex = 0;
  2271.       }
  2272.  
  2273.     for (;; ++p)
  2274.       {
  2275.         /* This test includes !hex because 'e' is a valid hex digit
  2276.            and thus does not indicate a floating point number when
  2277.            the radix is hex.  */
  2278.         if (!hex && !got_e && (*p == 'e' || *p == 'E'))
  2279.           got_dot = got_e = 1;
  2280.         /* This test does not include !hex, because a '.' always indicates
  2281.            a decimal floating point number regardless of the radix.  */
  2282.         else if (!got_dot && *p == '.')
  2283.           got_dot = 1;
  2284.         else if (got_e && (p[-1] == 'e' || p[-1] == 'E')
  2285.              && (*p == '-' || *p == '+'))
  2286.           /* This is the sign of the exponent, not the end of the
  2287.          number.  */
  2288.           continue;
  2289.         /* We will take any letters or digits.  parse_number will
  2290.            complain if past the radix, or if L or U are not final.  */
  2291.         else if ((*p < '0' || *p > '9')
  2292.              && ((*p < 'a' || *p > 'z')
  2293.                   && (*p < 'A' || *p > 'Z')))
  2294.           break;
  2295.       }
  2296.     toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
  2297.         if (toktype == ERROR)
  2298.       {
  2299.         char *err_copy = (char *) alloca (p - tokstart + 1);
  2300.  
  2301.         memcpy (err_copy, tokstart, p - tokstart);
  2302.         err_copy[p - tokstart] = 0;
  2303.         error ("Invalid number \"%s\".", err_copy);
  2304.       }
  2305.     lexptr = p;
  2306.     return toktype;
  2307.       }
  2308.  
  2309.     case '+':
  2310.     case '-':
  2311.     case '*':
  2312.     case '/':
  2313.     case '%':
  2314.     case '|':
  2315.     case '&':
  2316.     case '^':
  2317.     case '~':
  2318.     case '!':
  2319.     case '@':
  2320.     case '<':
  2321.     case '>':
  2322.     case '[':
  2323.     case ']':
  2324.     case '?':
  2325.     case ':':
  2326.     case '=':
  2327.     case '{':
  2328.     case '}':
  2329.     symbol:
  2330.       lexptr++;
  2331.       return c;
  2332.  
  2333.     case '"':
  2334.  
  2335.       /* Build the gdb internal form of the input string in tempbuf,
  2336.      translating any standard C escape forms seen.  Note that the
  2337.      buffer is null byte terminated *only* for the convenience of
  2338.      debugging gdb itself and printing the buffer contents when
  2339.      the buffer contains no embedded nulls.  Gdb does not depend
  2340.      upon the buffer being null byte terminated, it uses the length
  2341.      string instead.  This allows gdb to handle C strings (as well
  2342.      as strings in other languages) with embedded null bytes */
  2343.  
  2344.       tokptr = ++tokstart;
  2345.       tempbufindex = 0;
  2346.  
  2347.       do {
  2348.     /* Grow the static temp buffer if necessary, including allocating
  2349.        the first one on demand. */
  2350.     if (tempbufindex + 1 >= tempbufsize)
  2351.       {
  2352.         tempbuf = (char *) xrealloc (tempbuf, tempbufsize += 64);
  2353.       }
  2354.     switch (*tokptr)
  2355.       {
  2356.       case '\0':
  2357.       case '"':
  2358.         /* Do nothing, loop will terminate. */
  2359.         break;
  2360.       case '\\':
  2361.         tokptr++;
  2362.         c = parse_escape (&tokptr);
  2363.         if (c == -1)
  2364.           {
  2365.         continue;
  2366.           }
  2367.         tempbuf[tempbufindex++] = c;
  2368.         break;
  2369.       default:
  2370.         tempbuf[tempbufindex++] = *tokptr++;
  2371.         break;
  2372.       }
  2373.       } while ((*tokptr != '"') && (*tokptr != '\0'));
  2374.       if (*tokptr++ != '"')
  2375.     {
  2376.       error ("Unterminated string in expression.");
  2377.     }
  2378.       tempbuf[tempbufindex] = '\0';    /* See note above */
  2379.       yylval.sval.ptr = tempbuf;
  2380.       yylval.sval.length = tempbufindex;
  2381.       lexptr = tokptr;
  2382.       return (STRING);
  2383.     }
  2384.  
  2385.   if (!(c == '_' || c == '$'
  2386.     || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
  2387.     /* We must have come across a bad character (e.g. ';').  */
  2388.     error ("Invalid character '%c' in expression.", c);
  2389.  
  2390.   /* It's a name.  See how long it is.  */
  2391.   namelen = 0;
  2392.   for (c = tokstart[namelen];
  2393.        (c == '_' || c == '$' || (c >= '0' && c <= '9')
  2394.     || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '<');)
  2395.     {
  2396.        if (c == '<')
  2397.      {
  2398.        int i = namelen;
  2399.        while (tokstart[++i] && tokstart[i] != '>');
  2400.        if (tokstart[i] == '>')
  2401.          namelen = i;
  2402.       }
  2403.        c = tokstart[++namelen];
  2404.      }
  2405.  
  2406.   /* The token "if" terminates the expression and is NOT 
  2407.      removed from the input stream.  */
  2408.   if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
  2409.     {
  2410.       return 0;
  2411.     }
  2412.  
  2413.   lexptr += namelen;
  2414.  
  2415.   /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1)
  2416.      and $$digits (equivalent to $<-digits> if you could type that).
  2417.      Make token type LAST, and put the number (the digits) in yylval.  */
  2418.  
  2419.   tryname:
  2420.   if (*tokstart == '$')
  2421.     {
  2422.       register int negate = 0;
  2423.       c = 1;
  2424.       /* Double dollar means negate the number and add -1 as well.
  2425.      Thus $$ alone means -1.  */
  2426.       if (namelen >= 2 && tokstart[1] == '$')
  2427.     {
  2428.       negate = 1;
  2429.       c = 2;
  2430.     }
  2431.       if (c == namelen)
  2432.     {
  2433.       /* Just dollars (one or two) */
  2434.       yylval.lval = - negate;
  2435.       return LAST;
  2436.     }
  2437.       /* Is the rest of the token digits?  */
  2438.       for (; c < namelen; c++)
  2439.     if (!(tokstart[c] >= '0' && tokstart[c] <= '9'))
  2440.       break;
  2441.       if (c == namelen)
  2442.     {
  2443.       yylval.lval = atoi (tokstart + 1 + negate);
  2444.       if (negate)
  2445.         yylval.lval = - yylval.lval;
  2446.       return LAST;
  2447.     }
  2448.     }
  2449.  
  2450.   /* Handle tokens that refer to machine registers:
  2451.      $ followed by a register name.  */
  2452.  
  2453.   if (*tokstart == '$') {
  2454.     for (c = 0; c < NUM_REGS; c++)
  2455.       if (namelen - 1 == strlen (reg_names[c])
  2456.       && STREQN (tokstart + 1, reg_names[c], namelen - 1))
  2457.     {
  2458.       yylval.lval = c;
  2459.       return REGNAME;
  2460.     }
  2461.     for (c = 0; c < num_std_regs; c++)
  2462.      if (namelen - 1 == strlen (std_regs[c].name)
  2463.      && STREQN (tokstart + 1, std_regs[c].name, namelen - 1))
  2464.        {
  2465.      yylval.lval = std_regs[c].regnum;
  2466.      return REGNAME;
  2467.        }
  2468.   }
  2469.   /* Catch specific keywords.  Should be done with a data structure.  */
  2470.   switch (namelen)
  2471.     {
  2472.     case 8:
  2473.       if (STREQN (tokstart, "unsigned", 8))
  2474.     return UNSIGNED;
  2475.       if (current_language->la_language == language_cplus
  2476.       && STREQN (tokstart, "template", 8))
  2477.     return TEMPLATE;
  2478.       if (STREQN (tokstart, "volatile", 8))
  2479.     return VOLATILE_KEYWORD;
  2480.       break;
  2481.     case 6:
  2482.       if (STREQN (tokstart, "struct", 6))
  2483.     return STRUCT;
  2484.       if (STREQN (tokstart, "signed", 6))
  2485.     return SIGNED_KEYWORD;
  2486.       if (STREQN (tokstart, "sizeof", 6))      
  2487.     return SIZEOF;
  2488.       break;
  2489.     case 5:
  2490.       if (current_language->la_language == language_cplus
  2491.       && STREQN (tokstart, "class", 5))
  2492.     return CLASS;
  2493.       if (STREQN (tokstart, "union", 5))
  2494.     return UNION;
  2495.       if (STREQN (tokstart, "short", 5))
  2496.     return SHORT;
  2497.       if (STREQN (tokstart, "const", 5))
  2498.     return CONST_KEYWORD;
  2499.       break;
  2500.     case 4:
  2501.       if (STREQN (tokstart, "enum", 4))
  2502.     return ENUM;
  2503.       if (STREQN (tokstart, "long", 4))
  2504.     return LONG;
  2505.       if (current_language->la_language == language_cplus
  2506.       && STREQN (tokstart, "this", 4))
  2507.     {
  2508.       static const char this_name[] =
  2509.                  { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
  2510.  
  2511.       if (lookup_symbol (this_name, expression_context_block,
  2512.                  VAR_NAMESPACE, (int *) NULL,
  2513.                  (struct symtab **) NULL))
  2514.         return THIS;
  2515.     }
  2516.       break;
  2517.     case 3:
  2518.       if (STREQN (tokstart, "int", 3))
  2519.     return INT_KEYWORD;
  2520.       break;
  2521.     default:
  2522.       break;
  2523.     }
  2524.  
  2525.   yylval.sval.ptr = tokstart;
  2526.   yylval.sval.length = namelen;
  2527.  
  2528.   /* Any other names starting in $ are debugger internal variables.  */
  2529.  
  2530.   if (*tokstart == '$')
  2531.     {
  2532.       yylval.ivar =  lookup_internalvar (copy_name (yylval.sval) + 1);
  2533.       return VARIABLE;
  2534.     }
  2535.  
  2536.   /* Use token-type BLOCKNAME for symbols that happen to be defined as
  2537.      functions or symtabs.  If this is not so, then ...
  2538.      Use token-type TYPENAME for symbols that happen to be defined
  2539.      currently as names of types; NAME for other symbols.
  2540.      The caller is not constrained to care about the distinction.  */
  2541.   {
  2542.     char *tmp = copy_name (yylval.sval);
  2543.     struct symbol *sym;
  2544.     int is_a_field_of_this = 0;
  2545.     int hextype;
  2546.  
  2547.     sym = lookup_symbol (tmp, expression_context_block,
  2548.              VAR_NAMESPACE,
  2549.              current_language->la_language == language_cplus
  2550.              ? &is_a_field_of_this : (int *) NULL,
  2551.              (struct symtab **) NULL);
  2552.     /* Call lookup_symtab, not lookup_partial_symtab, in case there are
  2553.        no psymtabs (coff, xcoff, or some future change to blow away the
  2554.        psymtabs once once symbols are read).  */
  2555.     if ((sym && SYMBOL_CLASS (sym) == LOC_BLOCK) ||
  2556.         lookup_symtab (tmp))
  2557.       {
  2558.     yylval.ssym.sym = sym;
  2559.     yylval.ssym.is_a_field_of_this = is_a_field_of_this;
  2560.     return BLOCKNAME;
  2561.       }
  2562.     if (sym && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
  2563.         {
  2564. #if 1
  2565.       /* Despite the following flaw, we need to keep this code enabled.
  2566.          Because we can get called from check_stub_method, if we don't
  2567.          handle nested types then it screws many operations in any
  2568.          program which uses nested types.  */
  2569.       /* In "A::x", if x is a member function of A and there happens
  2570.          to be a type (nested or not, since the stabs don't make that
  2571.          distinction) named x, then this code incorrectly thinks we
  2572.          are dealing with nested types rather than a member function.  */
  2573.  
  2574.       char *p;
  2575.       char *namestart;
  2576.       struct symbol *best_sym;
  2577.  
  2578.       /* Look ahead to detect nested types.  This probably should be
  2579.          done in the grammar, but trying seemed to introduce a lot
  2580.          of shift/reduce and reduce/reduce conflicts.  It's possible
  2581.          that it could be done, though.  Or perhaps a non-grammar, but
  2582.          less ad hoc, approach would work well.  */
  2583.  
  2584.       /* Since we do not currently have any way of distinguishing
  2585.          a nested type from a non-nested one (the stabs don't tell
  2586.          us whether a type is nested), we just ignore the
  2587.          containing type.  */
  2588.  
  2589.       p = lexptr;
  2590.       best_sym = sym;
  2591.       while (1)
  2592.         {
  2593.           /* Skip whitespace.  */
  2594.           while (*p == ' ' || *p == '\t' || *p == '\n')
  2595.         ++p;
  2596.           if (*p == ':' && p[1] == ':')
  2597.         {
  2598.           /* Skip the `::'.  */
  2599.           p += 2;
  2600.           /* Skip whitespace.  */
  2601.           while (*p == ' ' || *p == '\t' || *p == '\n')
  2602.             ++p;
  2603.           namestart = p;
  2604.           while (*p == '_' || *p == '$' || (*p >= '0' && *p <= '9')
  2605.              || (*p >= 'a' && *p <= 'z')
  2606.              || (*p >= 'A' && *p <= 'Z'))
  2607.             ++p;
  2608.           if (p != namestart)
  2609.             {
  2610.               struct symbol *cur_sym;
  2611.               /* As big as the whole rest of the expression, which is
  2612.              at least big enough.  */
  2613.               char *ncopy = alloca (strlen (tmp)+strlen (namestart)+3);
  2614.               char *tmp1;
  2615.  
  2616.               tmp1 = ncopy;
  2617.               memcpy (tmp1, tmp, strlen (tmp));
  2618.               tmp1 += strlen (tmp);
  2619.               memcpy (tmp1, "::", 2);
  2620.               tmp1 += 2;
  2621.               memcpy (tmp1, namestart, p - namestart);
  2622.               tmp1[p - namestart] = '\0';
  2623.               cur_sym = lookup_symbol (ncopy, expression_context_block,
  2624.                            VAR_NAMESPACE, (int *) NULL,
  2625.                            (struct symtab **) NULL);
  2626.               if (cur_sym)
  2627.             {
  2628.               if (SYMBOL_CLASS (cur_sym) == LOC_TYPEDEF)
  2629.                 {
  2630.                   best_sym = cur_sym;
  2631.                   lexptr = p;
  2632.                 }
  2633.               else
  2634.                 break;
  2635.             }
  2636.               else
  2637.             break;
  2638.             }
  2639.           else
  2640.             break;
  2641.         }
  2642.           else
  2643.         break;
  2644.         }
  2645.  
  2646.       yylval.tsym.type = SYMBOL_TYPE (best_sym);
  2647. #else /* not 0 */
  2648.       yylval.tsym.type = SYMBOL_TYPE (sym);
  2649. #endif /* not 0 */
  2650.       return TYPENAME;
  2651.         }
  2652.     if ((yylval.tsym.type = lookup_primitive_typename (tmp)) != 0)
  2653.     return TYPENAME;
  2654.  
  2655.     /* Input names that aren't symbols but ARE valid hex numbers,
  2656.        when the input radix permits them, can be names or numbers
  2657.        depending on the parse.  Note we support radixes > 16 here.  */
  2658.     if (!sym && 
  2659.         ((tokstart[0] >= 'a' && tokstart[0] < 'a' + input_radix - 10) ||
  2660.          (tokstart[0] >= 'A' && tokstart[0] < 'A' + input_radix - 10)))
  2661.       {
  2662.      YYSTYPE newlval;    /* Its value is ignored.  */
  2663.     hextype = parse_number (tokstart, namelen, 0, &newlval);
  2664.     if (hextype == INT)
  2665.       {
  2666.         yylval.ssym.sym = sym;
  2667.         yylval.ssym.is_a_field_of_this = is_a_field_of_this;
  2668.         return NAME_OR_INT;
  2669.       }
  2670.       }
  2671.  
  2672.     /* Any other kind of symbol */
  2673.     yylval.ssym.sym = sym;
  2674.     yylval.ssym.is_a_field_of_this = is_a_field_of_this;
  2675.     return NAME;
  2676.   }
  2677. }
  2678.  
  2679. void
  2680. yyerror (msg)
  2681.      char *msg;
  2682. {
  2683.   error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
  2684. }
  2685.