home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc2 / Src / web2c / c / Y_tab < prev   
Text File  |  1993-02-14  |  79KB  |  2,535 lines

  1.  
  2. /*  A Bison parser, made from web2c.yacc  */
  3.  
  4. #define YYBISON 1  /* Identify Bison output.  */
  5.  
  6. #define    array_tok    258
  7. #define    begin_tok    259
  8. #define    case_tok    260
  9. #define    const_tok    261
  10. #define    do_tok    262
  11. #define    downto_tok    263
  12. #define    else_tok    264
  13. #define    end_tok    265
  14. #define    file_tok    266
  15. #define    for_tok    267
  16. #define    function_tok    268
  17. #define    goto_tok    269
  18. #define    if_tok    270
  19. #define    label_tok    271
  20. #define    of_tok    272
  21. #define    procedure_tok    273
  22. #define    program_tok    274
  23. #define    record_tok    275
  24. #define    repeat_tok    276
  25. #define    then_tok    277
  26. #define    to_tok    278
  27. #define    type_tok    279
  28. #define    until_tok    280
  29. #define    var_tok    281
  30. #define    while_tok    282
  31. #define    others_tok    283
  32. #define    r_num_tok    284
  33. #define    i_num_tok    285
  34. #define    string_literal_tok    286
  35. #define    single_char_tok    287
  36. #define    assign_tok    288
  37. #define    two_dots_tok    289
  38. #define    undef_id_tok    290
  39. #define    var_id_tok    291
  40. #define    proc_id_tok    292
  41. #define    proc_param_tok    293
  42. #define    fun_id_tok    294
  43. #define    fun_param_tok    295
  44. #define    const_id_tok    296
  45. #define    type_id_tok    297
  46. #define    hhb0_tok    298
  47. #define    hhb1_tok    299
  48. #define    field_id_tok    300
  49. #define    define_tok    301
  50. #define    field_tok    302
  51. #define    break_tok    303
  52. #define    not_eq_tok    304
  53. #define    less_eq_tok    305
  54. #define    great_eq_tok    306
  55. #define    or_tok    307
  56. #define    unary_plus_tok    308
  57. #define    unary_minus_tok    309
  58. #define    div_tok    310
  59. #define    mod_tok    311
  60. #define    and_tok    312
  61. #define    not_tok    313
  62.  
  63. #line 19 "web2c.yacc"
  64.  
  65. #include "web2c.h"
  66.  
  67. #define YYDEBUG 1
  68.  
  69. #define    symbol(x)    sym_table[x].id
  70. #define    MAX_ARGS    50
  71.  
  72. static char fn_return_type[50], for_stack[300], control_var[50],
  73.             relation[3];
  74. static char arg_type[MAX_ARGS][30];
  75. static int last_type = -1, ids_typed;
  76. char my_routine[100];    /* Name of routine being parsed, if any */
  77. static char array_bounds[80], array_offset[80];
  78. static int uses_mem, uses_eqtb, lower_sym, upper_sym;
  79. static FILE *orig_std;
  80. boolean doing_statements = false;
  81. static boolean var_formals = false;
  82. static int param_id_list[MAX_ARGS], ids_paramed=0;
  83.  
  84. extern char conditional[], temp[], *std_header;
  85. extern int tex, mf, strict_for;
  86. extern FILE *coerce;
  87. extern char coerce_name[];
  88. extern boolean debug;
  89.  
  90. static long my_labs();
  91. static void compute_array_bounds(), fixup_var_list();
  92. static void do_proc_args(), gen_function_head();
  93. static boolean doreturn();
  94.  
  95.  
  96. #ifndef YYLTYPE
  97. typedef
  98.   struct yyltype
  99.     {
  100.       int timestamp;
  101.       int first_line;
  102.       int first_column;
  103.       int last_line;
  104.       int last_column;
  105.       char *text;
  106.    }
  107.   yyltype;
  108.  
  109. #define YYLTYPE yyltype
  110. #endif
  111.  
  112. #ifndef YYSTYPE
  113. #define YYSTYPE int
  114. #endif
  115. #include <stdio.h>
  116.  
  117. #ifndef __STDC__
  118. #define const
  119. #endif
  120.  
  121.  
  122.  
  123. #define    YYFINAL        417
  124. #define    YYFLAG        -32768
  125. #define    YYNTBASE    75
  126.  
  127. #define YYTRANSLATE(x) ((unsigned)(x) <= 313 ? yytranslate[x] : 239)
  128.  
  129. static const char yytranslate[] = {     0,
  130.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,    67,
  134.     68,    60,    55,    69,    56,    74,    61,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,    73,    66,    51,
  136.     49,    52,     2,     2,     2,     2,     2,     2,     2,     2,
  137.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  138.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  139.     71,     2,    72,    70,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  142.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  143.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  144.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  145.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  146.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  147.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  148.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  149.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  150.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  151.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  152.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  153.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  154.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  155.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  156.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  157.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  158.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  159.     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  160.     46,    47,    48,    50,    53,    54,    57,    58,    59,    62,
  161.     63,    64,    65
  162. };
  163.  
  164. #if YYDEBUG != 0
  165. static const short yyprhs[] = {     0,
  166.      0,     1,     2,    13,    14,    17,    22,    27,    32,    39,
  167.     44,    51,    56,    63,    68,    72,    73,    74,    75,    84,
  168.     85,    86,    91,    93,    97,    99,   100,   103,   105,   108,
  169.    109,   110,   117,   119,   121,   123,   125,   127,   129,   131,
  170.    132,   135,   137,   140,   141,   142,   143,   151,   153,   155,
  171.    157,   159,   163,   164,   166,   169,   171,   173,   175,   177,
  172.    179,   181,   184,   191,   200,   202,   204,   206,   207,   212,
  173.    214,   218,   219,   220,   226,   227,   229,   233,   235,   237,
  174.    238,   243,   244,   247,   249,   252,   253,   254,   261,   263,
  175.    267,   269,   271,   273,   274,   275,   281,   282,   284,   287,
  176.    290,   293,   296,   297,   303,   304,   310,   311,   312,   317,
  177.    319,   323,   324,   329,   330,   333,   334,   338,   340,   342,
  178.    345,   346,   347,   348,   358,   359,   360,   361,   371,   373,
  179.    375,   377,   381,   382,   387,   389,   393,   395,   399,   401,
  180.    403,   405,   407,   409,   411,   413,   415,   416,   421,   422,
  181.    427,   428,   432,   434,   436,   438,   440,   443,   444,   449,
  182.    452,   455,   458,   460,   461,   466,   469,   470,   475,   476,
  183.    481,   482,   487,   488,   493,   494,   499,   500,   505,   506,
  184.    511,   512,   517,   518,   523,   524,   529,   530,   535,   536,
  185.    541,   542,   547,   548,   553,   555,   557,   559,   561,   562,
  186.    567,   569,   571,   573,   574,   578,   579,   584,   586,   587,
  187.    592,   595,   598,   599,   601,   603,   604,   608,   611,   612,
  188.    614,   616,   618,   620,   622,   624,   627,   628,   629,   636,
  189.    637,   641,   642,   643,   651,   653,   657,   661,   663,   667,
  190.    669,   671,   673,   676,   678,   680,   682,   683,   684,   691,
  191.    692,   693,   700,   701,   702,   703,   713,   715,   716,   717,
  192.    723,   724,   725
  193. };
  194.  
  195. #endif
  196.  
  197. static const short yyrhs[] = {    -1,
  198.      0,    78,    80,    76,    85,    89,    97,   124,    77,   133,
  199.    131,     0,     0,    78,    79,     0,    46,    47,    35,    66,
  200.      0,    46,    13,    35,    66,     0,    46,     6,    35,    66,
  201.      0,    46,    13,    35,    67,    68,    66,     0,    46,    18,
  202.     35,    66,     0,    46,    18,    35,    67,    68,    66,     0,
  203.     46,    24,    35,    66,     0,    46,    24,    35,    49,   105,
  204.     66,     0,    46,    26,    35,    66,     0,    19,    35,    66,
  205.      0,     0,     0,     0,    82,    85,    89,    97,    83,   124,
  206.     84,   158,     0,     0,     0,    16,    86,    87,    66,     0,
  207.     88,     0,    87,    69,    88,     0,    30,     0,     0,     6,
  208.     90,     0,    91,     0,    90,    91,     0,     0,     0,    92,
  209.     35,    93,    49,    94,    66,     0,    30,     0,    29,     0,
  210.     95,     0,    96,     0,    31,     0,    32,     0,    41,     0,
  211.      0,    24,    98,     0,    99,     0,    98,    99,     0,     0,
  212.      0,     0,   100,    35,   101,    49,   102,   103,    66,     0,
  213.    104,     0,   109,     0,   105,     0,   108,     0,   107,    34,
  214.    107,     0,     0,    58,     0,   106,    30,     0,    41,     0,
  215.     42,     0,   111,     0,   114,     0,   122,     0,   110,     0,
  216.     70,    42,     0,     3,    71,   112,    72,    17,   113,     0,
  217.      3,    71,   112,    69,   112,    72,    17,   113,     0,   105,
  218.      0,    42,     0,   103,     0,     0,    20,   115,   116,    10,
  219.      0,   117,     0,   116,    66,   117,     0,     0,     0,   118,
  220.    120,    73,   119,   103,     0,     0,   121,     0,   120,    69,
  221.    121,     0,    35,     0,    45,     0,     0,    11,    17,   123,
  222.    103,     0,     0,    26,   125,     0,   126,     0,   125,   126,
  223.      0,     0,     0,   127,   129,    73,   128,   103,    66,     0,
  224.    130,     0,   129,    69,   130,     0,    35,     0,    36,     0,
  225.     45,     0,     0,     0,     4,   132,   161,    10,    74,     0,
  226.      0,   134,     0,   133,   134,     0,   135,    66,     0,   148,
  227.     66,     0,   136,    81,     0,     0,    18,    35,   137,   139,
  228.     66,     0,     0,    18,   147,   138,   139,    66,     0,     0,
  229.      0,    67,   140,   141,    68,     0,   144,     0,   141,    66,
  230.    144,     0,     0,   143,   129,    73,    42,     0,     0,   145,
  231.    142,     0,     0,    26,   146,   142,     0,    37,     0,    38,
  232.      0,   149,    81,     0,     0,     0,     0,    13,    35,   150,
  233.    139,    73,   151,   157,   152,    66,     0,     0,     0,     0,
  234.     13,   156,   153,   139,    73,   154,   157,   155,    66,     0,
  235.     39,     0,    40,     0,   103,     0,     4,   161,    10,     0,
  236.      0,     4,   160,   161,    10,     0,   162,     0,   161,    66,
  237.    162,     0,   164,     0,   163,    73,   164,     0,    30,     0,
  238.    165,     0,   206,     0,   166,     0,   202,     0,   204,     0,
  239.    205,     0,    48,     0,     0,   169,    33,   167,   177,     0,
  240.      0,   171,    33,   168,   177,     0,     0,    36,   170,   172,
  241.      0,    36,     0,    39,     0,    40,     0,   173,     0,   172,
  242.    173,     0,     0,    71,   174,   177,   175,     0,    74,    45,
  243.      0,    74,    43,     0,    74,    44,     0,    72,     0,     0,
  244.     69,   176,   177,    72,     0,   192,   177,     0,     0,   177,
  245.     55,   178,   177,     0,     0,   177,    56,   179,   177,     0,
  246.      0,   177,    60,   180,   177,     0,     0,   177,    62,   181,
  247.    177,     0,     0,   177,    49,   182,   177,     0,     0,   177,
  248.     50,   183,   177,     0,     0,   177,    63,   184,   177,     0,
  249.      0,   177,    51,   185,   177,     0,     0,   177,    52,   186,
  250.    177,     0,     0,   177,    53,   187,   177,     0,     0,   177,
  251.     54,   188,   177,     0,     0,   177,    64,   189,   177,     0,
  252.      0,   177,    57,   190,   177,     0,     0,   177,    61,   191,
  253.    177,     0,   193,     0,    58,     0,    59,     0,    65,     0,
  254.      0,    67,   194,   177,    68,     0,   169,     0,    94,     0,
  255.     39,     0,     0,    40,   195,   196,     0,     0,    67,   197,
  256.    198,    68,     0,   200,     0,     0,   198,    69,   199,   200,
  257.      0,   177,   201,     0,    73,    30,     0,     0,    37,     0,
  258.     35,     0,     0,    38,   203,   196,     0,    14,    30,     0,
  259.      0,   159,     0,   207,     0,   222,     0,   208,     0,   214,
  260.      0,   209,     0,   209,   212,     0,     0,     0,    15,   210,
  261.    177,   211,    22,   162,     0,     0,     9,   213,   162,     0,
  262.      0,     0,     5,   215,   177,    17,   216,   217,   221,     0,
  263.    218,     0,   217,    66,   218,     0,   219,    73,   164,     0,
  264.    220,     0,   219,    69,   220,     0,    30,     0,    28,     0,
  265.     10,     0,    66,    10,     0,   223,     0,   226,     0,   229,
  266.      0,     0,     0,    27,   224,   177,   225,     7,   162,     0,
  267.      0,     0,    21,   227,   161,    25,   228,   177,     0,     0,
  268.      0,     0,    12,   230,   233,    33,   231,   234,     7,   232,
  269.    162,     0,    36,     0,     0,     0,   177,   235,    23,   236,
  270.    177,     0,     0,     0,   177,   237,     8,   238,   177,     0
  271. };
  272.  
  273. #if YYDEBUG != 0
  274. static const short yyrline[] = { 0,
  275.     55,    61,    65,    69,    71,    74,    80,    85,    90,    95,
  276.    100,   105,   110,   119,   126,   130,   135,   151,   156,   187,
  277.    188,   190,   194,   195,   198,   202,   203,   207,   208,   211,
  278.    214,   218,   223,   231,   235,   237,   241,   255,   273,   277,
  279.    278,   281,   282,   285,   288,   294,   298,   310,   311,   314,
  280.    353,   356,   359,   360,   363,   369,   377,   388,   393,   394,
  281.    398,   404,   415,   416,   420,   422,   431,   435,   437,   441,
  282.    442,   445,   447,   453,   466,   469,   470,   473,   485,   497,
  283.    500,   503,   504,   507,   508,   511,   518,   523,   527,   528,
  284.    531,   545,   559,   575,   577,   582,   589,   590,   591,   594,
  285.    596,   600,   603,   616,   620,   628,   635,   642,   651,   654,
  286.    655,   658,   660,   675,   676,   676,   677,   679,   680,   683,
  287.    686,   697,   703,   708,   708,   719,   725,   730,   732,   733,
  288.    736,   739,   742,   744,   748,   749,   752,   753,   757,   766,
  289.    768,   772,   773,   774,   775,   776,   780,   783,   783,   786,
  290.    788,   799,   799,   805,   807,   811,   812,   815,   817,   819,
  291.    837,   839,   843,   844,   846,   849,   851,   852,   853,   854,
  292.    855,   856,   857,   858,   859,   860,   861,   862,   863,   864,
  293.    865,   866,   867,   868,   869,   870,   871,   872,   873,   874,
  294.    875,   876,   877,   880,   881,   885,   886,   888,   892,   894,
  295.    896,   897,   898,   900,   903,   905,   907,   911,   912,   915,
  296.    917,   921,   922,   925,   927,   933,   936,   938,   952,   955,
  297.    956,   957,   960,   961,   964,   965,   968,   971,   972,   975,
  298.    978,   980,   982,   986,   990,   991,   994,   998,   999,  1002,
  299.   1007,  1011,  1012,  1015,  1016,  1017,  1020,  1025,  1026,  1029,
  300.   1031,  1036,  1039,  1048,  1054,  1071,  1088,  1092,  1095,  1100,
  301.   1104,  1107,  1112
  302. };
  303.  
  304. static const char * const yytname[] = {   "$","error","$illegal.","array_tok",
  305. "begin_tok","case_tok","const_tok","do_tok","downto_tok","else_tok","end_tok",
  306. "file_tok","for_tok","function_tok","goto_tok","if_tok","label_tok","of_tok",
  307. "procedure_tok","program_tok","record_tok","repeat_tok","then_tok","to_tok",
  308. "type_tok","until_tok","var_tok","while_tok","others_tok","r_num_tok","i_num_tok",
  309. "string_literal_tok","single_char_tok","assign_tok","two_dots_tok","undef_id_tok",
  310. "var_id_tok","proc_id_tok","proc_param_tok","fun_id_tok","fun_param_tok","const_id_tok",
  311. "type_id_tok","hhb0_tok","hhb1_tok","field_id_tok","define_tok","field_tok",
  312. "break_tok","'='","not_eq_tok","'<'","'>'","less_eq_tok","great_eq_tok","'+'",
  313. "'-'","or_tok","unary_plus_tok","unary_minus_tok","'*'","'/'","div_tok","mod_tok",
  314. "and_tok","not_tok","';'","'('","')'","','","'^'","'['","']'","':'","'.'","PROGRAM",
  315. "@1","@2","DEFS","DEF","PROGRAM_HEAD","BLOCK","@3","@4","@5","LABEL_DEC_PART",
  316. "@6","LABEL_LIST","LABEL","CONST_DEC_PART","CONST_DEC_LIST","CONST_DEC","@7",
  317. "@8","CONSTANT","STRING","CONSTANT_ID","TYPE_DEC_PART","TYPE_DEF_LIST","TYPE_DEF",
  318. "@9","@10","@11","TYPE","SIMPLE_TYPE","SUBRANGE_TYPE","POSSIBLE_PLUS","SUB_CONSTANT",
  319. "TYPE_ID","STRUCTURED_TYPE","POINTER_TYPE","ARRAY_TYPE","INDEX_TYPE","COMPONENT_TYPE",
  320. "RECORD_TYPE","@12","FIELD_LIST","RECORD_SECTION","@13","@14","FIELD_ID_LIST",
  321. "FIELD_ID","FILE_TYPE","@15","VAR_DEC_PART","VAR_DEC_LIST","VAR_DEC","@16","@17",
  322. "VAR_ID_DEC_LIST","VAR_ID","BODY","@18","P_F_DEC_PART","P_F_DEC","PROCEDURE_DEC",
  323. "PROCEDURE_HEAD","@19","@20","PARAM","@21","FORM_PAR_SEC_L","FORM_PAR_SEC1",
  324. "@22","FORM_PAR_SEC","@23","@24","DECLARED_PROC","FUNCTION_DEC","FUNCTION_HEAD",
  325. "@25","@26","@27","@28","@29","@30","DECLARED_FUN","RESULT_TYPE","STAT_PART",
  326. "COMPOUND_STAT","@31","STAT_LIST","STATEMENT","S_LABEL","UNLAB_STAT","SIMPLE_STAT",
  327. "ASSIGN_STAT","@32","@33","VARIABLE","@34","FUNC_ID_AS","VAR_DESIG_LIST","VAR_DESIG",
  328. "@35","VAR_DESIG1","@36","EXPRESS","@37","@38","@39","@40","@41","@42","@43",
  329. "@44","@45","@46","@47","@48","@49","@50","UNARY_OP","FACTOR","@51","@52","PARAM_LIST",
  330. "@53","ACTUAL_PARAM_L","@54","ACTUAL_PARAM","WIDTH_FIELD","PROC_STAT","@55",
  331. "GO_TO_STAT","EMPTY_STAT","STRUCT_STAT","CONDIT_STAT","IF_STATEMENT","BEGIN_IF_STAT",
  332. "@56","@57","ELSE_STAT","@58","CASE_STATEMENT","@59","@60","CASE_EL_LIST","CASE_ELEMENT",
  333. "CASE_LAB_LIST","CASE_LAB","END_CASE","REPETIT_STAT","WHILE_STATEMENT","@61",
  334. "@62","REP_STATEMENT","@63","@64","FOR_STATEMENT","@65","@66","@67","CONTROL_VAR",
  335. "FOR_LIST","@68","@69","@70","@71",""
  336. };
  337. #endif
  338.  
  339. static const short yyr1[] = {     0,
  340.     76,    77,    75,    78,    78,    79,    79,    79,    79,    79,
  341.     79,    79,    79,    79,    80,    82,    83,    84,    81,    85,
  342.     86,    85,    87,    87,    88,    89,    89,    90,    90,    92,
  343.     93,    91,    94,    94,    94,    94,    95,    95,    96,    97,
  344.     97,    98,    98,   100,   101,   102,    99,   103,   103,   104,
  345.    104,   105,   106,   106,   107,   107,   108,   109,   109,   109,
  346.    109,   110,   111,   111,   112,   112,   113,   115,   114,   116,
  347.    116,   118,   119,   117,   117,   120,   120,   121,   121,   123,
  348.    122,   124,   124,   125,   125,   127,   128,   126,   129,   129,
  349.    130,   130,   130,   131,   132,   131,   133,   133,   133,   134,
  350.    134,   135,   137,   136,   138,   136,   139,   140,   139,   141,
  351.    141,   143,   142,   145,   144,   146,   144,   147,   147,   148,
  352.    150,   151,   152,   149,   153,   154,   155,   149,   156,   156,
  353.    157,   158,   160,   159,   161,   161,   162,   162,   163,   164,
  354.    164,   165,   165,   165,   165,   165,   167,   166,   168,   166,
  355.    170,   169,   169,   171,   171,   172,   172,   174,   173,   173,
  356.    173,   173,   175,   176,   175,   177,   178,   177,   179,   177,
  357.    180,   177,   181,   177,   182,   177,   183,   177,   184,   177,
  358.    185,   177,   186,   177,   187,   177,   188,   177,   189,   177,
  359.    190,   177,   191,   177,   177,   192,   192,   192,   194,   193,
  360.    193,   193,   193,   195,   193,   197,   196,   198,   199,   198,
  361.    200,   201,   201,   202,   202,   203,   202,   204,   205,   206,
  362.    206,   206,   207,   207,   208,   208,   210,   211,   209,   213,
  363.    212,   215,   216,   214,   217,   217,   218,   219,   219,   220,
  364.    220,   221,   221,   222,   222,   222,   224,   225,   223,   227,
  365.    228,   226,   230,   231,   232,   229,   233,   235,   236,   234,
  366.    237,   238,   234
  367. };
  368.  
  369. static const short yyr2[] = {     0,
  370.      0,     0,    10,     0,     2,     4,     4,     4,     6,     4,
  371.      6,     4,     6,     4,     3,     0,     0,     0,     8,     0,
  372.      0,     4,     1,     3,     1,     0,     2,     1,     2,     0,
  373.      0,     6,     1,     1,     1,     1,     1,     1,     1,     0,
  374.      2,     1,     2,     0,     0,     0,     7,     1,     1,     1,
  375.      1,     3,     0,     1,     2,     1,     1,     1,     1,     1,
  376.      1,     2,     6,     8,     1,     1,     1,     0,     4,     1,
  377.      3,     0,     0,     5,     0,     1,     3,     1,     1,     0,
  378.      4,     0,     2,     1,     2,     0,     0,     6,     1,     3,
  379.      1,     1,     1,     0,     0,     5,     0,     1,     2,     2,
  380.      2,     2,     0,     5,     0,     5,     0,     0,     4,     1,
  381.      3,     0,     4,     0,     2,     0,     3,     1,     1,     2,
  382.      0,     0,     0,     9,     0,     0,     0,     9,     1,     1,
  383.      1,     3,     0,     4,     1,     3,     1,     3,     1,     1,
  384.      1,     1,     1,     1,     1,     1,     0,     4,     0,     4,
  385.      0,     3,     1,     1,     1,     1,     2,     0,     4,     2,
  386.      2,     2,     1,     0,     4,     2,     0,     4,     0,     4,
  387.      0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
  388.      0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
  389.      0,     4,     0,     4,     1,     1,     1,     1,     0,     4,
  390.      1,     1,     1,     0,     3,     0,     4,     1,     0,     4,
  391.      2,     2,     0,     1,     1,     0,     3,     2,     0,     1,
  392.      1,     1,     1,     1,     1,     2,     0,     0,     6,     0,
  393.      3,     0,     0,     7,     1,     3,     3,     1,     3,     1,
  394.      1,     1,     2,     1,     1,     1,     0,     0,     6,     0,
  395.      0,     6,     0,     0,     0,     9,     1,     0,     0,     5,
  396.      0,     0,     5
  397. };
  398.  
  399. static const short yydefact[] = {     4,
  400.      0,     0,     0,     5,     1,     0,     0,     0,     0,     0,
  401.      0,     0,    20,    15,     0,     0,     0,     0,     0,     0,
  402.     21,    26,     8,     7,     0,    10,     0,    53,    12,    14,
  403.      6,     0,    30,    40,     0,     0,    56,    54,     0,     0,
  404.      0,    25,     0,    23,    27,    28,     0,    44,    82,     9,
  405.     11,    13,    55,    53,    22,     0,    29,    31,    41,    42,
  406.      0,    86,     2,    52,    24,     0,    43,    45,    83,    84,
  407.      0,    97,     0,     0,    85,    91,    92,    93,     0,    89,
  408.      0,     0,    94,    98,     0,    16,     0,    16,    34,    33,
  409.     37,    38,    39,     0,    35,    36,    46,     0,    87,   121,
  410.    129,   130,   125,   103,   118,   119,   105,    95,     3,    99,
  411.    100,   102,    20,   101,   120,    32,    53,    90,    53,   107,
  412.    107,   107,   107,   219,    26,     0,     0,    68,    57,     0,
  413.      0,    48,    50,    51,    49,    61,    58,    59,    60,     0,
  414.    108,     0,     0,     0,     0,   133,   232,   253,     0,   227,
  415.    250,   247,   139,   215,   153,   214,   216,   154,   155,   146,
  416.    220,     0,   135,     0,   137,   140,   142,     0,     0,   143,
  417.    144,   145,   141,   221,   223,   225,   224,   222,   244,   245,
  418.    246,    40,    53,    80,    72,    62,    47,    88,   114,   122,
  419.    126,   104,   106,   219,     0,     0,   218,     0,   219,     0,
  420.      0,     0,     0,   219,   219,   147,   149,   230,   226,    17,
  421.     66,    65,     0,    53,     0,    70,     0,   116,     0,   110,
  422.    112,    53,    53,     0,   203,   204,   196,   197,   198,   199,
  423.    202,   201,     0,     0,   195,   257,     0,   228,     0,   248,
  424.    158,     0,   152,   156,   206,   217,    96,   136,   138,     0,
  425.      0,   219,    82,    53,     0,    81,    69,    72,    78,    79,
  426.      0,    76,   112,   114,   109,   115,     0,   131,   123,   127,
  427.    134,     0,     0,   233,   175,   177,   181,   183,   185,   187,
  428.    167,   169,   191,   171,   193,   173,   179,   189,   166,   254,
  429.      0,   251,     0,     0,   161,   162,   160,   157,     0,   148,
  430.    150,   231,    18,     0,    53,    71,     0,    73,   117,   111,
  431.      0,     0,     0,   205,     0,     0,     0,     0,     0,     0,
  432.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  433.      0,   219,     0,   219,     0,   213,     0,   208,     0,     0,
  434.     67,    63,    77,    53,     0,   124,   128,   200,   241,   240,
  435.      0,   235,     0,   238,   176,   178,   182,   184,   186,   188,
  436.    168,   170,   192,   172,   194,   174,   180,   190,   258,     0,
  437.    229,   252,   249,   164,   163,   159,     0,   211,   207,   209,
  438.    219,    19,    53,    74,   113,   242,     0,   234,     0,   219,
  439.      0,     0,   255,     0,   212,     0,     0,    64,   243,   236,
  440.    239,   237,   259,   262,   219,     0,   210,   132,     0,     0,
  441.    256,   165,   260,   263,     0,     0,     0
  442. };
  443.  
  444. static const short yydefgoto[] = {   415,
  445.     13,    72,     1,     4,     5,   112,   113,   253,   339,    22,
  446.     32,    43,    44,    34,    45,    46,    47,    66,   231,    95,
  447.     96,    49,    59,    60,    61,    74,   117,   268,   132,   133,
  448.     40,    41,   134,   135,   136,   137,   213,   342,   138,   185,
  449.    215,   216,   217,   344,   261,   262,   139,   214,    63,    69,
  450.     70,    71,   119,    79,    80,   109,   124,    83,    84,    85,
  451.     86,   122,   123,   142,   189,   219,   266,   267,   220,   221,
  452.    263,   107,    87,    88,   120,   222,   312,   121,   223,   313,
  453.    103,   269,   382,   161,   194,   162,   163,   164,   165,   166,
  454.    167,   250,   251,   232,   201,   169,   243,   244,   294,   376,
  455.    394,   336,   323,   324,   326,   328,   317,   318,   329,   319,
  456.    320,   321,   322,   330,   325,   327,   234,   235,   273,   272,
  457.    246,   299,   337,   396,   338,   378,   170,   202,   171,   172,
  458.    173,   174,   175,   176,   198,   291,   209,   252,   177,   195,
  459.    316,   351,   352,   353,   354,   388,   178,   179,   200,   293,
  460.    180,   199,   333,   181,   196,   331,   405,   237,   370,   391,
  461.    409,   392,   410
  462. };
  463.  
  464. static const short yypact[] = {-32768,
  465.      4,   -29,    27,-32768,-32768,   -47,    20,    33,    52,    62,
  466.     72,   114,   141,-32768,   108,    53,    60,    16,   112,   122,
  467. -32768,   158,-32768,-32768,   132,-32768,   139,    28,-32768,-32768,
  468. -32768,   187,-32768,   167,   157,   160,-32768,-32768,   165,   190,
  469.    204,-32768,    78,-32768,   212,-32768,   213,-32768,   235,-32768,
  470. -32768,-32768,-32768,    28,-32768,   187,-32768,-32768,   224,-32768,
  471.    227,-32768,-32768,-32768,-32768,   214,-32768,-32768,   117,-32768,
  472.    120,    43,   184,   215,-32768,-32768,-32768,-32768,    35,-32768,
  473.     44,   142,   150,-32768,   199,-32768,   205,-32768,-32768,-32768,
  474. -32768,-32768,-32768,   206,-32768,-32768,-32768,   120,-32768,-32768,
  475. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  476. -32768,-32768,   141,-32768,-32768,-32768,     2,-32768,     2,   203,
  477.    203,   203,   203,   146,   158,   202,   259,-32768,-32768,   232,
  478.    225,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   226,
  479. -32768,   207,   228,   234,   237,-32768,-32768,-32768,   248,-32768,
  480. -32768,-32768,-32768,-32768,    98,-32768,-32768,-32768,-32768,-32768,
  481. -32768,    -2,-32768,   231,-32768,-32768,-32768,   246,   265,-32768,
  482. -32768,-32768,-32768,-32768,-32768,   290,-32768,-32768,-32768,-32768,
  483. -32768,   167,     0,-32768,     1,-32768,-32768,-32768,   289,-32768,
  484. -32768,-32768,-32768,   146,   210,   280,-32768,   210,   146,   210,
  485.    119,   255,   249,   146,   197,-32768,-32768,-32768,-32768,-32768,
  486. -32768,-32768,   123,     2,     5,-32768,    14,-32768,   161,-32768,
  487. -32768,     2,     2,     7,-32768,-32768,-32768,-32768,-32768,-32768,
  488. -32768,-32768,    61,   210,-32768,-32768,   291,   301,    -9,   301,
  489. -32768,   154,   119,-32768,-32768,-32768,-32768,-32768,-32768,   210,
  490.    210,   146,   235,     0,   308,-32768,-32768,     1,-32768,-32768,
  491.     36,-32768,-32768,   289,-32768,-32768,   120,-32768,-32768,-32768,
  492. -32768,   255,   210,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  493. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  494.    304,-32768,   320,   210,-32768,-32768,-32768,-32768,   210,   301,
  495.    301,-32768,-32768,   256,     2,-32768,    14,-32768,-32768,-32768,
  496.     97,   273,   274,-32768,   281,   230,   210,   210,   210,   210,
  497.    210,   210,   210,   210,   210,   210,   210,   210,   210,   210,
  498.    210,   146,   210,   146,   233,   -25,   175,-32768,   342,   330,
  499. -32768,-32768,-32768,     2,   306,-32768,-32768,-32768,-32768,-32768,
  500.     10,-32768,   102,-32768,   317,   317,   317,   317,   317,   317,
  501.    192,   192,   192,-32768,-32768,-32768,-32768,-32768,    39,   352,
  502. -32768,   301,-32768,-32768,-32768,-32768,   345,-32768,-32768,-32768,
  503.    146,-32768,     2,-32768,-32768,-32768,    24,-32768,   230,   197,
  504.    337,   368,-32768,   210,-32768,   210,    11,-32768,-32768,-32768,
  505. -32768,-32768,-32768,-32768,   146,   257,-32768,-32768,   210,   210,
  506. -32768,-32768,   301,   301,   382,   383,-32768
  507. };
  508.  
  509. static const short yypgoto[] = {-32768,
  510. -32768,-32768,-32768,-32768,-32768,   296,-32768,-32768,-32768,   272,
  511. -32768,-32768,   331,   261,-32768,   343,-32768,-32768,   316,-32768,
  512. -32768,   208,-32768,   332,-32768,-32768,-32768,  -116,-32768,   -24,
  513. -32768,   338,-32768,-32768,-32768,-32768,   140,    12,-32768,-32768,
  514. -32768,   135,-32768,-32768,-32768,    89,-32768,-32768,   144,-32768,
  515.    329,-32768,-32768,   133,   303,-32768,-32768,-32768,   319,-32768,
  516. -32768,-32768,-32768,    82,-32768,-32768,   136,-32768,   143,-32768,
  517. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  518. -32768,   180,-32768,-32768,-32768,  -185,  -186,-32768,  -203,-32768,
  519. -32768,-32768,-32768,  -124,-32768,-32768,-32768,   162,-32768,-32768,
  520. -32768,  -188,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  521. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  522.    134,-32768,-32768,-32768,     8,-32768,-32768,-32768,-32768,-32768,
  523. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  524. -32768,-32768,    21,-32768,    22,-32768,-32768,-32768,-32768,-32768,
  525. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  526. -32768,-32768,-32768
  527. };
  528.  
  529.  
  530. #define    YYLAST        411
  531.  
  532.  
  533. static const short yytable[] = {   168,
  534.    131,   249,   140,    39,   126,     6,   233,   203,   224,   238,
  535.    -75,   240,   127,   239,   257,   292,   271,   248,    14,   386,
  536.    408,   128,     2,   275,   276,   277,   278,   279,   280,   281,
  537.    282,   283,     7,   399,   284,   285,   286,   287,   288,     8,
  538.     37,   211,    37,   129,     9,   289,  -261,   377,   259,     3,
  539.     10,   349,    11,   350,    15,    81,   204,    38,   260,    38,
  540.     82,   300,   301,   204,    28,   302,   -75,    16,    37,   168,
  541.    258,   130,   204,    12,   168,   387,   204,   274,   100,   168,
  542.    168,    29,   101,   102,   315,    38,    17,   275,   276,   277,
  543.    278,   279,   280,   281,   282,   283,    18,   256,   284,   285,
  544.    286,   287,   288,    98,   307,   335,    19,    99,   308,   275,
  545.    276,   277,   278,   279,   280,   281,   282,   283,    24,    25,
  546.    284,   285,   286,   287,   288,    26,    27,   168,   355,   356,
  547.    357,   358,   359,   360,   361,   362,   363,   364,   365,   366,
  548.    367,   368,   369,    55,   372,   371,    56,   373,    20,   146,
  549.    147,   -86,   -86,   108,    76,    77,    21,   148,   212,   149,
  550.    150,   -86,    81,    33,    78,    98,   151,    82,  -151,   345,
  551.    389,  -151,   152,    23,   390,   153,   104,    30,   105,   106,
  552.    154,   155,   156,   157,   158,   159,   402,    31,   341,   241,
  553.     48,   254,   242,   160,   255,   397,   295,   296,   297,    35,
  554.    146,   147,   143,   144,   145,   406,    36,   168,   148,   168,
  555.    149,   150,    89,    90,    91,    92,    42,   151,   411,    53,
  556.    413,   414,    50,   152,    93,    51,   264,   384,   265,   212,
  557.     52,   154,   155,   156,   157,   158,   159,    54,    89,    90,
  558.     91,    92,   379,   380,   160,   155,   -30,    58,   225,   226,
  559.     93,   284,   285,   286,   287,   288,   168,   349,   -44,   350,
  560.     62,    68,    73,    97,   111,   168,   341,   227,   228,   141,
  561.    114,   116,   183,   186,   229,   184,   230,   197,   206,   190,
  562.    168,   275,   276,   277,   278,   279,   280,   281,   282,   283,
  563.    187,   188,   284,   285,   286,   287,   288,   207,   208,   192,
  564.    191,   374,   193,   205,   375,   275,   276,   277,   278,   279,
  565.    280,   281,   282,   283,   218,   236,   284,   285,   286,   287,
  566.    288,   245,   247,   290,   305,   332,   334,   340,   412,   275,
  567.    276,   277,   278,   279,   280,   281,   282,   283,   346,   347,
  568.    284,   285,   286,   287,   288,   381,   383,   385,   348,   275,
  569.    276,   277,   278,   279,   280,   281,   282,   283,   393,   403,
  570.    284,   285,   286,   287,   288,-32768,-32768,-32768,-32768,-32768,
  571. -32768,   281,   282,   283,   395,   404,   284,   285,   286,   287,
  572.    288,   416,   417,   115,   125,   182,    65,    57,    94,   210,
  573.     67,    64,   306,   304,   398,   343,   303,    75,   309,   311,
  574.    118,   110,   270,   407,   298,   314,   310,   400,     0,     0,
  575.    401
  576. };
  577.  
  578. static const short yycheck[] = {   124,
  579.    117,   205,   119,    28,     3,    35,   195,    10,   194,   198,
  580.     10,   200,    11,   199,    10,    25,    10,   204,    66,    10,
  581.     10,    20,    19,    49,    50,    51,    52,    53,    54,    55,
  582.     56,    57,     6,    10,    60,    61,    62,    63,    64,    13,
  583.     41,    42,    41,    42,    18,   234,     8,    73,    35,    46,
  584.     24,    28,    26,    30,    35,    13,    66,    58,    45,    58,
  585.     18,   250,   251,    66,    49,   252,    66,    35,    41,   194,
  586.     66,    70,    66,    47,   199,    66,    66,    17,    35,   204,
  587.    205,    66,    39,    40,   273,    58,    35,    49,    50,    51,
  588.     52,    53,    54,    55,    56,    57,    35,   214,    60,    61,
  589.     62,    63,    64,    69,    69,   294,    35,    73,    73,    49,
  590.     50,    51,    52,    53,    54,    55,    56,    57,    66,    67,
  591.     60,    61,    62,    63,    64,    66,    67,   252,   317,   318,
  592.    319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
  593.    329,   330,   331,    66,   333,   332,    69,   334,    35,     4,
  594.      5,    35,    36,     4,    35,    36,    16,    12,   183,    14,
  595.     15,    45,    13,     6,    45,    69,    21,    18,    71,    73,
  596.     69,    74,    27,    66,    73,    30,    35,    66,    37,    38,
  597.     35,    36,    37,    38,    39,    40,   390,    66,   305,    71,
  598.     24,    69,    74,    48,    72,   381,    43,    44,    45,    68,
  599.      4,     5,   121,   122,   123,   394,    68,   332,    12,   334,
  600.     14,    15,    29,    30,    31,    32,    30,    21,   405,    30,
  601.    409,   410,    66,    27,    41,    66,    66,   344,    68,   254,
  602.     66,    35,    36,    37,    38,    39,    40,    34,    29,    30,
  603.     31,    32,    68,    69,    48,    36,    35,    35,    39,    40,
  604.     41,    60,    61,    62,    63,    64,   381,    28,    35,    30,
  605.     26,    35,    49,    49,    66,   390,   383,    58,    59,    67,
  606.     66,    66,    71,    42,    65,    17,    67,    30,    33,    73,
  607.    405,    49,    50,    51,    52,    53,    54,    55,    56,    57,
  608.     66,    66,    60,    61,    62,    63,    64,    33,     9,    66,
  609.     73,    69,    66,    73,    72,    49,    50,    51,    52,    53,
  610.     54,    55,    56,    57,    26,    36,    60,    61,    62,    63,
  611.     64,    67,    74,    33,    17,    22,     7,    72,    72,    49,
  612.     50,    51,    52,    53,    54,    55,    56,    57,    66,    66,
  613.     60,    61,    62,    63,    64,     4,    17,    42,    68,    49,
  614.     50,    51,    52,    53,    54,    55,    56,    57,     7,    23,
  615.     60,    61,    62,    63,    64,    49,    50,    51,    52,    53,
  616.     54,    55,    56,    57,    30,     8,    60,    61,    62,    63,
  617.     64,     0,     0,    88,   113,   125,    56,    45,    73,   182,
  618.     59,    54,   258,   254,   383,   307,   253,    69,   263,   267,
  619.     98,    83,   223,   396,   243,   272,   264,   387,    -1,    -1,
  620.    389
  621. };
  622. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  623. #line 3 "/usr/local/gnu/lib/bison.simple"
  624.  
  625. /* Skeleton output parser for bison,
  626.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  627.  
  628.    This program is free software; you can redistribute it and/or modify
  629.    it under the terms of the GNU General Public License as published by
  630.    the Free Software Foundation; either version 1, or (at your option)
  631.    any later version.
  632.  
  633.    This program is distributed in the hope that it will be useful,
  634.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  635.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  636.    GNU General Public License for more details.
  637.  
  638.    You should have received a copy of the GNU General Public License
  639.    along with this program; if not, write to the Free Software
  640.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  641.  
  642.  
  643. #ifndef alloca
  644. #ifdef __GNUC__
  645. #define alloca __builtin_alloca
  646. #else /* not GNU C.  */
  647. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc)
  648. #include <alloca.h>
  649. #else /* not sparc */
  650. #if defined (MSDOS) && !defined (__TURBOC__)
  651. #include <malloc.h>
  652. #else /* not MSDOS, or __TURBOC__ */
  653. #if defined(_AIX)
  654. #include <malloc.h>
  655.  #pragma alloca
  656. #endif /* not _AIX */
  657. #endif /* not MSDOS, or __TURBOC__ */
  658. #endif /* not sparc.  */
  659. #endif /* not GNU C.  */
  660. #endif /* alloca not defined.  */
  661.  
  662. /* This is the parser code that is written into each bison parser
  663.   when the %semantic_parser declaration is not specified in the grammar.
  664.   It was written by Richard Stallman by simplifying the hairy parser
  665.   used when %semantic_parser is specified.  */
  666.  
  667. /* Note: there must be only one dollar sign in this file.
  668.    It is replaced by the list of actions, each action
  669.    as one case of the switch.  */
  670.  
  671. #define yyerrok        (yyerrstatus = 0)
  672. #define yyclearin    (yychar = YYEMPTY)
  673. #define YYEMPTY        -2
  674. #define YYEOF        0
  675. #define YYACCEPT    return(0)
  676. #define YYABORT     return(1)
  677. #define YYERROR        goto yyerrlab1
  678. /* Like YYERROR except do call yyerror.
  679.    This remains here temporarily to ease the
  680.    transition to the new meaning of YYERROR, for GCC.
  681.    Once GCC version 2 has supplanted version 1, this can go.  */
  682. #define YYFAIL        goto yyerrlab
  683. #define YYRECOVERING()  (!!yyerrstatus)
  684. #define YYBACKUP(token, value) \
  685. do                                \
  686.   if (yychar == YYEMPTY && yylen == 1)                \
  687.     { yychar = (token), yylval = (value);            \
  688.       yychar1 = YYTRANSLATE (yychar);                \
  689.       YYPOPSTACK;                        \
  690.       goto yybackup;                        \
  691.     }                                \
  692.   else                                \
  693.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  694. while (0)
  695.  
  696. #define YYTERROR    1
  697. #define YYERRCODE    256
  698.  
  699. #ifndef YYPURE
  700. #define YYLEX        yylex()
  701. #endif
  702.  
  703. #ifdef YYPURE
  704. #ifdef YYLSP_NEEDED
  705. #define YYLEX        yylex(&yylval, &yylloc)
  706. #else
  707. #define YYLEX        yylex(&yylval)
  708. #endif
  709. #endif
  710.  
  711. /* If nonreentrant, generate the variables here */
  712.  
  713. #ifndef YYPURE
  714.  
  715. int    yychar;            /*  the lookahead symbol        */
  716. YYSTYPE    yylval;            /*  the semantic value of the        */
  717.                 /*  lookahead symbol            */
  718.  
  719. #ifdef YYLSP_NEEDED
  720. YYLTYPE yylloc;            /*  location data for the lookahead    */
  721.                 /*  symbol                */
  722. #endif
  723.  
  724. int yynerrs;            /*  number of parse errors so far       */
  725. #endif  /* not YYPURE */
  726.  
  727. #if YYDEBUG != 0
  728. int yydebug;            /*  nonzero means print parse trace    */
  729. /* Since this is uninitialized, it does not stop multiple parsers
  730.    from coexisting.  */
  731. #endif
  732.  
  733. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  734.  
  735. #ifndef    YYINITDEPTH
  736. #define YYINITDEPTH 200
  737. #endif
  738.  
  739. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  740.     (effective only if the built-in stack extension method is used).  */
  741.  
  742. #if YYMAXDEPTH == 0
  743. #undef YYMAXDEPTH
  744. #endif
  745.  
  746. #ifndef YYMAXDEPTH
  747. #define YYMAXDEPTH 10000
  748. #endif
  749.  
  750. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  751. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  752. #else                /* not GNU C or C++ */
  753. #ifndef __cplusplus
  754.  
  755. /* This is the most reliable way to avoid incompatibilities
  756.    in available built-in functions on various systems.  */
  757. static void
  758. __yy_bcopy (from, to, count)
  759.      char *from;
  760.      char *to;
  761.      int count;
  762. {
  763.   register char *f = from;
  764.   register char *t = to;
  765.   register int i = count;
  766.  
  767.   while (i-- > 0)
  768.     *t++ = *f++;
  769. }
  770.  
  771. #else /* __cplusplus */
  772.  
  773. /* This is the most reliable way to avoid incompatibilities
  774.    in available built-in functions on various systems.  */
  775. static void
  776. __yy_bcopy (char *from, char *to, int count)
  777. {
  778.   register char *f = from;
  779.   register char *t = to;
  780.   register int i = count;
  781.  
  782.   while (i-- > 0)
  783.     *t++ = *f++;
  784. }
  785.  
  786. #endif
  787. #endif
  788.  
  789. #line 169 "/usr/local/gnu/lib/bison.simple"
  790. int
  791. yyparse()
  792. {
  793.   register int yystate;
  794.   register int yyn;
  795.   register short *yyssp;
  796.   register YYSTYPE *yyvsp;
  797.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  798.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  799.  
  800.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  801.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  802.  
  803.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  804.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  805.  
  806. #ifdef YYLSP_NEEDED
  807.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  808.   YYLTYPE *yyls = yylsa;
  809.   YYLTYPE *yylsp;
  810.  
  811. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  812. #else
  813. #define YYPOPSTACK   (yyvsp--, yyssp--)
  814. #endif
  815.  
  816.   int yystacksize = YYINITDEPTH;
  817.  
  818. #ifdef YYPURE
  819.   int yychar;
  820.   YYSTYPE yylval;
  821.   int yynerrs;
  822. #ifdef YYLSP_NEEDED
  823.   YYLTYPE yylloc;
  824. #endif
  825. #endif
  826.  
  827.   YYSTYPE yyval;        /*  the variable used to return        */
  828.                 /*  semantic values from the action    */
  829.                 /*  routines                */
  830.  
  831.   int yylen;
  832.  
  833. #if YYDEBUG != 0
  834.   if (yydebug)
  835.     fprintf(stderr, "Starting parse\n");
  836. #endif
  837.  
  838.   yystate = 0;
  839.   yyerrstatus = 0;
  840.   yynerrs = 0;
  841.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  842.  
  843.   /* Initialize stack pointers.
  844.      Waste one element of value and location stack
  845.      so that they stay on the same level as the state stack.
  846.      The wasted elements are never initialized.  */
  847.  
  848.   yyssp = yyss - 1;
  849.   yyvsp = yyvs;
  850. #ifdef YYLSP_NEEDED
  851.   yylsp = yyls;
  852. #endif
  853.  
  854. /* Push a new state, which is found in  yystate  .  */
  855. /* In all cases, when you get here, the value and location stacks
  856.    have just been pushed. so pushing a state here evens the stacks.  */
  857. yynewstate:
  858.  
  859.   *++yyssp = yystate;
  860.  
  861.   if (yyssp >= yyss + yystacksize - 1)
  862.     {
  863.       /* Give user a chance to reallocate the stack */
  864.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  865.       YYSTYPE *yyvs1 = yyvs;
  866.       short *yyss1 = yyss;
  867. #ifdef YYLSP_NEEDED
  868.       YYLTYPE *yyls1 = yyls;
  869. #endif
  870.  
  871.       /* Get the current used size of the three stacks, in elements.  */
  872.       int size = yyssp - yyss + 1;
  873.  
  874. #ifdef yyoverflow
  875.       /* Each stack pointer address is followed by the size of
  876.      the data in use in that stack, in bytes.  */
  877.       yyoverflow("parser stack overflow",
  878.          &yyss1, size * sizeof (*yyssp),
  879.          &yyvs1, size * sizeof (*yyvsp),
  880. #ifdef YYLSP_NEEDED
  881.          &yyls1, size * sizeof (*yylsp),
  882. #endif
  883.          &yystacksize);
  884.  
  885.       yyss = yyss1; yyvs = yyvs1;
  886. #ifdef YYLSP_NEEDED
  887.       yyls = yyls1;
  888. #endif
  889. #else /* no yyoverflow */
  890.       /* Extend the stack our own way.  */
  891.       if (yystacksize >= YYMAXDEPTH)
  892.     {
  893.       yyerror("parser stack overflow");
  894.       return 2;
  895.     }
  896.       yystacksize *= 2;
  897.       if (yystacksize > YYMAXDEPTH)
  898.     yystacksize = YYMAXDEPTH;
  899.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  900.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  901.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  902.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  903. #ifdef YYLSP_NEEDED
  904.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  905.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  906. #endif
  907. #endif /* no yyoverflow */
  908.  
  909.       yyssp = yyss + size - 1;
  910.       yyvsp = yyvs + size - 1;
  911. #ifdef YYLSP_NEEDED
  912.       yylsp = yyls + size - 1;
  913. #endif
  914.  
  915. #if YYDEBUG != 0
  916.       if (yydebug)
  917.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  918. #endif
  919.  
  920.       if (yyssp >= yyss + yystacksize - 1)
  921.     YYABORT;
  922.     }
  923.  
  924. #if YYDEBUG != 0
  925.   if (yydebug)
  926.     fprintf(stderr, "Entering state %d\n", yystate);
  927. #endif
  928.  
  929.   goto yybackup;
  930.  yybackup:
  931.  
  932. /* Do appropriate processing given the current state.  */
  933. /* Read a lookahead token if we need one and don't already have one.  */
  934. /* yyresume: */
  935.  
  936.   /* First try to decide what to do without reference to lookahead token.  */
  937.  
  938.   yyn = yypact[yystate];
  939.   if (yyn == YYFLAG)
  940.     goto yydefault;
  941.  
  942.   /* Not known => get a lookahead token if don't already have one.  */
  943.  
  944.   /* yychar is either YYEMPTY or YYEOF
  945.      or a valid token in external form.  */
  946.  
  947.   if (yychar == YYEMPTY)
  948.     {
  949. #if YYDEBUG != 0
  950.       if (yydebug)
  951.     fprintf(stderr, "Reading a token: ");
  952. #endif
  953.       yychar = YYLEX;
  954.     }
  955.  
  956.   /* Convert token to internal form (in yychar1) for indexing tables with */
  957.  
  958.   if (yychar <= 0)        /* This means end of input. */
  959.     {
  960.       yychar1 = 0;
  961.       yychar = YYEOF;        /* Don't call YYLEX any more */
  962.  
  963. #if YYDEBUG != 0
  964.       if (yydebug)
  965.     fprintf(stderr, "Now at end of input.\n");
  966. #endif
  967.     }
  968.   else
  969.     {
  970.       yychar1 = YYTRANSLATE(yychar);
  971.  
  972. #if YYDEBUG != 0
  973.       if (yydebug)
  974.     {
  975.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  976.       /* Give the individual parser a way to print the precise meaning
  977.          of a token, for further debugging info.  */
  978. #ifdef YYPRINT
  979.       YYPRINT (stderr, yychar, yylval);
  980. #endif
  981.       fprintf (stderr, ")\n");
  982.     }
  983. #endif
  984.     }
  985.  
  986.   yyn += yychar1;
  987.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  988.     goto yydefault;
  989.  
  990.   yyn = yytable[yyn];
  991.  
  992.   /* yyn is what to do for this token type in this state.
  993.      Negative => reduce, -yyn is rule number.
  994.      Positive => shift, yyn is new state.
  995.        New state is final state => don't bother to shift,
  996.        just return success.
  997.      0, or most negative number => error.  */
  998.  
  999.   if (yyn < 0)
  1000.     {
  1001.       if (yyn == YYFLAG)
  1002.     goto yyerrlab;
  1003.       yyn = -yyn;
  1004.       goto yyreduce;
  1005.     }
  1006.   else if (yyn == 0)
  1007.     goto yyerrlab;
  1008.  
  1009.   if (yyn == YYFINAL)
  1010.     YYACCEPT;
  1011.  
  1012.   /* Shift the lookahead token.  */
  1013.  
  1014. #if YYDEBUG != 0
  1015.   if (yydebug)
  1016.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  1017. #endif
  1018.  
  1019.   /* Discard the token being shifted unless it is eof.  */
  1020.   if (yychar != YYEOF)
  1021.     yychar = YYEMPTY;
  1022.  
  1023.   *++yyvsp = yylval;
  1024. #ifdef YYLSP_NEEDED
  1025.   *++yylsp = yylloc;
  1026. #endif
  1027.  
  1028.   /* count tokens shifted since error; after three, turn off error status.  */
  1029.   if (yyerrstatus) yyerrstatus--;
  1030.  
  1031.   yystate = yyn;
  1032.   goto yynewstate;
  1033.  
  1034. /* Do the default action for the current state.  */
  1035. yydefault:
  1036.  
  1037.   yyn = yydefact[yystate];
  1038.   if (yyn == 0)
  1039.     goto yyerrlab;
  1040.  
  1041. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  1042. yyreduce:
  1043.   yylen = yyr2[yyn];
  1044.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  1045.  
  1046. #if YYDEBUG != 0
  1047.   if (yydebug)
  1048.     {
  1049.       int i;
  1050.  
  1051.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  1052.            yyn, yyrline[yyn]);
  1053.  
  1054.       /* Print the symbols being reduced, and their result.  */
  1055.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  1056.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  1057.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  1058.     }
  1059. #endif
  1060.  
  1061.  
  1062.   switch (yyn) {
  1063.  
  1064. case 1:
  1065. #line 58 "web2c.yacc"
  1066. { block_level++;
  1067.          printf ("#include \"%s\"\n", std_header);
  1068.       ;
  1069.     break;}
  1070. case 2:
  1071. #line 63 "web2c.yacc"
  1072. { printf ("\n#include \"%s\"\n", coerce_name); ;
  1073.     break;}
  1074. case 3:
  1075. #line 66 "web2c.yacc"
  1076. { YYACCEPT; ;
  1077.     break;}
  1078. case 6:
  1079. #line 76 "web2c.yacc"
  1080. {
  1081.           ii = add_to_table (last_id); 
  1082.           sym_table[ii].typ = field_id_tok;
  1083.         ;
  1084.     break;}
  1085. case 7:
  1086. #line 81 "web2c.yacc"
  1087. {
  1088.           ii = add_to_table (last_id); 
  1089.           sym_table[ii].typ = fun_id_tok;
  1090.         ;
  1091.     break;}
  1092. case 8:
  1093. #line 86 "web2c.yacc"
  1094. {
  1095.           ii = add_to_table (last_id); 
  1096.           sym_table[ii].typ = const_id_tok;
  1097.         ;
  1098.     break;}
  1099. case 9:
  1100. #line 91 "web2c.yacc"
  1101. {
  1102.           ii = add_to_table (last_id); 
  1103.           sym_table[ii].typ = fun_param_tok;
  1104.         ;
  1105.     break;}
  1106. case 10:
  1107. #line 96 "web2c.yacc"
  1108. {
  1109.           ii = add_to_table (last_id); 
  1110.           sym_table[ii].typ = proc_id_tok;
  1111.         ;
  1112.     break;}
  1113. case 11:
  1114. #line 101 "web2c.yacc"
  1115. {
  1116.           ii = add_to_table (last_id); 
  1117.           sym_table[ii].typ = proc_param_tok;
  1118.         ;
  1119.     break;}
  1120. case 12:
  1121. #line 106 "web2c.yacc"
  1122. {
  1123.           ii = add_to_table (last_id); 
  1124.           sym_table[ii].typ = type_id_tok;
  1125.         ;
  1126.     break;}
  1127. case 13:
  1128. #line 111 "web2c.yacc"
  1129. {
  1130.           ii = add_to_table (last_id); 
  1131.           sym_table[ii].typ = type_id_tok;
  1132.           sym_table[ii].val = lower_bound;
  1133.           sym_table[ii].val_sym = lower_sym;
  1134.           sym_table[ii].upper = upper_bound;
  1135.           sym_table[ii].upper_sym = upper_sym;
  1136.         ;
  1137.     break;}
  1138. case 14:
  1139. #line 120 "web2c.yacc"
  1140. {
  1141.           ii = add_to_table (last_id); 
  1142.           sym_table[ii].typ = var_id_tok;
  1143.         ;
  1144.     break;}
  1145. case 16:
  1146. #line 131 "web2c.yacc"
  1147. {    if (block_level > 0) my_output("{");
  1148.             indent++; block_level++;
  1149.               ;
  1150.     break;}
  1151. case 17:
  1152. #line 136 "web2c.yacc"
  1153. {if (block_level == 2) {
  1154.                 if (strcmp(fn_return_type, "void")) {
  1155.                   my_output("register");
  1156.                   my_output(fn_return_type);
  1157.                   my_output("Result;");
  1158.                 }
  1159.                 if (tex) {
  1160.                   (void) sprintf(safe_string, "%s_regmem",
  1161.                         my_routine);
  1162.                   my_output(safe_string);
  1163.                   indent_line();
  1164.                 }
  1165.              }
  1166.             ;
  1167.     break;}
  1168. case 18:
  1169. #line 151 "web2c.yacc"
  1170. {if (block_level == 1)
  1171.                 puts("\n#include \"coerce.h\"");
  1172.              doing_statements = true;
  1173.             ;
  1174.     break;}
  1175. case 19:
  1176. #line 156 "web2c.yacc"
  1177. {if (block_level == 2) {
  1178.                 if (strcmp(fn_return_type,"void")) {
  1179.                   my_output("return(Result)");
  1180.                   semicolon();
  1181.                  }
  1182.                  if (tex) {
  1183.                    if (uses_mem && uses_eqtb)
  1184.                 (void) fprintf(coerce,
  1185.     "#define %s_regmem register memoryword *mem=zmem, *eqtb=zeqtb;\n",
  1186.                    my_routine);
  1187.                    else if (uses_mem)
  1188.                 (void) fprintf(coerce,
  1189.             "#define %s_regmem register memoryword *mem=zmem;\n",
  1190.                    my_routine);
  1191.                    else if (uses_eqtb)
  1192.                 (void) fprintf(coerce,
  1193.             "#define %s_regmem register memoryword *eqtb=zeqtb;\n",
  1194.                    my_routine);
  1195.                    else
  1196.                 (void) fprintf(coerce,
  1197.                    "#define %s_regmem\n",
  1198.                    my_routine);
  1199.                 }
  1200.                 my_routine[0] = '\0';
  1201.              }
  1202.              indent--; block_level--;
  1203.              my_output("}"); new_line();
  1204.              doing_statements = false;
  1205.             ;
  1206.     break;}
  1207. case 21:
  1208. #line 189 "web2c.yacc"
  1209. { my_output("/*"); ;
  1210.     break;}
  1211. case 22:
  1212. #line 191 "web2c.yacc"
  1213. { my_output("*/"); ;
  1214.     break;}
  1215. case 25:
  1216. #line 199 "web2c.yacc"
  1217. { my_output(temp); ;
  1218.     break;}
  1219. case 27:
  1220. #line 204 "web2c.yacc"
  1221. { indent_line(); ;
  1222.     break;}
  1223. case 30:
  1224. #line 212 "web2c.yacc"
  1225. { new_line(); my_output("#define"); ;
  1226.     break;}
  1227. case 31:
  1228. #line 214 "web2c.yacc"
  1229. { ii=add_to_table(last_id);
  1230.                   sym_table[ii].typ = const_id_tok;
  1231.                   my_output(last_id);
  1232.                 ;
  1233.     break;}
  1234. case 32:
  1235. #line 219 "web2c.yacc"
  1236. { sym_table[ii].val=last_i_num;
  1237.                   new_line(); ;
  1238.     break;}
  1239. case 33:
  1240. #line 224 "web2c.yacc"
  1241. {
  1242.                   (void) sscanf(temp, "%ld", &last_i_num);
  1243.                   if (my_labs((long) last_i_num) > 32767)
  1244.                       (void) strcat(temp, "L");
  1245.                   my_output(temp);
  1246.                   yyval = ex_32;
  1247.                 ;
  1248.     break;}
  1249. case 34:
  1250. #line 232 "web2c.yacc"
  1251. { my_output(temp);
  1252.                   yyval = ex_real;
  1253.                 ;
  1254.     break;}
  1255. case 35:
  1256. #line 236 "web2c.yacc"
  1257. { yyval = 0; ;
  1258.     break;}
  1259. case 36:
  1260. #line 238 "web2c.yacc"
  1261. { yyval = ex_32; ;
  1262.     break;}
  1263. case 37:
  1264. #line 242 "web2c.yacc"
  1265. { int i, j; char s[132];
  1266.                     j = 1;
  1267.                   s[0] = '"';
  1268.                     for (i=1; yytext[i-1]!=0; i++) {
  1269.                       if (yytext[i] == '\\' || yytext[i] == '"')
  1270.                     s[j++]='\\';
  1271.                         else if (yytext[i] == '\'') i++;
  1272.                         s[j++] = yytext[i];
  1273.                   }
  1274.                       s[j-1] = '"';
  1275.                   s[j] = 0;
  1276.                   my_output(s);
  1277.                 ;
  1278.     break;}
  1279. case 38:
  1280. #line 256 "web2c.yacc"
  1281. { char s[5];
  1282.                   s[0]='\'';
  1283.                       if (yytext[1] == '\\' || yytext[1] == '\'') {
  1284.                       s[2] = yytext[1];
  1285.                     s[1] = '\\';
  1286.                     s[3] = '\'';
  1287.                     s[4] = '\0';
  1288.                   }
  1289.                     else {
  1290.                     s[1] = yytext[1];
  1291.                     s[2]='\'';
  1292.                     s[3]='\0';
  1293.                   }
  1294.                     my_output(s);
  1295.                 ;
  1296.     break;}
  1297. case 39:
  1298. #line 274 "web2c.yacc"
  1299. { my_output(last_id); ;
  1300.     break;}
  1301. case 44:
  1302. #line 286 "web2c.yacc"
  1303. { my_output("typedef"); ;
  1304.     break;}
  1305. case 45:
  1306. #line 288 "web2c.yacc"
  1307. { ii = add_to_table(last_id);
  1308.                   sym_table[ii].typ = type_id_tok;
  1309.                   (void) strcpy(safe_string, last_id);
  1310.                   last_type = ii;
  1311.                 ;
  1312.     break;}
  1313. case 46:
  1314. #line 294 "web2c.yacc"
  1315. {
  1316.                   array_bounds[0] = 0;
  1317.                   array_offset[0] = 0;
  1318.                 ;
  1319.     break;}
  1320. case 47:
  1321. #line 299 "web2c.yacc"
  1322. { if (*array_offset) {
  1323.             fprintf(stderr, "Cannot typedef arrays with offsets\n");
  1324.                     exit(1);
  1325.                   }
  1326.                   my_output(safe_string);
  1327.                   my_output(array_bounds);
  1328.                   semicolon();
  1329.                   last_type = -1;
  1330.                 ;
  1331.     break;}
  1332. case 50:
  1333. #line 316 "web2c.yacc"
  1334. {
  1335.               if (last_type >= 0)
  1336.                 {
  1337.                    sym_table[ii].val = lower_bound;
  1338.                    sym_table[ii].val_sym = lower_sym;
  1339.                    sym_table[ii].upper = upper_bound;
  1340.                    sym_table[ii].upper_sym = upper_sym;
  1341.                    ii= -1;
  1342.                  }
  1343.                  
  1344.               /* If the bounds on an integral type are known at
  1345.                  translation time, select the smallest ANSI C type which
  1346.                  can represent it.  We avoid using unsigned char and
  1347.                  unsigned short where possible, as ANSI compilers
  1348.                  (typically) convert them to int, while traditional
  1349.                  compilers convert them to unsigned int.  We also avoid
  1350.                  schar if possible, since it also is different on
  1351.                  different compilers (see config.h).  */
  1352.               if (lower_sym == -1 && upper_sym == -1)
  1353.                 {
  1354.                   if (0 <= lower_bound && upper_bound <= SCHAR_MAX)
  1355.                     my_output ("char");
  1356.                   else if (SCHAR_MIN <= lower_bound && upper_bound <=SCHAR_MAX)
  1357.                     my_output ("schar");
  1358.                   else if (0 <= lower_bound && upper_bound <= UCHAR_MAX)
  1359.                     my_output ("unsigned char");
  1360.                   else if (SHRT_MIN <= lower_bound && upper_bound <= SHRT_MAX)
  1361.                     my_output ("short");
  1362.                   else if (0 <= lower_bound && upper_bound <= USHRT_MAX)
  1363.                     my_output ("unsigned short");
  1364.                   else
  1365.                     my_output ("integer");
  1366.                 }
  1367.               else
  1368.                 my_output ("integer");
  1369.             ;
  1370.     break;}
  1371. case 55:
  1372. #line 364 "web2c.yacc"
  1373. {lower_bound = upper_bound;
  1374.                  lower_sym = upper_sym;
  1375.                  (void) sscanf(temp, "%ld", &upper_bound);
  1376.                  upper_sym = -1; /* no sym table entry */
  1377.                 ;
  1378.     break;}
  1379. case 56:
  1380. #line 370 "web2c.yacc"
  1381. { lower_bound = upper_bound;
  1382.                   lower_sym = upper_sym;
  1383.                   upper_bound = sym_table[l_s].val;
  1384.                   upper_sym = l_s;
  1385.                 ;
  1386.     break;}
  1387. case 57:
  1388. #line 378 "web2c.yacc"
  1389. {if (last_type >= 0) {
  1390.         sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
  1391.         sym_table[last_type].upper = sym_table[l_s].upper;
  1392.         sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
  1393.         sym_table[last_type].val = sym_table[l_s].val;
  1394.         sym_table[last_type].val_sym = sym_table[l_s].val_sym;
  1395.      }
  1396.      my_output(last_id); ;
  1397.     break;}
  1398. case 58:
  1399. #line 390 "web2c.yacc"
  1400. { if (last_type >= 0)
  1401.             sym_table[last_type].var_not_needed = true;
  1402.             ;
  1403.     break;}
  1404. case 60:
  1405. #line 395 "web2c.yacc"
  1406. { if (last_type >= 0)
  1407.             sym_table[last_type].var_not_needed = true;
  1408.             ;
  1409.     break;}
  1410. case 61:
  1411. #line 399 "web2c.yacc"
  1412. { if (last_type >= 0)
  1413.             sym_table[last_type].var_not_needed = true;
  1414.             ;
  1415.     break;}
  1416. case 62:
  1417. #line 405 "web2c.yacc"
  1418. {if (last_type >= 0) {
  1419.         sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
  1420.         sym_table[last_type].upper = sym_table[l_s].upper;
  1421.         sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
  1422.         sym_table[last_type].val = sym_table[l_s].val;
  1423.         sym_table[last_type].val_sym = sym_table[l_s].val_sym;
  1424.      }
  1425.      my_output(last_id); my_output("*"); ;
  1426.     break;}
  1427. case 65:
  1428. #line 421 "web2c.yacc"
  1429. { compute_array_bounds(); ;
  1430.     break;}
  1431. case 66:
  1432. #line 423 "web2c.yacc"
  1433. { lower_bound = sym_table[l_s].val;
  1434.                   lower_sym = sym_table[l_s].val_sym;
  1435.                   upper_bound = sym_table[l_s].upper;
  1436.                   upper_sym = sym_table[l_s].upper_sym;
  1437.                   compute_array_bounds();
  1438.                 ;
  1439.     break;}
  1440. case 68:
  1441. #line 436 "web2c.yacc"
  1442. { my_output("struct"); my_output("{"); indent++;;
  1443.     break;}
  1444. case 69:
  1445. #line 438 "web2c.yacc"
  1446. { indent--; my_output("}"); semicolon(); ;
  1447.     break;}
  1448. case 72:
  1449. #line 446 "web2c.yacc"
  1450. { field_list[0] = 0; ;
  1451.     break;}
  1452. case 73:
  1453. #line 448 "web2c.yacc"
  1454. {
  1455.                   /*array_bounds[0] = 0;
  1456.                   array_offset[0] = 0;*/
  1457.                 ;
  1458.     break;}
  1459. case 74:
  1460. #line 453 "web2c.yacc"
  1461. { int i=0, j; char ltemp[80];
  1462.                   while(field_list[i++] == '!') {
  1463.                     j = 0;
  1464.                     while (field_list[i])
  1465.                         ltemp[j++] = field_list[i++];
  1466.                     i++;
  1467.                     if (field_list[i] == '!')
  1468.                         ltemp[j++] = ',';
  1469.                     ltemp[j] = 0;
  1470.                     my_output(ltemp);
  1471.                   }
  1472.                   semicolon();
  1473.                 ;
  1474.     break;}
  1475. case 78:
  1476. #line 474 "web2c.yacc"
  1477. { int i=0, j=0;
  1478.                   while (field_list[i] == '!')
  1479.                     while(field_list[i++]);
  1480.                   ii = add_to_table(last_id);
  1481.                   sym_table[ii].typ = field_id_tok;
  1482.                   field_list[i++] = '!';
  1483.                   while (last_id[j])
  1484.                     field_list[i++] = last_id[j++];
  1485.                   field_list[i++] = 0;
  1486.                   field_list[i++] = 0;
  1487.                 ;
  1488.     break;}
  1489. case 79:
  1490. #line 486 "web2c.yacc"
  1491. { int i=0, j=0;
  1492.                   while (field_list[i] == '!')
  1493.                     while(field_list[i++]);
  1494.                   field_list[i++] = '!';
  1495.                   while (last_id[j])
  1496.                     field_list[i++] = last_id[j++];
  1497.                   field_list[i++] = 0;
  1498.                   field_list[i++] = 0;
  1499.                 ;
  1500.     break;}
  1501. case 80:
  1502. #line 498 "web2c.yacc"
  1503. { my_output("file_ptr /* of "); ;
  1504.     break;}
  1505. case 81:
  1506. #line 500 "web2c.yacc"
  1507. { my_output("*/"); ;
  1508.     break;}
  1509. case 86:
  1510. #line 512 "web2c.yacc"
  1511. { var_list[0] = 0;
  1512.           array_bounds[0] = 0;
  1513.           array_offset[0] = 0;
  1514.           var_formals = false;
  1515.           ids_paramed = 0;
  1516.         ;
  1517.     break;}
  1518. case 87:
  1519. #line 519 "web2c.yacc"
  1520. {
  1521.           array_bounds[0] = 0;    
  1522.           array_offset[0] = 0;
  1523.         ;
  1524.     break;}
  1525. case 88:
  1526. #line 524 "web2c.yacc"
  1527. { fixup_var_list(); ;
  1528.     break;}
  1529. case 91:
  1530. #line 532 "web2c.yacc"
  1531. { int i=0, j=0;
  1532.                   ii = add_to_table(last_id);
  1533.                   sym_table[ii].typ = var_id_tok;
  1534.                   sym_table[ii].var_formal = var_formals;
  1535.                   param_id_list[ids_paramed++] = ii;
  1536.                     while (var_list[i] == '!')
  1537.                     while(var_list[i++]);
  1538.                   var_list[i++] = '!';
  1539.                   while (last_id[j])
  1540.                     var_list[i++] = last_id[j++];
  1541.                     var_list[i++] = 0;
  1542.                   var_list[i++] = 0;
  1543.                 ;
  1544.     break;}
  1545. case 92:
  1546. #line 546 "web2c.yacc"
  1547. { int i=0, j=0;
  1548.                   ii = add_to_table(last_id);
  1549.                     sym_table[ii].typ = var_id_tok;
  1550.                   sym_table[ii].var_formal = var_formals;
  1551.                   param_id_list[ids_paramed++] = ii;
  1552.                     while (var_list[i] == '!')
  1553.                     while (var_list[i++]);
  1554.                     var_list[i++] = '!';
  1555.                   while (last_id[j])
  1556.                     var_list[i++] = last_id[j++];
  1557.                     var_list[i++] = 0;
  1558.                   var_list[i++] = 0;
  1559.                 ;
  1560.     break;}
  1561. case 93:
  1562. #line 560 "web2c.yacc"
  1563. { int i=0, j=0;
  1564.                   ii = add_to_table(last_id);
  1565.                     sym_table[ii].typ = var_id_tok;
  1566.                   sym_table[ii].var_formal = var_formals;
  1567.                   param_id_list[ids_paramed++] = ii;
  1568.                     while (var_list[i] == '!')
  1569.                     while(var_list[i++]);
  1570.                     var_list[i++] = '!';
  1571.                   while (last_id[j])
  1572.                     var_list[i++] = last_id[j++];
  1573.                   var_list[i++] = 0;
  1574.                   var_list[i++] = 0;
  1575.                 ;
  1576.     break;}
  1577. case 95:
  1578. #line 578 "web2c.yacc"
  1579. { my_output ("void main_body() {");
  1580.           indent++;
  1581.           new_line ();
  1582.         ;
  1583.     break;}
  1584. case 96:
  1585. #line 583 "web2c.yacc"
  1586. { indent--;
  1587.                   my_output ("}");
  1588.                   new_line ();
  1589.                 ;
  1590.     break;}
  1591. case 100:
  1592. #line 595 "web2c.yacc"
  1593. { indent_line(); remove_locals(); ;
  1594.     break;}
  1595. case 101:
  1596. #line 597 "web2c.yacc"
  1597. { indent_line(); remove_locals(); ;
  1598.     break;}
  1599. case 103:
  1600. #line 605 "web2c.yacc"
  1601. { ii = add_to_table(last_id);
  1602.           if (debug)
  1603.             (void) fprintf(stderr, "%3d Procedure %s\n",
  1604.                   pf_count++, last_id);
  1605.           sym_table[ii].typ = proc_id_tok;
  1606.           (void) strcpy(my_routine, last_id);
  1607.           uses_eqtb = uses_mem = false;
  1608.           my_output("void");
  1609.           orig_std = std;
  1610.           std = 0;
  1611.         ;
  1612.     break;}
  1613. case 104:
  1614. #line 617 "web2c.yacc"
  1615. { (void) strcpy(fn_return_type, "void");
  1616.           do_proc_args();
  1617.           gen_function_head();;
  1618.     break;}
  1619. case 105:
  1620. #line 621 "web2c.yacc"
  1621. { ii = l_s; 
  1622.           if (debug)
  1623.             (void) fprintf(stderr, "%3d Procedure %s\n",
  1624.                                pf_count++, last_id);
  1625.           (void) strcpy(my_routine, last_id);
  1626.           my_output("void");
  1627.         ;
  1628.     break;}
  1629. case 106:
  1630. #line 629 "web2c.yacc"
  1631. { (void) strcpy(fn_return_type, "void");
  1632.           do_proc_args();
  1633.           gen_function_head();
  1634.             ;
  1635.     break;}
  1636. case 107:
  1637. #line 637 "web2c.yacc"
  1638. {
  1639.               (void) strcpy (z_id, last_id);
  1640.           mark ();
  1641.           ids_paramed = 0;
  1642.         ;
  1643.     break;}
  1644. case 108:
  1645. #line 643 "web2c.yacc"
  1646. { sprintf (z_id, "z%s", last_id);
  1647.           ids_paramed = 0;
  1648.           if (sym_table[ii].typ == proc_id_tok)
  1649.             sym_table[ii].typ = proc_param_tok;
  1650.           else if (sym_table[ii].typ == fun_id_tok)
  1651.             sym_table[ii].typ = fun_param_tok;
  1652.           mark();
  1653.         ;
  1654.     break;}
  1655. case 112:
  1656. #line 659 "web2c.yacc"
  1657. { ids_typed = ids_paramed;;
  1658.     break;}
  1659. case 113:
  1660. #line 661 "web2c.yacc"
  1661. { int i, need_var;
  1662.           i = search_table(last_id);
  1663.           need_var = !sym_table[i].var_not_needed;
  1664.           for (i=ids_typed; i<ids_paramed; i++)
  1665.                 {
  1666.               (void) strcpy(arg_type[i], last_id);
  1667.           if (need_var && sym_table[param_id_list[i]].var_formal)
  1668.                 (void) strcat(arg_type[i], " *");
  1669.           else
  1670.                     sym_table[param_id_list[i]].var_formal = false;
  1671.             }
  1672.         ;
  1673.     break;}
  1674. case 114:
  1675. #line 675 "web2c.yacc"
  1676. {var_formals = 0;;
  1677.     break;}
  1678. case 116:
  1679. #line 676 "web2c.yacc"
  1680. {var_formals = 1;;
  1681.     break;}
  1682. case 121:
  1683. #line 687 "web2c.yacc"
  1684. { orig_std = std;
  1685.                   std = 0;
  1686.                   ii = add_to_table(last_id);
  1687.                   if (debug)
  1688.                   (void) fprintf(stderr, "%3d Function %s\n",
  1689.                     pf_count++, last_id);
  1690.                     sym_table[ii].typ = fun_id_tok;
  1691.                   (void) strcpy(my_routine, last_id);
  1692.                   uses_eqtb = uses_mem = false;
  1693.                 ;
  1694.     break;}
  1695. case 122:
  1696. #line 698 "web2c.yacc"
  1697. { normal();
  1698.                   array_bounds[0] = 0;
  1699.                   array_offset[0] = 0;
  1700.                 ;
  1701.     break;}
  1702. case 123:
  1703. #line 703 "web2c.yacc"
  1704. {(void) strcpy(fn_return_type, yytext);
  1705.                  do_proc_args();
  1706.                  gen_function_head();
  1707.                 ;
  1708.     break;}
  1709. case 125:
  1710. #line 710 "web2c.yacc"
  1711. { orig_std = std;
  1712.                   std = 0;
  1713.                   ii = l_s;
  1714.                   if (debug)
  1715.                   (void) fprintf(stderr, "%3d Function %s\n",
  1716.                     pf_count++, last_id);
  1717.                   (void) strcpy(my_routine, last_id);
  1718.                   uses_eqtb = uses_mem = false;
  1719.                 ;
  1720.     break;}
  1721. case 126:
  1722. #line 720 "web2c.yacc"
  1723. { normal();
  1724.                   array_bounds[0] = 0;
  1725.                   array_offset[0] = 0;
  1726.                 ;
  1727.     break;}
  1728. case 127:
  1729. #line 725 "web2c.yacc"
  1730. {(void) strcpy(fn_return_type, yytext);
  1731.                  do_proc_args();
  1732.                  gen_function_head();
  1733.                 ;
  1734.     break;}
  1735. case 133:
  1736. #line 743 "web2c.yacc"
  1737. {my_output("{"); indent++; new_line();;
  1738.     break;}
  1739. case 134:
  1740. #line 745 "web2c.yacc"
  1741. { indent--; my_output("}"); new_line(); ;
  1742.     break;}
  1743. case 139:
  1744. #line 758 "web2c.yacc"
  1745. {if (!doreturn(temp)) {
  1746.                     (void) sprintf(safe_string, "lab%s:",
  1747.                     temp);
  1748.                     my_output(safe_string);
  1749.                  }
  1750.                 ;
  1751.     break;}
  1752. case 140:
  1753. #line 767 "web2c.yacc"
  1754. { semicolon(); ;
  1755.     break;}
  1756. case 141:
  1757. #line 769 "web2c.yacc"
  1758. { semicolon(); ;
  1759.     break;}
  1760. case 146:
  1761. #line 777 "web2c.yacc"
  1762. {my_output("break");;
  1763.     break;}
  1764. case 147:
  1765. #line 781 "web2c.yacc"
  1766. { my_output("="); ;
  1767.     break;}
  1768. case 149:
  1769. #line 784 "web2c.yacc"
  1770. { my_output("Result ="); ;
  1771.     break;}
  1772. case 151:
  1773. #line 789 "web2c.yacc"
  1774. { if (strcmp(last_id, "mem") == 0)
  1775.                     uses_mem = 1;
  1776.                   else if (strcmp(last_id, "eqtb") == 0)
  1777.                     uses_eqtb = 1;
  1778.                   if (sym_table[l_s].var_formal)
  1779.                     (void) putchar('*');
  1780.                   my_output(last_id);
  1781.                   yyval = ex_32;
  1782.                 ;
  1783.     break;}
  1784. case 153:
  1785. #line 800 "web2c.yacc"
  1786. { if (sym_table[l_s].var_formal)
  1787.                     (void) putchar('*');
  1788.                   my_output(last_id); yyval = ex_32; ;
  1789.     break;}
  1790. case 154:
  1791. #line 806 "web2c.yacc"
  1792. { yyval = ex_32; ;
  1793.     break;}
  1794. case 155:
  1795. #line 808 "web2c.yacc"
  1796. { yyval = ex_32; ;
  1797.     break;}
  1798. case 158:
  1799. #line 816 "web2c.yacc"
  1800. { my_output("["); ;
  1801.     break;}
  1802. case 159:
  1803. #line 818 "web2c.yacc"
  1804. { my_output("]"); ;
  1805.     break;}
  1806. case 160:
  1807. #line 820 "web2c.yacc"
  1808. {if (tex || mf) {
  1809.                    if (strcmp(last_id, "int")==0)
  1810.                     my_output(".cint");
  1811.                    else if (strcmp(last_id, "lh")==0)
  1812.                     my_output(".v.LH");
  1813.                    else if (strcmp(last_id, "rh")==0)
  1814.                     my_output(".v.RH");
  1815.                    else {
  1816.                      (void)sprintf(safe_string, ".%s", last_id);
  1817.                      my_output(safe_string);
  1818.                    }
  1819.                  }
  1820.                  else {
  1821.                     (void) sprintf(safe_string, ".%s", last_id);
  1822.                     my_output(safe_string);
  1823.                  }
  1824.                 ;
  1825.     break;}
  1826. case 161:
  1827. #line 838 "web2c.yacc"
  1828. { my_output(".hh.b0");;
  1829.     break;}
  1830. case 162:
  1831. #line 840 "web2c.yacc"
  1832. { my_output(".hh.b1");;
  1833.     break;}
  1834. case 164:
  1835. #line 845 "web2c.yacc"
  1836. { my_output("][");;
  1837.     break;}
  1838. case 166:
  1839. #line 850 "web2c.yacc"
  1840. { yyval = yyvsp[0]; ;
  1841.     break;}
  1842. case 167:
  1843. #line 851 "web2c.yacc"
  1844. {my_output("+");;
  1845.     break;}
  1846. case 168:
  1847. #line 852 "web2c.yacc"
  1848. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1849.     break;}
  1850. case 169:
  1851. #line 853 "web2c.yacc"
  1852. {my_output("-");;
  1853.     break;}
  1854. case 170:
  1855. #line 854 "web2c.yacc"
  1856. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1857.     break;}
  1858. case 171:
  1859. #line 855 "web2c.yacc"
  1860. {my_output("*");;
  1861.     break;}
  1862. case 172:
  1863. #line 856 "web2c.yacc"
  1864. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1865.     break;}
  1866. case 173:
  1867. #line 857 "web2c.yacc"
  1868. {my_output("/");;
  1869.     break;}
  1870. case 174:
  1871. #line 858 "web2c.yacc"
  1872. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1873.     break;}
  1874. case 175:
  1875. #line 859 "web2c.yacc"
  1876. {my_output("==");;
  1877.     break;}
  1878. case 176:
  1879. #line 860 "web2c.yacc"
  1880. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1881.     break;}
  1882. case 177:
  1883. #line 861 "web2c.yacc"
  1884. {my_output("!=");;
  1885.     break;}
  1886. case 178:
  1887. #line 862 "web2c.yacc"
  1888. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1889.     break;}
  1890. case 179:
  1891. #line 863 "web2c.yacc"
  1892. {my_output("%");;
  1893.     break;}
  1894. case 180:
  1895. #line 864 "web2c.yacc"
  1896. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1897.     break;}
  1898. case 181:
  1899. #line 865 "web2c.yacc"
  1900. {my_output("<");;
  1901.     break;}
  1902. case 182:
  1903. #line 866 "web2c.yacc"
  1904. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1905.     break;}
  1906. case 183:
  1907. #line 867 "web2c.yacc"
  1908. {my_output(">");;
  1909.     break;}
  1910. case 184:
  1911. #line 868 "web2c.yacc"
  1912. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1913.     break;}
  1914. case 185:
  1915. #line 869 "web2c.yacc"
  1916. {my_output("<=");;
  1917.     break;}
  1918. case 186:
  1919. #line 870 "web2c.yacc"
  1920. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1921.     break;}
  1922. case 187:
  1923. #line 871 "web2c.yacc"
  1924. {my_output(">=");;
  1925.     break;}
  1926. case 188:
  1927. #line 872 "web2c.yacc"
  1928. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1929.     break;}
  1930. case 189:
  1931. #line 873 "web2c.yacc"
  1932. {my_output("&&");;
  1933.     break;}
  1934. case 190:
  1935. #line 874 "web2c.yacc"
  1936. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1937.     break;}
  1938. case 191:
  1939. #line 875 "web2c.yacc"
  1940. {my_output("||");;
  1941.     break;}
  1942. case 192:
  1943. #line 876 "web2c.yacc"
  1944. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1945.     break;}
  1946. case 193:
  1947. #line 878 "web2c.yacc"
  1948. { my_output("/ ((double)"); ;
  1949.     break;}
  1950. case 194:
  1951. #line 880 "web2c.yacc"
  1952. {yyval = max(yyvsp[-3], yyvsp[0]); my_output(")"); ;
  1953.     break;}
  1954. case 195:
  1955. #line 882 "web2c.yacc"
  1956. { yyval = yyvsp[0]; ;
  1957.     break;}
  1958. case 197:
  1959. #line 887 "web2c.yacc"
  1960. { my_output("- (integer)"); ;
  1961.     break;}
  1962. case 198:
  1963. #line 889 "web2c.yacc"
  1964. { my_output("!"); ;
  1965.     break;}
  1966. case 199:
  1967. #line 893 "web2c.yacc"
  1968. { my_output("("); ;
  1969.     break;}
  1970. case 200:
  1971. #line 895 "web2c.yacc"
  1972. { my_output(")"); yyval = yyvsp[-3]; ;
  1973.     break;}
  1974. case 203:
  1975. #line 899 "web2c.yacc"
  1976. { my_output(last_id); my_output("()"); ;
  1977.     break;}
  1978. case 204:
  1979. #line 901 "web2c.yacc"
  1980. { my_output(last_id); ;
  1981.     break;}
  1982. case 206:
  1983. #line 906 "web2c.yacc"
  1984. { my_output("("); ;
  1985.     break;}
  1986. case 207:
  1987. #line 908 "web2c.yacc"
  1988. { my_output(")"); ;
  1989.     break;}
  1990. case 209:
  1991. #line 913 "web2c.yacc"
  1992. { my_output(","); ;
  1993.     break;}
  1994. case 214:
  1995. #line 926 "web2c.yacc"
  1996. { my_output(last_id); my_output("()"); ;
  1997.     break;}
  1998. case 215:
  1999. #line 928 "web2c.yacc"
  2000. { my_output(last_id);
  2001.                   ii = add_to_table(last_id);
  2002.                     sym_table[ii].typ = proc_id_tok;
  2003.                   my_output("()");
  2004.                 ;
  2005.     break;}
  2006. case 216:
  2007. #line 934 "web2c.yacc"
  2008. { my_output(last_id); ;
  2009.     break;}
  2010. case 218:
  2011. #line 939 "web2c.yacc"
  2012. {if (doreturn(temp)) {
  2013.                     if (strcmp(fn_return_type,"void"))
  2014.                     my_output("return(Result)");
  2015.                     else
  2016.                     my_output("return");
  2017.                  } else {
  2018.                      (void) sprintf(safe_string, "goto lab%s",
  2019.                     temp);
  2020.                      my_output(safe_string);
  2021.                  }
  2022.                 ;
  2023.     break;}
  2024. case 227:
  2025. #line 969 "web2c.yacc"
  2026. { my_output("if"); my_output("("); ;
  2027.     break;}
  2028. case 228:
  2029. #line 971 "web2c.yacc"
  2030. { my_output(")"); new_line();;
  2031.     break;}
  2032. case 230:
  2033. #line 976 "web2c.yacc"
  2034. { my_output("else"); ;
  2035.     break;}
  2036. case 232:
  2037. #line 981 "web2c.yacc"
  2038. { my_output("switch"); my_output("("); ;
  2039.     break;}
  2040. case 233:
  2041. #line 983 "web2c.yacc"
  2042. { my_output(")"); indent_line();
  2043.                   my_output("{"); indent++;
  2044.                 ;
  2045.     break;}
  2046. case 234:
  2047. #line 987 "web2c.yacc"
  2048. { indent--; my_output("}"); new_line(); ;
  2049.     break;}
  2050. case 237:
  2051. #line 995 "web2c.yacc"
  2052. { my_output("break"); semicolon(); ;
  2053.     break;}
  2054. case 240:
  2055. #line 1003 "web2c.yacc"
  2056. { my_output("case"); 
  2057.                   my_output(temp);
  2058.                   my_output(":"); indent_line();
  2059.                 ;
  2060.     break;}
  2061. case 241:
  2062. #line 1008 "web2c.yacc"
  2063. { my_output("default:"); indent_line(); ;
  2064.     break;}
  2065. case 247:
  2066. #line 1021 "web2c.yacc"
  2067. { my_output("while");
  2068.                   my_output("(");
  2069.                 ;
  2070.     break;}
  2071. case 248:
  2072. #line 1025 "web2c.yacc"
  2073. { my_output(")"); ;
  2074.     break;}
  2075. case 250:
  2076. #line 1030 "web2c.yacc"
  2077. { my_output("do"); my_output("{"); indent++; ;
  2078.     break;}
  2079. case 251:
  2080. #line 1032 "web2c.yacc"
  2081. { indent--; my_output("}"); 
  2082.                   my_output("while"); my_output("( ! (");
  2083.                 ;
  2084.     break;}
  2085. case 252:
  2086. #line 1036 "web2c.yacc"
  2087. { my_output(") )"); ;
  2088.     break;}
  2089. case 253:
  2090. #line 1040 "web2c.yacc"
  2091. {
  2092.                   my_output("{");
  2093.                   my_output("register");
  2094.                   my_output("integer");
  2095.                   if (strict_for)
  2096.                     my_output("for_begin,");
  2097.                   my_output("for_end;");
  2098.                  ;
  2099.     break;}
  2100. case 254:
  2101. #line 1049 "web2c.yacc"
  2102. { if (strict_for)
  2103.                     my_output("for_begin");
  2104.                   else
  2105.                     my_output(control_var);
  2106.                   my_output("="); ;
  2107.     break;}
  2108. case 255:
  2109. #line 1055 "web2c.yacc"
  2110. { my_output("; if (");
  2111.                   if (strict_for) my_output("for_begin");
  2112.                   else my_output(control_var);
  2113.                   my_output(relation);
  2114.                   my_output("for_end)");
  2115.                   if (strict_for) {
  2116.                     my_output("{");
  2117.                     my_output(control_var);
  2118.                     my_output("=");
  2119.                     my_output("for_begin");
  2120.                     semicolon();
  2121.                   }
  2122.                   my_output("do"); 
  2123.                   indent++; 
  2124.                   new_line();;
  2125.     break;}
  2126. case 256:
  2127. #line 1071 "web2c.yacc"
  2128. {
  2129.                   char *top = strrchr (for_stack, '#');
  2130.                   indent--;
  2131.                                   new_line();
  2132.                   my_output("while"); 
  2133.                   my_output("("); 
  2134.                   my_output(top+1); 
  2135.                   my_output(")"); 
  2136.                   my_output(";");
  2137.                   my_output("}");
  2138.                   if (strict_for)
  2139.                     my_output("}");
  2140.                   *top=0;
  2141.                   new_line();
  2142.                 ;
  2143.     break;}
  2144. case 257:
  2145. #line 1089 "web2c.yacc"
  2146. {(void) strcpy(control_var, last_id); ;
  2147.     break;}
  2148. case 258:
  2149. #line 1093 "web2c.yacc"
  2150. { my_output(";"); ;
  2151.     break;}
  2152. case 259:
  2153. #line 1095 "web2c.yacc"
  2154.                   (void) strcpy(relation, "<=");
  2155.                   my_output("for_end");
  2156.                   my_output("="); ;
  2157.     break;}
  2158. case 260:
  2159. #line 1100 "web2c.yacc"
  2160.                   (void) sprintf(for_stack + strlen(for_stack),
  2161.                     "#%s++ < for_end", control_var);
  2162.                 ;
  2163.     break;}
  2164. case 261:
  2165. #line 1105 "web2c.yacc"
  2166. { my_output(";"); ;
  2167.     break;}
  2168. case 262:
  2169. #line 1107 "web2c.yacc"
  2170. {
  2171.                   (void) strcpy(relation, ">=");
  2172.                   my_output("for_end");
  2173.                   my_output("="); ;
  2174.     break;}
  2175. case 263:
  2176. #line 1112 "web2c.yacc"
  2177.                   (void) sprintf(for_stack + strlen(for_stack),
  2178.                     "#%s-- > for_end", control_var);
  2179.                 ;
  2180.     break;}
  2181. }
  2182.    /* the action file gets copied in in place of this dollarsign */
  2183. #line 442 "/usr/local/gnu/lib/bison.simple"
  2184.  
  2185.   yyvsp -= yylen;
  2186.   yyssp -= yylen;
  2187. #ifdef YYLSP_NEEDED
  2188.   yylsp -= yylen;
  2189. #endif
  2190.  
  2191. #if YYDEBUG != 0
  2192.   if (yydebug)
  2193.     {
  2194.       short *ssp1 = yyss - 1;
  2195.       fprintf (stderr, "state stack now");
  2196.       while (ssp1 != yyssp)
  2197.     fprintf (stderr, " %d", *++ssp1);
  2198.       fprintf (stderr, "\n");
  2199.     }
  2200. #endif
  2201.  
  2202.   *++yyvsp = yyval;
  2203.  
  2204. #ifdef YYLSP_NEEDED
  2205.   yylsp++;
  2206.   if (yylen == 0)
  2207.     {
  2208.       yylsp->first_line = yylloc.first_line;
  2209.       yylsp->first_column = yylloc.first_column;
  2210.       yylsp->last_line = (yylsp-1)->last_line;
  2211.       yylsp->last_column = (yylsp-1)->last_column;
  2212.       yylsp->text = 0;
  2213.     }
  2214.   else
  2215.     {
  2216.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  2217.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  2218.     }
  2219. #endif
  2220.  
  2221.   /* Now "shift" the result of the reduction.
  2222.      Determine what state that goes to,
  2223.      based on the state we popped back to
  2224.      and the rule number reduced by.  */
  2225.  
  2226.   yyn = yyr1[yyn];
  2227.  
  2228.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  2229.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  2230.     yystate = yytable[yystate];
  2231.   else
  2232.     yystate = yydefgoto[yyn - YYNTBASE];
  2233.  
  2234.   goto yynewstate;
  2235.  
  2236. yyerrlab:   /* here on detecting error */
  2237.  
  2238.   if (! yyerrstatus)
  2239.     /* If not already recovering from an error, report this error.  */
  2240.     {
  2241.       ++yynerrs;
  2242.  
  2243. #ifdef YYERROR_VERBOSE
  2244.       yyn = yypact[yystate];
  2245.  
  2246.       if (yyn > YYFLAG && yyn < YYLAST)
  2247.     {
  2248.       int size = 0;
  2249.       char *msg;
  2250.       int x, count;
  2251.  
  2252.       count = 0;
  2253.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  2254.         if (yycheck[x + yyn] == x)
  2255.           size += strlen(yytname[x]) + 15, count++;
  2256.       msg = (char *) malloc(size + 15);
  2257.       if (msg != 0)
  2258.         {
  2259.           strcpy(msg, "parse error");
  2260.  
  2261.           if (count < 5)
  2262.         {
  2263.           count = 0;
  2264.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  2265.             if (yycheck[x + yyn] == x)
  2266.               {
  2267.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  2268.             strcat(msg, yytname[x]);
  2269.             strcat(msg, "'");
  2270.             count++;
  2271.               }
  2272.         }
  2273.           yyerror(msg);
  2274.           free(msg);
  2275.         }
  2276.       else
  2277.         yyerror ("parse error; also virtual memory exceeded");
  2278.     }
  2279.       else
  2280. #endif /* YYERROR_VERBOSE */
  2281.     yyerror("parse error");
  2282.     }
  2283.  
  2284.   goto yyerrlab1;
  2285. yyerrlab1:   /* here on error raised explicitly by an action */
  2286.  
  2287.   if (yyerrstatus == 3)
  2288.     {
  2289.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  2290.  
  2291.       /* return failure if at end of input */
  2292.       if (yychar == YYEOF)
  2293.     YYABORT;
  2294.  
  2295. #if YYDEBUG != 0
  2296.       if (yydebug)
  2297.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  2298. #endif
  2299.  
  2300.       yychar = YYEMPTY;
  2301.     }
  2302.  
  2303.   /* Else will try to reuse lookahead token
  2304.      after shifting the error token.  */
  2305.  
  2306.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  2307.  
  2308.   goto yyerrhandle;
  2309.  
  2310. yyerrdefault:  /* current state does not do anything special for the error token. */
  2311.  
  2312. #if 0
  2313.   /* This is wrong; only states that explicitly want error tokens
  2314.      should shift them.  */
  2315.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  2316.   if (yyn) goto yydefault;
  2317. #endif
  2318.  
  2319. yyerrpop:   /* pop the current state because it cannot handle the error token */
  2320.  
  2321.   if (yyssp == yyss) YYABORT;
  2322.   yyvsp--;
  2323.   yystate = *--yyssp;
  2324. #ifdef YYLSP_NEEDED
  2325.   yylsp--;
  2326. #endif
  2327.  
  2328. #if YYDEBUG != 0
  2329.   if (yydebug)
  2330.     {
  2331.       short *ssp1 = yyss - 1;
  2332.       fprintf (stderr, "Error: state stack now");
  2333.       while (ssp1 != yyssp)
  2334.     fprintf (stderr, " %d", *++ssp1);
  2335.       fprintf (stderr, "\n");
  2336.     }
  2337. #endif
  2338.  
  2339. yyerrhandle:
  2340.  
  2341.   yyn = yypact[yystate];
  2342.   if (yyn == YYFLAG)
  2343.     goto yyerrdefault;
  2344.  
  2345.   yyn += YYTERROR;
  2346.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  2347.     goto yyerrdefault;
  2348.  
  2349.   yyn = yytable[yyn];
  2350.   if (yyn < 0)
  2351.     {
  2352.       if (yyn == YYFLAG)
  2353.     goto yyerrpop;
  2354.       yyn = -yyn;
  2355.       goto yyreduce;
  2356.     }
  2357.   else if (yyn == 0)
  2358.     goto yyerrpop;
  2359.  
  2360.   if (yyn == YYFINAL)
  2361.     YYACCEPT;
  2362.  
  2363. #if YYDEBUG != 0
  2364.   if (yydebug)
  2365.     fprintf(stderr, "Shifting error token, ");
  2366. #endif
  2367.  
  2368.   *++yyvsp = yylval;
  2369. #ifdef YYLSP_NEEDED
  2370.   *++yylsp = yylloc;
  2371. #endif
  2372.  
  2373.   yystate = yyn;
  2374.   goto yynewstate;
  2375. }
  2376. #line 1117 "web2c.yacc"
  2377.  
  2378.  
  2379. static void compute_array_bounds()
  2380. {
  2381.     long lb;
  2382.     char tmp[200];
  2383.  
  2384.     if (lower_sym == -1) {    /* lower is a constant */
  2385.     lb = lower_bound - 1;
  2386.     if (lb==0) lb = -1;    /* Treat lower_bound==1 as if lower_bound==0 */
  2387.     if (upper_sym == -1)    /* both constants */
  2388.         (void) sprintf(tmp, "[%ld]", upper_bound - lb);
  2389.     else {            /* upper a symbol, lower constant */
  2390.         if (lb < 0)
  2391.         (void) sprintf(tmp, "[%s + %ld]",
  2392.                 symbol(upper_sym), (-lb));
  2393.         else
  2394.         (void) sprintf(tmp, "[%s - %ld]",
  2395.                 symbol(upper_sym), lb);
  2396.     }
  2397.     if (lower_bound < 0 || lower_bound > 1) {
  2398.         if (*array_bounds) {
  2399.         fprintf(stderr, "Cannot handle offset in second dimension\n");
  2400.         exit(1);
  2401.         }
  2402.         if (lower_bound < 0) {
  2403.         (void) sprintf(array_offset, "+%ld", -lower_bound);
  2404.         } else {
  2405.         (void) sprintf(array_offset, "-%ld", lower_bound);
  2406.         }
  2407.     }
  2408.     (void) strcat(array_bounds, tmp);
  2409.     }
  2410.     else {            /* lower is a symbol */
  2411.     if (upper_sym != -1)    /* both are symbols */
  2412.         (void) sprintf(tmp, "[%s - %s + 1]", symbol(upper_sym),
  2413.         symbol(lower_sym));
  2414.     else {            /* upper constant, lower symbol */
  2415.         (void) sprintf(tmp, "[%ld - %s]", upper_bound + 1,
  2416.         symbol(lower_sym));
  2417.     }
  2418.     if (*array_bounds) {
  2419.         fprintf(stderr, "Cannot handle symbolic offset in second dimension\n");
  2420.         exit(1);
  2421.     }
  2422.     (void) sprintf(array_offset, "- (int)(%s)", symbol(lower_sym));
  2423.     (void) strcat(array_bounds, tmp);
  2424.     }
  2425. }
  2426.  
  2427.  
  2428. /* Kludge around negative lower array bounds.  */
  2429.  
  2430. static void
  2431. fixup_var_list ()
  2432. {
  2433.   int i, j;
  2434.   char output_string[100], real_symbol[100];
  2435.  
  2436.   for (i = 0; var_list[i++] == '!'; )
  2437.     {
  2438.       for (j = 0; real_symbol[j++] = var_list[i++]; )
  2439.         ;
  2440.       if (*array_offset)
  2441.         {
  2442.           (void) fprintf (std, "\n#define %s (%s %s)\n  ",
  2443.                           real_symbol, next_temp, array_offset);
  2444.           (void) strcpy (real_symbol, next_temp);
  2445.           /* Add the temp to the symbol table, so that change files can
  2446.              use it later on if necessary.  */
  2447.           j = add_to_table (next_temp);
  2448.           sym_table[j].typ = var_id_tok;
  2449.           find_next_temp ();
  2450.         }
  2451.       (void) sprintf (output_string, "%s%s%c", real_symbol, array_bounds,
  2452.                       var_list[i] == '!' ? ',' : ' ');
  2453.       my_output (output_string);
  2454.   }
  2455.   semicolon ();
  2456. }
  2457.  
  2458.  
  2459. /* If we're not processing TeX, we return false.  Otherwise,
  2460.    return true if the label is "10" and we're not in one of four TeX
  2461.    routines where the line labeled "10" isn't the end of the routine.
  2462.    Otherwise, return 0.  */
  2463.    
  2464. static boolean
  2465. doreturn (label)
  2466.     char *label;
  2467. {
  2468.     return
  2469.       tex
  2470.       && STREQ (label, "10")
  2471.       && !STREQ (my_routine, "macrocall")
  2472.       && !STREQ (my_routine, "hpack")
  2473.       && !STREQ (my_routine, "vpackage")
  2474.       && !STREQ (my_routine, "trybreak");
  2475. }
  2476.  
  2477.  
  2478. /* Return the absolute value of a long.  */
  2479. static long 
  2480. my_labs (x)
  2481.   long x;
  2482. {
  2483.     if (x < 0L) return(-x);
  2484.     return(x);
  2485. }
  2486.  
  2487. static void
  2488. do_proc_args ()
  2489. {
  2490.   fprintf (coerce, "%s %s();\n", fn_return_type, z_id);
  2491. }
  2492.  
  2493. static void
  2494. gen_function_head()
  2495. {
  2496.     int i;
  2497.  
  2498.     if (strcmp(my_routine, z_id)) {
  2499.     fprintf(coerce, "#define %s(", my_routine);
  2500.     for (i=0; i<ids_paramed; i++) {
  2501.         if (i > 0)
  2502.         fprintf(coerce, ", %s", symbol(param_id_list[i]));
  2503.         else
  2504.         fprintf(coerce, "%s", symbol(param_id_list[i]));
  2505.     }
  2506.     fprintf(coerce, ") %s(", z_id);
  2507.     for (i=0; i<ids_paramed; i++) {
  2508.         if (i > 0)
  2509.         fputs(", ", coerce);
  2510.         fprintf(coerce, "(%s) ", arg_type[i]);
  2511.         fprintf(coerce, "%s(%s)",
  2512.             sym_table[param_id_list[i]].var_formal?"&":"",
  2513.             symbol(param_id_list[i]));
  2514.     }
  2515.     fprintf(coerce, ")\n");
  2516.     }
  2517.     std = orig_std;
  2518.     my_output(z_id);
  2519.     my_output("(");
  2520.     for (i=0; i<ids_paramed; i++) {
  2521.         if (i > 0) my_output(",");
  2522.         my_output(symbol(param_id_list[i]));
  2523.     }
  2524.     my_output(")");
  2525.     indent_line();
  2526.     for (i=0; i<ids_paramed; i++) {
  2527.         my_output(arg_type[i]);
  2528.         my_output(symbol(param_id_list[i]));
  2529.         semicolon();
  2530.     }
  2531. }
  2532.