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