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

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