
/*  A Bison parser, made from web2c.yacc  */

#define YYBISON 1  /* Identify Bison output.  */

#define	array_tok	258
#define	begin_tok	259
#define	case_tok	260
#define	const_tok	261
#define	do_tok	262
#define	downto_tok	263
#define	else_tok	264
#define	end_tok	265
#define	file_tok	266
#define	for_tok	267
#define	function_tok	268
#define	goto_tok	269
#define	if_tok	270
#define	label_tok	271
#define	of_tok	272
#define	procedure_tok	273
#define	program_tok	274
#define	record_tok	275
#define	repeat_tok	276
#define	then_tok	277
#define	to_tok	278
#define	type_tok	279
#define	until_tok	280
#define	var_tok	281
#define	while_tok	282
#define	others_tok	283
#define	r_num_tok	284
#define	i_num_tok	285
#define	string_literal_tok	286
#define	single_char_tok	287
#define	assign_tok	288
#define	two_dots_tok	289
#define	undef_id_tok	290
#define	var_id_tok	291
#define	proc_id_tok	292
#define	proc_param_tok	293
#define	fun_id_tok	294
#define	fun_param_tok	295
#define	const_id_tok	296
#define	type_id_tok	297
#define	hhb0_tok	298
#define	hhb1_tok	299
#define	field_id_tok	300
#define	define_tok	301
#define	field_tok	302
#define	break_tok	303
#define	not_eq_tok	304
#define	less_eq_tok	305
#define	great_eq_tok	306
#define	or_tok	307
#define	unary_plus_tok	308
#define	unary_minus_tok	309
#define	div_tok	310
#define	mod_tok	311
#define	and_tok	312
#define	not_tok	313

#line 19 "web2c.yacc"

#include "web2c.h"

#define YYDEBUG 1

#define	symbol(x)	sym_table[x].id
#define	MAX_ARGS	50

static char fn_return_type[50], for_stack[300], control_var[50],
            relation[3];
static char arg_type[MAX_ARGS][30];
static int last_type = -1, ids_typed;
char my_routine[100];	/* Name of routine being parsed, if any */
static char array_bounds[80], array_offset[80];
static int uses_mem, uses_eqtb, lower_sym, upper_sym;
static FILE *orig_std;
boolean doing_statements = false;
static boolean var_formals = false;
static int param_id_list[MAX_ARGS], ids_paramed=0;

extern char conditional[], temp[], *std_header;
extern int tex, mf, strict_for;
extern FILE *coerce;
extern char coerce_name[];
extern boolean debug;

static long my_labs();
static void compute_array_bounds(), fixup_var_list();
static void do_proc_args(), gen_function_head();
static boolean doreturn();


#ifndef YYLTYPE
typedef
  struct yyltype
    {
      int timestamp;
      int first_line;
      int first_column;
      int last_line;
      int last_column;
      char *text;
   }
  yyltype;

#define YYLTYPE yyltype
#endif

#ifndef YYSTYPE
#define YYSTYPE int
#endif
#include <stdio.h>

#ifndef __STDC__
#define const
#endif



#define	YYFINAL		417
#define	YYFLAG		-32768
#define	YYNTBASE	75

#define YYTRANSLATE(x) ((unsigned)(x) <= 313 ? yytranslate[x] : 239)

static const char yytranslate[] = {     0,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,    67,
    68,    60,    55,    69,    56,    74,    61,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,    73,    66,    51,
    49,    52,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    71,     2,    72,    70,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
    46,    47,    48,    50,    53,    54,    57,    58,    59,    62,
    63,    64,    65
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     1,     2,    13,    14,    17,    22,    27,    32,    39,
    44,    51,    56,    63,    68,    72,    73,    74,    75,    84,
    85,    86,    91,    93,    97,    99,   100,   103,   105,   108,
   109,   110,   117,   119,   121,   123,   125,   127,   129,   131,
   132,   135,   137,   140,   141,   142,   143,   151,   153,   155,
   157,   159,   163,   164,   166,   169,   171,   173,   175,   177,
   179,   181,   184,   191,   200,   202,   204,   206,   207,   212,
   214,   218,   219,   220,   226,   227,   229,   233,   235,   237,
   238,   243,   244,   247,   249,   252,   253,   254,   261,   263,
   267,   269,   271,   273,   274,   275,   281,   282,   284,   287,
   290,   293,   296,   297,   303,   304,   310,   311,   312,   317,
   319,   323,   324,   329,   330,   333,   334,   338,   340,   342,
   345,   346,   347,   348,   358,   359,   360,   361,   371,   373,
   375,   377,   381,   382,   387,   389,   393,   395,   399,   401,
   403,   405,   407,   409,   411,   413,   415,   416,   421,   422,
   427,   428,   432,   434,   436,   438,   440,   443,   444,   449,
   452,   455,   458,   460,   461,   466,   469,   470,   475,   476,
   481,   482,   487,   488,   493,   494,   499,   500,   505,   506,
   511,   512,   517,   518,   523,   524,   529,   530,   535,   536,
   541,   542,   547,   548,   553,   555,   557,   559,   561,   562,
   567,   569,   571,   573,   574,   578,   579,   584,   586,   587,
   592,   595,   598,   599,   601,   603,   604,   608,   611,   612,
   614,   616,   618,   620,   622,   624,   627,   628,   629,   636,
   637,   641,   642,   643,   651,   653,   657,   661,   663,   667,
   669,   671,   673,   676,   678,   680,   682,   683,   684,   691,
   692,   693,   700,   701,   702,   703,   713,   715,   716,   717,
   723,   724,   725
};

#endif

static const short yyrhs[] = {    -1,
     0,    78,    80,    76,    85,    89,    97,   124,    77,   133,
   131,     0,     0,    78,    79,     0,    46,    47,    35,    66,
     0,    46,    13,    35,    66,     0,    46,     6,    35,    66,
     0,    46,    13,    35,    67,    68,    66,     0,    46,    18,
    35,    66,     0,    46,    18,    35,    67,    68,    66,     0,
    46,    24,    35,    66,     0,    46,    24,    35,    49,   105,
    66,     0,    46,    26,    35,    66,     0,    19,    35,    66,
     0,     0,     0,     0,    82,    85,    89,    97,    83,   124,
    84,   158,     0,     0,     0,    16,    86,    87,    66,     0,
    88,     0,    87,    69,    88,     0,    30,     0,     0,     6,
    90,     0,    91,     0,    90,    91,     0,     0,     0,    92,
    35,    93,    49,    94,    66,     0,    30,     0,    29,     0,
    95,     0,    96,     0,    31,     0,    32,     0,    41,     0,
     0,    24,    98,     0,    99,     0,    98,    99,     0,     0,
     0,     0,   100,    35,   101,    49,   102,   103,    66,     0,
   104,     0,   109,     0,   105,     0,   108,     0,   107,    34,
   107,     0,     0,    58,     0,   106,    30,     0,    41,     0,
    42,     0,   111,     0,   114,     0,   122,     0,   110,     0,
    70,    42,     0,     3,    71,   112,    72,    17,   113,     0,
     3,    71,   112,    69,   112,    72,    17,   113,     0,   105,
     0,    42,     0,   103,     0,     0,    20,   115,   116,    10,
     0,   117,     0,   116,    66,   117,     0,     0,     0,   118,
   120,    73,   119,   103,     0,     0,   121,     0,   120,    69,
   121,     0,    35,     0,    45,     0,     0,    11,    17,   123,
   103,     0,     0,    26,   125,     0,   126,     0,   125,   126,
     0,     0,     0,   127,   129,    73,   128,   103,    66,     0,
   130,     0,   129,    69,   130,     0,    35,     0,    36,     0,
    45,     0,     0,     0,     4,   132,   161,    10,    74,     0,
     0,   134,     0,   133,   134,     0,   135,    66,     0,   148,
    66,     0,   136,    81,     0,     0,    18,    35,   137,   139,
    66,     0,     0,    18,   147,   138,   139,    66,     0,     0,
     0,    67,   140,   141,    68,     0,   144,     0,   141,    66,
   144,     0,     0,   143,   129,    73,    42,     0,     0,   145,
   142,     0,     0,    26,   146,   142,     0,    37,     0,    38,
     0,   149,    81,     0,     0,     0,     0,    13,    35,   150,
   139,    73,   151,   157,   152,    66,     0,     0,     0,     0,
    13,   156,   153,   139,    73,   154,   157,   155,    66,     0,
    39,     0,    40,     0,   103,     0,     4,   161,    10,     0,
     0,     4,   160,   161,    10,     0,   162,     0,   161,    66,
   162,     0,   164,     0,   163,    73,   164,     0,    30,     0,
   165,     0,   206,     0,   166,     0,   202,     0,   204,     0,
   205,     0,    48,     0,     0,   169,    33,   167,   177,     0,
     0,   171,    33,   168,   177,     0,     0,    36,   170,   172,
     0,    36,     0,    39,     0,    40,     0,   173,     0,   172,
   173,     0,     0,    71,   174,   177,   175,     0,    74,    45,
     0,    74,    43,     0,    74,    44,     0,    72,     0,     0,
    69,   176,   177,    72,     0,   192,   177,     0,     0,   177,
    55,   178,   177,     0,     0,   177,    56,   179,   177,     0,
     0,   177,    60,   180,   177,     0,     0,   177,    62,   181,
   177,     0,     0,   177,    49,   182,   177,     0,     0,   177,
    50,   183,   177,     0,     0,   177,    63,   184,   177,     0,
     0,   177,    51,   185,   177,     0,     0,   177,    52,   186,
   177,     0,     0,   177,    53,   187,   177,     0,     0,   177,
    54,   188,   177,     0,     0,   177,    64,   189,   177,     0,
     0,   177,    57,   190,   177,     0,     0,   177,    61,   191,
   177,     0,   193,     0,    58,     0,    59,     0,    65,     0,
     0,    67,   194,   177,    68,     0,   169,     0,    94,     0,
    39,     0,     0,    40,   195,   196,     0,     0,    67,   197,
   198,    68,     0,   200,     0,     0,   198,    69,   199,   200,
     0,   177,   201,     0,    73,    30,     0,     0,    37,     0,
    35,     0,     0,    38,   203,   196,     0,    14,    30,     0,
     0,   159,     0,   207,     0,   222,     0,   208,     0,   214,
     0,   209,     0,   209,   212,     0,     0,     0,    15,   210,
   177,   211,    22,   162,     0,     0,     9,   213,   162,     0,
     0,     0,     5,   215,   177,    17,   216,   217,   221,     0,
   218,     0,   217,    66,   218,     0,   219,    73,   164,     0,
   220,     0,   219,    69,   220,     0,    30,     0,    28,     0,
    10,     0,    66,    10,     0,   223,     0,   226,     0,   229,
     0,     0,     0,    27,   224,   177,   225,     7,   162,     0,
     0,     0,    21,   227,   161,    25,   228,   177,     0,     0,
     0,     0,    12,   230,   233,    33,   231,   234,     7,   232,
   162,     0,    36,     0,     0,     0,   177,   235,    23,   236,
   177,     0,     0,     0,   177,   237,     8,   238,   177,     0
};

#if YYDEBUG != 0
static const short yyrline[] = { 0,
    55,    61,    65,    69,    71,    74,    80,    85,    90,    95,
   100,   105,   110,   119,   126,   130,   135,   151,   156,   187,
   188,   190,   194,   195,   198,   202,   203,   207,   208,   211,
   214,   218,   223,   231,   235,   237,   241,   255,   273,   277,
   278,   281,   282,   285,   288,   294,   298,   310,   311,   314,
   353,   356,   359,   360,   363,   369,   377,   388,   393,   394,
   398,   404,   415,   416,   420,   422,   431,   435,   437,   441,
   442,   445,   447,   453,   466,   469,   470,   473,   485,   497,
   500,   503,   504,   507,   508,   511,   518,   523,   527,   528,
   531,   545,   559,   575,   577,   582,   589,   590,   591,   594,
   596,   600,   603,   616,   620,   628,   635,   642,   651,   654,
   655,   658,   660,   675,   676,   676,   677,   679,   680,   683,
   686,   697,   703,   708,   708,   719,   725,   730,   732,   733,
   736,   739,   742,   744,   748,   749,   752,   753,   757,   766,
   768,   772,   773,   774,   775,   776,   780,   783,   783,   786,
   788,   799,   799,   805,   807,   811,   812,   815,   817,   819,
   837,   839,   843,   844,   846,   849,   851,   852,   853,   854,
   855,   856,   857,   858,   859,   860,   861,   862,   863,   864,
   865,   866,   867,   868,   869,   870,   871,   872,   873,   874,
   875,   876,   877,   880,   881,   885,   886,   888,   892,   894,
   896,   897,   898,   900,   903,   905,   907,   911,   912,   915,
   917,   921,   922,   925,   927,   933,   936,   938,   952,   955,
   956,   957,   960,   961,   964,   965,   968,   971,   972,   975,
   978,   980,   982,   986,   990,   991,   994,   998,   999,  1002,
  1007,  1011,  1012,  1015,  1016,  1017,  1020,  1025,  1026,  1029,
  1031,  1036,  1039,  1048,  1054,  1071,  1088,  1092,  1095,  1100,
  1104,  1107,  1112
};

static const char * const yytname[] = {   "$","error","$illegal.","array_tok",
"begin_tok","case_tok","const_tok","do_tok","downto_tok","else_tok","end_tok",
"file_tok","for_tok","function_tok","goto_tok","if_tok","label_tok","of_tok",
"procedure_tok","program_tok","record_tok","repeat_tok","then_tok","to_tok",
"type_tok","until_tok","var_tok","while_tok","others_tok","r_num_tok","i_num_tok",
"string_literal_tok","single_char_tok","assign_tok","two_dots_tok","undef_id_tok",
"var_id_tok","proc_id_tok","proc_param_tok","fun_id_tok","fun_param_tok","const_id_tok",
"type_id_tok","hhb0_tok","hhb1_tok","field_id_tok","define_tok","field_tok",
"break_tok","'='","not_eq_tok","'<'","'>'","less_eq_tok","great_eq_tok","'+'",
"'-'","or_tok","unary_plus_tok","unary_minus_tok","'*'","'/'","div_tok","mod_tok",
"and_tok","not_tok","';'","'('","')'","','","'^'","'['","']'","':'","'.'","PROGRAM",
"@1","@2","DEFS","DEF","PROGRAM_HEAD","BLOCK","@3","@4","@5","LABEL_DEC_PART",
"@6","LABEL_LIST","LABEL","CONST_DEC_PART","CONST_DEC_LIST","CONST_DEC","@7",
"@8","CONSTANT","STRING","CONSTANT_ID","TYPE_DEC_PART","TYPE_DEF_LIST","TYPE_DEF",
"@9","@10","@11","TYPE","SIMPLE_TYPE","SUBRANGE_TYPE","POSSIBLE_PLUS","SUB_CONSTANT",
"TYPE_ID","STRUCTURED_TYPE","POINTER_TYPE","ARRAY_TYPE","INDEX_TYPE","COMPONENT_TYPE",
"RECORD_TYPE","@12","FIELD_LIST","RECORD_SECTION","@13","@14","FIELD_ID_LIST",
"FIELD_ID","FILE_TYPE","@15","VAR_DEC_PART","VAR_DEC_LIST","VAR_DEC","@16","@17",
"VAR_ID_DEC_LIST","VAR_ID","BODY","@18","P_F_DEC_PART","P_F_DEC","PROCEDURE_DEC",
"PROCEDURE_HEAD","@19","@20","PARAM","@21","FORM_PAR_SEC_L","FORM_PAR_SEC1",
"@22","FORM_PAR_SEC","@23","@24","DECLARED_PROC","FUNCTION_DEC","FUNCTION_HEAD",
"@25","@26","@27","@28","@29","@30","DECLARED_FUN","RESULT_TYPE","STAT_PART",
"COMPOUND_STAT","@31","STAT_LIST","STATEMENT","S_LABEL","UNLAB_STAT","SIMPLE_STAT",
"ASSIGN_STAT","@32","@33","VARIABLE","@34","FUNC_ID_AS","VAR_DESIG_LIST","VAR_DESIG",
"@35","VAR_DESIG1","@36","EXPRESS","@37","@38","@39","@40","@41","@42","@43",
"@44","@45","@46","@47","@48","@49","@50","UNARY_OP","FACTOR","@51","@52","PARAM_LIST",
"@53","ACTUAL_PARAM_L","@54","ACTUAL_PARAM","WIDTH_FIELD","PROC_STAT","@55",
"GO_TO_STAT","EMPTY_STAT","STRUCT_STAT","CONDIT_STAT","IF_STATEMENT","BEGIN_IF_STAT",
"@56","@57","ELSE_STAT","@58","CASE_STATEMENT","@59","@60","CASE_EL_LIST","CASE_ELEMENT",
"CASE_LAB_LIST","CASE_LAB","END_CASE","REPETIT_STAT","WHILE_STATEMENT","@61",
"@62","REP_STATEMENT","@63","@64","FOR_STATEMENT","@65","@66","@67","CONTROL_VAR",
"FOR_LIST","@68","@69","@70","@71",""
};
#endif

static const short yyr1[] = {     0,
    76,    77,    75,    78,    78,    79,    79,    79,    79,    79,
    79,    79,    79,    79,    80,    82,    83,    84,    81,    85,
    86,    85,    87,    87,    88,    89,    89,    90,    90,    92,
    93,    91,    94,    94,    94,    94,    95,    95,    96,    97,
    97,    98,    98,   100,   101,   102,    99,   103,   103,   104,
   104,   105,   106,   106,   107,   107,   108,   109,   109,   109,
   109,   110,   111,   111,   112,   112,   113,   115,   114,   116,
   116,   118,   119,   117,   117,   120,   120,   121,   121,   123,
   122,   124,   124,   125,   125,   127,   128,   126,   129,   129,
   130,   130,   130,   131,   132,   131,   133,   133,   133,   134,
   134,   135,   137,   136,   138,   136,   139,   140,   139,   141,
   141,   143,   142,   145,   144,   146,   144,   147,   147,   148,
   150,   151,   152,   149,   153,   154,   155,   149,   156,   156,
   157,   158,   160,   159,   161,   161,   162,   162,   163,   164,
   164,   165,   165,   165,   165,   165,   167,   166,   168,   166,
   170,   169,   169,   171,   171,   172,   172,   174,   173,   173,
   173,   173,   175,   176,   175,   177,   178,   177,   179,   177,
   180,   177,   181,   177,   182,   177,   183,   177,   184,   177,
   185,   177,   186,   177,   187,   177,   188,   177,   189,   177,
   190,   177,   191,   177,   177,   192,   192,   192,   194,   193,
   193,   193,   193,   195,   193,   197,   196,   198,   199,   198,
   200,   201,   201,   202,   202,   203,   202,   204,   205,   206,
   206,   206,   207,   207,   208,   208,   210,   211,   209,   213,
   212,   215,   216,   214,   217,   217,   218,   219,   219,   220,
   220,   221,   221,   222,   222,   222,   224,   225,   223,   227,
   228,   226,   230,   231,   232,   229,   233,   235,   236,   234,
   237,   238,   234
};

static const short yyr2[] = {     0,
     0,     0,    10,     0,     2,     4,     4,     4,     6,     4,
     6,     4,     6,     4,     3,     0,     0,     0,     8,     0,
     0,     4,     1,     3,     1,     0,     2,     1,     2,     0,
     0,     6,     1,     1,     1,     1,     1,     1,     1,     0,
     2,     1,     2,     0,     0,     0,     7,     1,     1,     1,
     1,     3,     0,     1,     2,     1,     1,     1,     1,     1,
     1,     2,     6,     8,     1,     1,     1,     0,     4,     1,
     3,     0,     0,     5,     0,     1,     3,     1,     1,     0,
     4,     0,     2,     1,     2,     0,     0,     6,     1,     3,
     1,     1,     1,     0,     0,     5,     0,     1,     2,     2,
     2,     2,     0,     5,     0,     5,     0,     0,     4,     1,
     3,     0,     4,     0,     2,     0,     3,     1,     1,     2,
     0,     0,     0,     9,     0,     0,     0,     9,     1,     1,
     1,     3,     0,     4,     1,     3,     1,     3,     1,     1,
     1,     1,     1,     1,     1,     1,     0,     4,     0,     4,
     0,     3,     1,     1,     1,     1,     2,     0,     4,     2,
     2,     2,     1,     0,     4,     2,     0,     4,     0,     4,
     0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
     0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
     0,     4,     0,     4,     1,     1,     1,     1,     0,     4,
     1,     1,     1,     0,     3,     0,     4,     1,     0,     4,
     2,     2,     0,     1,     1,     0,     3,     2,     0,     1,
     1,     1,     1,     1,     1,     2,     0,     0,     6,     0,
     3,     0,     0,     7,     1,     3,     3,     1,     3,     1,
     1,     1,     2,     1,     1,     1,     0,     0,     6,     0,
     0,     6,     0,     0,     0,     9,     1,     0,     0,     5,
     0,     0,     5
};

static const short yydefact[] = {     4,
     0,     0,     0,     5,     1,     0,     0,     0,     0,     0,
     0,     0,    20,    15,     0,     0,     0,     0,     0,     0,
    21,    26,     8,     7,     0,    10,     0,    53,    12,    14,
     6,     0,    30,    40,     0,     0,    56,    54,     0,     0,
     0,    25,     0,    23,    27,    28,     0,    44,    82,     9,
    11,    13,    55,    53,    22,     0,    29,    31,    41,    42,
     0,    86,     2,    52,    24,     0,    43,    45,    83,    84,
     0,    97,     0,     0,    85,    91,    92,    93,     0,    89,
     0,     0,    94,    98,     0,    16,     0,    16,    34,    33,
    37,    38,    39,     0,    35,    36,    46,     0,    87,   121,
   129,   130,   125,   103,   118,   119,   105,    95,     3,    99,
   100,   102,    20,   101,   120,    32,    53,    90,    53,   107,
   107,   107,   107,   219,    26,     0,     0,    68,    57,     0,
     0,    48,    50,    51,    49,    61,    58,    59,    60,     0,
   108,     0,     0,     0,     0,   133,   232,   253,     0,   227,
   250,   247,   139,   215,   153,   214,   216,   154,   155,   146,
   220,     0,   135,     0,   137,   140,   142,     0,     0,   143,
   144,   145,   141,   221,   223,   225,   224,   222,   244,   245,
   246,    40,    53,    80,    72,    62,    47,    88,   114,   122,
   126,   104,   106,   219,     0,     0,   218,     0,   219,     0,
     0,     0,     0,   219,   219,   147,   149,   230,   226,    17,
    66,    65,     0,    53,     0,    70,     0,   116,     0,   110,
   112,    53,    53,     0,   203,   204,   196,   197,   198,   199,
   202,   201,     0,     0,   195,   257,     0,   228,     0,   248,
   158,     0,   152,   156,   206,   217,    96,   136,   138,     0,
     0,   219,    82,    53,     0,    81,    69,    72,    78,    79,
     0,    76,   112,   114,   109,   115,     0,   131,   123,   127,
   134,     0,     0,   233,   175,   177,   181,   183,   185,   187,
   167,   169,   191,   171,   193,   173,   179,   189,   166,   254,
     0,   251,     0,     0,   161,   162,   160,   157,     0,   148,
   150,   231,    18,     0,    53,    71,     0,    73,   117,   111,
     0,     0,     0,   205,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,   219,     0,   219,     0,   213,     0,   208,     0,     0,
    67,    63,    77,    53,     0,   124,   128,   200,   241,   240,
     0,   235,     0,   238,   176,   178,   182,   184,   186,   188,
   168,   170,   192,   172,   194,   174,   180,   190,   258,     0,
   229,   252,   249,   164,   163,   159,     0,   211,   207,   209,
   219,    19,    53,    74,   113,   242,     0,   234,     0,   219,
     0,     0,   255,     0,   212,     0,     0,    64,   243,   236,
   239,   237,   259,   262,   219,     0,   210,   132,     0,     0,
   256,   165,   260,   263,     0,     0,     0
};

static const short yydefgoto[] = {   415,
    13,    72,     1,     4,     5,   112,   113,   253,   339,    22,
    32,    43,    44,    34,    45,    46,    47,    66,   231,    95,
    96,    49,    59,    60,    61,    74,   117,   268,   132,   133,
    40,    41,   134,   135,   136,   137,   213,   342,   138,   185,
   215,   216,   217,   344,   261,   262,   139,   214,    63,    69,
    70,    71,   119,    79,    80,   109,   124,    83,    84,    85,
    86,   122,   123,   142,   189,   219,   266,   267,   220,   221,
   263,   107,    87,    88,   120,   222,   312,   121,   223,   313,
   103,   269,   382,   161,   194,   162,   163,   164,   165,   166,
   167,   250,   251,   232,   201,   169,   243,   244,   294,   376,
   394,   336,   323,   324,   326,   328,   317,   318,   329,   319,
   320,   321,   322,   330,   325,   327,   234,   235,   273,   272,
   246,   299,   337,   396,   338,   378,   170,   202,   171,   172,
   173,   174,   175,   176,   198,   291,   209,   252,   177,   195,
   316,   351,   352,   353,   354,   388,   178,   179,   200,   293,
   180,   199,   333,   181,   196,   331,   405,   237,   370,   391,
   409,   392,   410
};

static const short yypact[] = {-32768,
     4,   -29,    27,-32768,-32768,   -47,    20,    33,    52,    62,
    72,   114,   141,-32768,   108,    53,    60,    16,   112,   122,
-32768,   158,-32768,-32768,   132,-32768,   139,    28,-32768,-32768,
-32768,   187,-32768,   167,   157,   160,-32768,-32768,   165,   190,
   204,-32768,    78,-32768,   212,-32768,   213,-32768,   235,-32768,
-32768,-32768,-32768,    28,-32768,   187,-32768,-32768,   224,-32768,
   227,-32768,-32768,-32768,-32768,   214,-32768,-32768,   117,-32768,
   120,    43,   184,   215,-32768,-32768,-32768,-32768,    35,-32768,
    44,   142,   150,-32768,   199,-32768,   205,-32768,-32768,-32768,
-32768,-32768,-32768,   206,-32768,-32768,-32768,   120,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,   141,-32768,-32768,-32768,     2,-32768,     2,   203,
   203,   203,   203,   146,   158,   202,   259,-32768,-32768,   232,
   225,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   226,
-32768,   207,   228,   234,   237,-32768,-32768,-32768,   248,-32768,
-32768,-32768,-32768,-32768,    98,-32768,-32768,-32768,-32768,-32768,
-32768,    -2,-32768,   231,-32768,-32768,-32768,   246,   265,-32768,
-32768,-32768,-32768,-32768,-32768,   290,-32768,-32768,-32768,-32768,
-32768,   167,     0,-32768,     1,-32768,-32768,-32768,   289,-32768,
-32768,-32768,-32768,   146,   210,   280,-32768,   210,   146,   210,
   119,   255,   249,   146,   197,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,   123,     2,     5,-32768,    14,-32768,   161,-32768,
-32768,     2,     2,     7,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,    61,   210,-32768,-32768,   291,   301,    -9,   301,
-32768,   154,   119,-32768,-32768,-32768,-32768,-32768,-32768,   210,
   210,   146,   235,     0,   308,-32768,-32768,     1,-32768,-32768,
    36,-32768,-32768,   289,-32768,-32768,   120,-32768,-32768,-32768,
-32768,   255,   210,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
   304,-32768,   320,   210,-32768,-32768,-32768,-32768,   210,   301,
   301,-32768,-32768,   256,     2,-32768,    14,-32768,-32768,-32768,
    97,   273,   274,-32768,   281,   230,   210,   210,   210,   210,
   210,   210,   210,   210,   210,   210,   210,   210,   210,   210,
   210,   146,   210,   146,   233,   -25,   175,-32768,   342,   330,
-32768,-32768,-32768,     2,   306,-32768,-32768,-32768,-32768,-32768,
    10,-32768,   102,-32768,   317,   317,   317,   317,   317,   317,
   192,   192,   192,-32768,-32768,-32768,-32768,-32768,    39,   352,
-32768,   301,-32768,-32768,-32768,-32768,   345,-32768,-32768,-32768,
   146,-32768,     2,-32768,-32768,-32768,    24,-32768,   230,   197,
   337,   368,-32768,   210,-32768,   210,    11,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   146,   257,-32768,-32768,   210,   210,
-32768,-32768,   301,   301,   382,   383,-32768
};

static const short yypgoto[] = {-32768,
-32768,-32768,-32768,-32768,-32768,   296,-32768,-32768,-32768,   272,
-32768,-32768,   331,   261,-32768,   343,-32768,-32768,   316,-32768,
-32768,   208,-32768,   332,-32768,-32768,-32768,  -116,-32768,   -24,
-32768,   338,-32768,-32768,-32768,-32768,   140,    12,-32768,-32768,
-32768,   135,-32768,-32768,-32768,    89,-32768,-32768,   144,-32768,
   329,-32768,-32768,   133,   303,-32768,-32768,-32768,   319,-32768,
-32768,-32768,-32768,    82,-32768,-32768,   136,-32768,   143,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,   180,-32768,-32768,-32768,  -185,  -186,-32768,  -203,-32768,
-32768,-32768,-32768,  -124,-32768,-32768,-32768,   162,-32768,-32768,
-32768,  -188,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
   134,-32768,-32768,-32768,     8,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,    21,-32768,    22,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768
};


#define	YYLAST		411


static const short yytable[] = {   168,
   131,   249,   140,    39,   126,     6,   233,   203,   224,   238,
   -75,   240,   127,   239,   257,   292,   271,   248,    14,   386,
   408,   128,     2,   275,   276,   277,   278,   279,   280,   281,
   282,   283,     7,   399,   284,   285,   286,   287,   288,     8,
    37,   211,    37,   129,     9,   289,  -261,   377,   259,     3,
    10,   349,    11,   350,    15,    81,   204,    38,   260,    38,
    82,   300,   301,   204,    28,   302,   -75,    16,    37,   168,
   258,   130,   204,    12,   168,   387,   204,   274,   100,   168,
   168,    29,   101,   102,   315,    38,    17,   275,   276,   277,
   278,   279,   280,   281,   282,   283,    18,   256,   284,   285,
   286,   287,   288,    98,   307,   335,    19,    99,   308,   275,
   276,   277,   278,   279,   280,   281,   282,   283,    24,    25,
   284,   285,   286,   287,   288,    26,    27,   168,   355,   356,
   357,   358,   359,   360,   361,   362,   363,   364,   365,   366,
   367,   368,   369,    55,   372,   371,    56,   373,    20,   146,
   147,   -86,   -86,   108,    76,    77,    21,   148,   212,   149,
   150,   -86,    81,    33,    78,    98,   151,    82,  -151,   345,
   389,  -151,   152,    23,   390,   153,   104,    30,   105,   106,
   154,   155,   156,   157,   158,   159,   402,    31,   341,   241,
    48,   254,   242,   160,   255,   397,   295,   296,   297,    35,
   146,   147,   143,   144,   145,   406,    36,   168,   148,   168,
   149,   150,    89,    90,    91,    92,    42,   151,   411,    53,
   413,   414,    50,   152,    93,    51,   264,   384,   265,   212,
    52,   154,   155,   156,   157,   158,   159,    54,    89,    90,
    91,    92,   379,   380,   160,   155,   -30,    58,   225,   226,
    93,   284,   285,   286,   287,   288,   168,   349,   -44,   350,
    62,    68,    73,    97,   111,   168,   341,   227,   228,   141,
   114,   116,   183,   186,   229,   184,   230,   197,   206,   190,
   168,   275,   276,   277,   278,   279,   280,   281,   282,   283,
   187,   188,   284,   285,   286,   287,   288,   207,   208,   192,
   191,   374,   193,   205,   375,   275,   276,   277,   278,   279,
   280,   281,   282,   283,   218,   236,   284,   285,   286,   287,
   288,   245,   247,   290,   305,   332,   334,   340,   412,   275,
   276,   277,   278,   279,   280,   281,   282,   283,   346,   347,
   284,   285,   286,   287,   288,   381,   383,   385,   348,   275,
   276,   277,   278,   279,   280,   281,   282,   283,   393,   403,
   284,   285,   286,   287,   288,-32768,-32768,-32768,-32768,-32768,
-32768,   281,   282,   283,   395,   404,   284,   285,   286,   287,
   288,   416,   417,   115,   125,   182,    65,    57,    94,   210,
    67,    64,   306,   304,   398,   343,   303,    75,   309,   311,
   118,   110,   270,   407,   298,   314,   310,   400,     0,     0,
   401
};

static const short yycheck[] = {   124,
   117,   205,   119,    28,     3,    35,   195,    10,   194,   198,
    10,   200,    11,   199,    10,    25,    10,   204,    66,    10,
    10,    20,    19,    49,    50,    51,    52,    53,    54,    55,
    56,    57,     6,    10,    60,    61,    62,    63,    64,    13,
    41,    42,    41,    42,    18,   234,     8,    73,    35,    46,
    24,    28,    26,    30,    35,    13,    66,    58,    45,    58,
    18,   250,   251,    66,    49,   252,    66,    35,    41,   194,
    66,    70,    66,    47,   199,    66,    66,    17,    35,   204,
   205,    66,    39,    40,   273,    58,    35,    49,    50,    51,
    52,    53,    54,    55,    56,    57,    35,   214,    60,    61,
    62,    63,    64,    69,    69,   294,    35,    73,    73,    49,
    50,    51,    52,    53,    54,    55,    56,    57,    66,    67,
    60,    61,    62,    63,    64,    66,    67,   252,   317,   318,
   319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
   329,   330,   331,    66,   333,   332,    69,   334,    35,     4,
     5,    35,    36,     4,    35,    36,    16,    12,   183,    14,
    15,    45,    13,     6,    45,    69,    21,    18,    71,    73,
    69,    74,    27,    66,    73,    30,    35,    66,    37,    38,
    35,    36,    37,    38,    39,    40,   390,    66,   305,    71,
    24,    69,    74,    48,    72,   381,    43,    44,    45,    68,
     4,     5,   121,   122,   123,   394,    68,   332,    12,   334,
    14,    15,    29,    30,    31,    32,    30,    21,   405,    30,
   409,   410,    66,    27,    41,    66,    66,   344,    68,   254,
    66,    35,    36,    37,    38,    39,    40,    34,    29,    30,
    31,    32,    68,    69,    48,    36,    35,    35,    39,    40,
    41,    60,    61,    62,    63,    64,   381,    28,    35,    30,
    26,    35,    49,    49,    66,   390,   383,    58,    59,    67,
    66,    66,    71,    42,    65,    17,    67,    30,    33,    73,
   405,    49,    50,    51,    52,    53,    54,    55,    56,    57,
    66,    66,    60,    61,    62,    63,    64,    33,     9,    66,
    73,    69,    66,    73,    72,    49,    50,    51,    52,    53,
    54,    55,    56,    57,    26,    36,    60,    61,    62,    63,
    64,    67,    74,    33,    17,    22,     7,    72,    72,    49,
    50,    51,    52,    53,    54,    55,    56,    57,    66,    66,
    60,    61,    62,    63,    64,     4,    17,    42,    68,    49,
    50,    51,    52,    53,    54,    55,    56,    57,     7,    23,
    60,    61,    62,    63,    64,    49,    50,    51,    52,    53,
    54,    55,    56,    57,    30,     8,    60,    61,    62,    63,
    64,     0,     0,    88,   113,   125,    56,    45,    73,   182,
    59,    54,   258,   254,   383,   307,   253,    69,   263,   267,
    98,    83,   223,   396,   243,   272,   264,   387,    -1,    -1,
   389
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 1, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */


#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	return(0)
#define YYABORT 	return(1)
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    { yychar = (token), yylval = (value);			\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

#ifndef YYPURE
#define YYLEX		yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX		yylex(&yylval, &yylloc)
#else
#define YYLEX		yylex(&yylval)
#endif
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	yychar;			/*  the lookahead symbol		*/
YYSTYPE	yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __yy_bcopy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (char *from, char *to, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 169 "bison.simple"
int
yyparse()
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YYSTYPE *yyvsp;
  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
  int yychar1;		/*  lookahead token as an internal (translated) token number */

  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/

  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YYLSP_NEEDED
  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YYPURE
  int yychar;
  YYSTYPE yylval;
  int yynerrs;
#ifdef YYLSP_NEEDED
  YYLTYPE yylloc;
#endif
#endif

  YYSTYPE yyval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int yylen;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Starting parse\n");
#endif

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YYLSP_NEEDED
  yylsp = yyls;
#endif

/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
yynewstate:

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Give user a chance to reallocate the stack */
      /* Use copies of these so that the &'s don't force the real ones into memory. */
      YYSTYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
#ifdef YYLSP_NEEDED
		 &yyls1, size * sizeof (*yylsp),
#endif
		 &yystacksize);

      yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  yyerror("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  goto yybackup;
 yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* count tokens shifted since error; after three, turn off error status.  */
  if (yyerrstatus) yyerrstatus--;

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 1:
#line 58 "web2c.yacc"
{ block_level++;
 	    printf ("#include \"%s\"\n", std_header);
	  ;
    break;}
case 2:
#line 63 "web2c.yacc"
{ printf ("\n#include \"%s\"\n", coerce_name); ;
    break;}
case 3:
#line 66 "web2c.yacc"
{ YYACCEPT; ;
    break;}
case 6:
#line 76 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = field_id_tok;
	    ;
    break;}
case 7:
#line 81 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = fun_id_tok;
	    ;
    break;}
case 8:
#line 86 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = const_id_tok;
	    ;
    break;}
case 9:
#line 91 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = fun_param_tok;
	    ;
    break;}
case 10:
#line 96 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = proc_id_tok;
	    ;
    break;}
case 11:
#line 101 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = proc_param_tok;
	    ;
    break;}
case 12:
#line 106 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = type_id_tok;
	    ;
    break;}
case 13:
#line 111 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = type_id_tok;
	      sym_table[ii].val = lower_bound;
	      sym_table[ii].val_sym = lower_sym;
	      sym_table[ii].upper = upper_bound;
	      sym_table[ii].upper_sym = upper_sym;
	    ;
    break;}
case 14:
#line 120 "web2c.yacc"
{
	      ii = add_to_table (last_id); 
	      sym_table[ii].typ = var_id_tok;
	    ;
    break;}
case 16:
#line 131 "web2c.yacc"
{	if (block_level > 0) my_output("{");
			indent++; block_level++;
		      ;
    break;}
case 17:
#line 136 "web2c.yacc"
{if (block_level == 2) {
			    if (strcmp(fn_return_type, "void")) {
			      my_output("register");
			      my_output(fn_return_type);
			      my_output("Result;");
			    }
			    if (tex) {
			      (void) sprintf(safe_string, "%s_regmem",
						my_routine);
			      my_output(safe_string);
			      indent_line();
			    }
			 }
			;
    break;}
case 18:
#line 151 "web2c.yacc"
{if (block_level == 1)
				puts("\n#include \"coerce.h\"");
			 doing_statements = true;
			;
    break;}
case 19:
#line 156 "web2c.yacc"
{if (block_level == 2) {
			    if (strcmp(fn_return_type,"void")) {
			      my_output("return(Result)");
			      semicolon();
			     }
			     if (tex) {
			       if (uses_mem && uses_eqtb)
				(void) fprintf(coerce,
	"#define %s_regmem register memoryword *mem=zmem, *eqtb=zeqtb;\n",
				   my_routine);
			       else if (uses_mem)
				(void) fprintf(coerce,
			"#define %s_regmem register memoryword *mem=zmem;\n",
				   my_routine);
			       else if (uses_eqtb)
				(void) fprintf(coerce,
			"#define %s_regmem register memoryword *eqtb=zeqtb;\n",
				   my_routine);
			       else
				(void) fprintf(coerce,
				   "#define %s_regmem\n",
				   my_routine);
			    }
			    my_routine[0] = '\0';
			 }
			 indent--; block_level--;
			 my_output("}"); new_line();
			 doing_statements = false;
			;
    break;}
case 21:
#line 189 "web2c.yacc"
{ my_output("/*"); ;
    break;}
case 22:
#line 191 "web2c.yacc"
{ my_output("*/"); ;
    break;}
case 25:
#line 199 "web2c.yacc"
{ my_output(temp); ;
    break;}
case 27:
#line 204 "web2c.yacc"
{ indent_line(); ;
    break;}
case 30:
#line 212 "web2c.yacc"
{ new_line(); my_output("#define"); ;
    break;}
case 31:
#line 214 "web2c.yacc"
{ ii=add_to_table(last_id);
				  sym_table[ii].typ = const_id_tok;
				  my_output(last_id);
				;
    break;}
case 32:
#line 219 "web2c.yacc"
{ sym_table[ii].val=last_i_num;
				  new_line(); ;
    break;}
case 33:
#line 224 "web2c.yacc"
{
				  (void) sscanf(temp, "%ld", &last_i_num);
				  if (my_labs((long) last_i_num) > 32767)
				      (void) strcat(temp, "L");
				  my_output(temp);
				  yyval = ex_32;
				;
    break;}
case 34:
#line 232 "web2c.yacc"
{ my_output(temp);
				  yyval = ex_real;
				;
    break;}
case 35:
#line 236 "web2c.yacc"
{ yyval = 0; ;
    break;}
case 36:
#line 238 "web2c.yacc"
{ yyval = ex_32; ;
    break;}
case 37:
#line 242 "web2c.yacc"
{ int i, j; char s[132];
	  			  j = 1;
				  s[0] = '"';
	  			  for (i=1; yytext[i-1]!=0; i++) {
	  			    if (yytext[i] == '\\' || yytext[i] == '"')
					s[j++]='\\';
	    			    else if (yytext[i] == '\'') i++;
	    			    s[j++] = yytext[i];
				  }
	    			  s[j-1] = '"';
				  s[j] = 0;
				  my_output(s);
				;
    break;}
case 38:
#line 256 "web2c.yacc"
{ char s[5];
				  s[0]='\'';
	    			  if (yytext[1] == '\\' || yytext[1] == '\'') {
	  				s[2] = yytext[1];
					s[1] = '\\';
					s[3] = '\'';
					s[4] = '\0';
				  }
	  			  else {
					s[1] = yytext[1];
					s[2]='\'';
					s[3]='\0';
				  }
	  			  my_output(s);
				;
    break;}
case 39:
#line 274 "web2c.yacc"
{ my_output(last_id); ;
    break;}
case 44:
#line 286 "web2c.yacc"
{ my_output("typedef"); ;
    break;}
case 45:
#line 288 "web2c.yacc"
{ ii = add_to_table(last_id);
				  sym_table[ii].typ = type_id_tok;
				  (void) strcpy(safe_string, last_id);
				  last_type = ii;
				;
    break;}
case 46:
#line 294 "web2c.yacc"
{
				  array_bounds[0] = 0;
				  array_offset[0] = 0;
				;
    break;}
case 47:
#line 299 "web2c.yacc"
{ if (*array_offset) {
			fprintf(stderr, "Cannot typedef arrays with offsets\n");
					exit(1);
				  }
				  my_output(safe_string);
				  my_output(array_bounds);
				  semicolon();
				  last_type = -1;
				;
    break;}
case 50:
#line 316 "web2c.yacc"
{
              if (last_type >= 0)
                {
                   sym_table[ii].val = lower_bound;
                   sym_table[ii].val_sym = lower_sym;
                   sym_table[ii].upper = upper_bound;
                   sym_table[ii].upper_sym = upper_sym;
                   ii= -1;
                 }
                 
              /* If the bounds on an integral type are known at
                 translation time, select the smallest ANSI C type which
                 can represent it.  We avoid using unsigned char and
                 unsigned short where possible, as ANSI compilers
                 (typically) convert them to int, while traditional
                 compilers convert them to unsigned int.  We also avoid
                 schar if possible, since it also is different on
                 different compilers (see config.h).  */
              if (lower_sym == -1 && upper_sym == -1)
                {
                  if (0 <= lower_bound && upper_bound <= SCHAR_MAX)
                    my_output ("char");
                  else if (SCHAR_MIN <= lower_bound && upper_bound <=SCHAR_MAX)
                    my_output ("schar");
                  else if (0 <= lower_bound && upper_bound <= UCHAR_MAX)
                    my_output ("unsigned char");
                  else if (SHRT_MIN <= lower_bound && upper_bound <= SHRT_MAX)
                    my_output ("short");
                  else if (0 <= lower_bound && upper_bound <= USHRT_MAX)
                    my_output ("unsigned short");
                  else
                    my_output ("integer");
                }
              else
                my_output ("integer");
            ;
    break;}
case 55:
#line 364 "web2c.yacc"
{lower_bound = upper_bound;
				 lower_sym = upper_sym;
				 (void) sscanf(temp, "%ld", &upper_bound);
				 upper_sym = -1; /* no sym table entry */
				;
    break;}
case 56:
#line 370 "web2c.yacc"
{ lower_bound = upper_bound;
				  lower_sym = upper_sym;
				  upper_bound = sym_table[l_s].val;
				  upper_sym = l_s;
				;
    break;}
case 57:
#line 378 "web2c.yacc"
{if (last_type >= 0) {
	    sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
	    sym_table[last_type].upper = sym_table[l_s].upper;
	    sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
	    sym_table[last_type].val = sym_table[l_s].val;
	    sym_table[last_type].val_sym = sym_table[l_s].val_sym;
	 }
	 my_output(last_id); ;
    break;}
case 58:
#line 390 "web2c.yacc"
{ if (last_type >= 0)
	        sym_table[last_type].var_not_needed = true;
            ;
    break;}
case 60:
#line 395 "web2c.yacc"
{ if (last_type >= 0)
	        sym_table[last_type].var_not_needed = true;
            ;
    break;}
case 61:
#line 399 "web2c.yacc"
{ if (last_type >= 0)
	        sym_table[last_type].var_not_needed = true;
            ;
    break;}
case 62:
#line 405 "web2c.yacc"
{if (last_type >= 0) {
	    sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
	    sym_table[last_type].upper = sym_table[l_s].upper;
	    sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
	    sym_table[last_type].val = sym_table[l_s].val;
	    sym_table[last_type].val_sym = sym_table[l_s].val_sym;
	 }
	 my_output(last_id); my_output("*"); ;
    break;}
case 65:
#line 421 "web2c.yacc"
{ compute_array_bounds(); ;
    break;}
case 66:
#line 423 "web2c.yacc"
{ lower_bound = sym_table[l_s].val;
				  lower_sym = sym_table[l_s].val_sym;
				  upper_bound = sym_table[l_s].upper;
				  upper_sym = sym_table[l_s].upper_sym;
				  compute_array_bounds();
				;
    break;}
case 68:
#line 436 "web2c.yacc"
{ my_output("struct"); my_output("{"); indent++;;
    break;}
case 69:
#line 438 "web2c.yacc"
{ indent--; my_output("}"); semicolon(); ;
    break;}
case 72:
#line 446 "web2c.yacc"
{ field_list[0] = 0; ;
    break;}
case 73:
#line 448 "web2c.yacc"
{
				  /*array_bounds[0] = 0;
				  array_offset[0] = 0;*/
				;
    break;}
case 74:
#line 453 "web2c.yacc"
{ int i=0, j; char ltemp[80];
				  while(field_list[i++] == '!') {
					j = 0;
					while (field_list[i])
					    ltemp[j++] = field_list[i++];
					i++;
					if (field_list[i] == '!')
						ltemp[j++] = ',';
					ltemp[j] = 0;
					my_output(ltemp);
				  }
				  semicolon();
				;
    break;}
case 78:
#line 474 "web2c.yacc"
{ int i=0, j=0;
				  while (field_list[i] == '!')
					while(field_list[i++]);
				  ii = add_to_table(last_id);
				  sym_table[ii].typ = field_id_tok;
				  field_list[i++] = '!';
				  while (last_id[j])
					field_list[i++] = last_id[j++];
				  field_list[i++] = 0;
				  field_list[i++] = 0;
				;
    break;}
case 79:
#line 486 "web2c.yacc"
{ int i=0, j=0;
				  while (field_list[i] == '!')
					while(field_list[i++]);
				  field_list[i++] = '!';
				  while (last_id[j])
					field_list[i++] = last_id[j++];
				  field_list[i++] = 0;
				  field_list[i++] = 0;
				;
    break;}
case 80:
#line 498 "web2c.yacc"
{ my_output("file_ptr /* of "); ;
    break;}
case 81:
#line 500 "web2c.yacc"
{ my_output("*/"); ;
    break;}
case 86:
#line 512 "web2c.yacc"
{ var_list[0] = 0;
	      array_bounds[0] = 0;
	      array_offset[0] = 0;
	      var_formals = false;
	      ids_paramed = 0;
	    ;
    break;}
case 87:
#line 519 "web2c.yacc"
{
	      array_bounds[0] = 0;	
	      array_offset[0] = 0;
	    ;
    break;}
case 88:
#line 524 "web2c.yacc"
{ fixup_var_list(); ;
    break;}
case 91:
#line 532 "web2c.yacc"
{ int i=0, j=0;
				  ii = add_to_table(last_id);
				  sym_table[ii].typ = var_id_tok;
				  sym_table[ii].var_formal = var_formals;
				  param_id_list[ids_paramed++] = ii;
	  			  while (var_list[i] == '!')
					while(var_list[i++]);
				  var_list[i++] = '!';
				  while (last_id[j])
					var_list[i++] = last_id[j++];
	  			  var_list[i++] = 0;
				  var_list[i++] = 0;
				;
    break;}
case 92:
#line 546 "web2c.yacc"
{ int i=0, j=0;
				  ii = add_to_table(last_id);
	  			  sym_table[ii].typ = var_id_tok;
				  sym_table[ii].var_formal = var_formals;
				  param_id_list[ids_paramed++] = ii;
	  			  while (var_list[i] == '!')
					while (var_list[i++]);
	  			  var_list[i++] = '!';
				  while (last_id[j])
					var_list[i++] = last_id[j++];
	  			  var_list[i++] = 0;
				  var_list[i++] = 0;
				;
    break;}
case 93:
#line 560 "web2c.yacc"
{ int i=0, j=0;
				  ii = add_to_table(last_id);
	  			  sym_table[ii].typ = var_id_tok;
				  sym_table[ii].var_formal = var_formals;
				  param_id_list[ids_paramed++] = ii;
	  			  while (var_list[i] == '!')
					while(var_list[i++]);
	  			  var_list[i++] = '!';
				  while (last_id[j])
					var_list[i++] = last_id[j++];
				  var_list[i++] = 0;
				  var_list[i++] = 0;
				;
    break;}
case 95:
#line 578 "web2c.yacc"
{ my_output ("void main_body() {");
		  indent++;
		  new_line ();
		;
    break;}
case 96:
#line 583 "web2c.yacc"
{ indent--;
                  my_output ("}");
                  new_line ();
                ;
    break;}
case 100:
#line 595 "web2c.yacc"
{ indent_line(); remove_locals(); ;
    break;}
case 101:
#line 597 "web2c.yacc"
{ indent_line(); remove_locals(); ;
    break;}
case 103:
#line 605 "web2c.yacc"
{ ii = add_to_table(last_id);
	      if (debug)
	        (void) fprintf(stderr, "%3d Procedure %s\n",
                  pf_count++, last_id);
	      sym_table[ii].typ = proc_id_tok;
	      (void) strcpy(my_routine, last_id);
	      uses_eqtb = uses_mem = false;
	      my_output("void");
	      orig_std = std;
	      std = 0;
	    ;
    break;}
case 104:
#line 617 "web2c.yacc"
{ (void) strcpy(fn_return_type, "void");
	      do_proc_args();
	      gen_function_head();;
    break;}
case 105:
#line 621 "web2c.yacc"
{ ii = l_s; 
	      if (debug)
	        (void) fprintf(stderr, "%3d Procedure %s\n",
                               pf_count++, last_id);
	      (void) strcpy(my_routine, last_id);
	      my_output("void");
	    ;
    break;}
case 106:
#line 629 "web2c.yacc"
{ (void) strcpy(fn_return_type, "void");
	      do_proc_args();
	      gen_function_head();
            ;
    break;}
case 107:
#line 637 "web2c.yacc"
{
              (void) strcpy (z_id, last_id);
	      mark ();
	      ids_paramed = 0;
	    ;
    break;}
case 108:
#line 643 "web2c.yacc"
{ sprintf (z_id, "z%s", last_id);
	      ids_paramed = 0;
	      if (sym_table[ii].typ == proc_id_tok)
	        sym_table[ii].typ = proc_param_tok;
	      else if (sym_table[ii].typ == fun_id_tok)
	        sym_table[ii].typ = fun_param_tok;
	      mark();
	    ;
    break;}
case 112:
#line 659 "web2c.yacc"
{ ids_typed = ids_paramed;;
    break;}
case 113:
#line 661 "web2c.yacc"
{ int i, need_var;
	      i = search_table(last_id);
	      need_var = !sym_table[i].var_not_needed;
	      for (i=ids_typed; i<ids_paramed; i++)
                {
	          (void) strcpy(arg_type[i], last_id);
		  if (need_var && sym_table[param_id_list[i]].var_formal)
	            (void) strcat(arg_type[i], " *");
		  else
                    sym_table[param_id_list[i]].var_formal = false;
	        }
	    ;
    break;}
case 114:
#line 675 "web2c.yacc"
{var_formals = 0;;
    break;}
case 116:
#line 676 "web2c.yacc"
{var_formals = 1;;
    break;}
case 121:
#line 687 "web2c.yacc"
{ orig_std = std;
				  std = 0;
				  ii = add_to_table(last_id);
				  if (debug)
				  (void) fprintf(stderr, "%3d Function %s\n",
					pf_count++, last_id);
	  			  sym_table[ii].typ = fun_id_tok;
				  (void) strcpy(my_routine, last_id);
				  uses_eqtb = uses_mem = false;
				;
    break;}
case 122:
#line 698 "web2c.yacc"
{ normal();
				  array_bounds[0] = 0;
				  array_offset[0] = 0;
				;
    break;}
case 123:
#line 703 "web2c.yacc"
{(void) strcpy(fn_return_type, yytext);
			     do_proc_args();
			     gen_function_head();
			    ;
    break;}
case 125:
#line 710 "web2c.yacc"
{ orig_std = std;
				  std = 0;
				  ii = l_s;
				  if (debug)
				  (void) fprintf(stderr, "%3d Function %s\n",
					pf_count++, last_id);
				  (void) strcpy(my_routine, last_id);
				  uses_eqtb = uses_mem = false;
				;
    break;}
case 126:
#line 720 "web2c.yacc"
{ normal();
				  array_bounds[0] = 0;
				  array_offset[0] = 0;
				;
    break;}
case 127:
#line 725 "web2c.yacc"
{(void) strcpy(fn_return_type, yytext);
			     do_proc_args();
			     gen_function_head();
			    ;
    break;}
case 133:
#line 743 "web2c.yacc"
{my_output("{"); indent++; new_line();;
    break;}
case 134:
#line 745 "web2c.yacc"
{ indent--; my_output("}"); new_line(); ;
    break;}
case 139:
#line 758 "web2c.yacc"
{if (!doreturn(temp)) {
				    (void) sprintf(safe_string, "lab%s:",
					temp);
				    my_output(safe_string);
				 }
				;
    break;}
case 140:
#line 767 "web2c.yacc"
{ semicolon(); ;
    break;}
case 141:
#line 769 "web2c.yacc"
{ semicolon(); ;
    break;}
case 146:
#line 777 "web2c.yacc"
{my_output("break");;
    break;}
case 147:
#line 781 "web2c.yacc"
{ my_output("="); ;
    break;}
case 149:
#line 784 "web2c.yacc"
{ my_output("Result ="); ;
    break;}
case 151:
#line 789 "web2c.yacc"
{ if (strcmp(last_id, "mem") == 0)
					uses_mem = 1;
				  else if (strcmp(last_id, "eqtb") == 0)
					uses_eqtb = 1;
				  if (sym_table[l_s].var_formal)
					(void) putchar('*');
				  my_output(last_id);
				  yyval = ex_32;
				;
    break;}
case 153:
#line 800 "web2c.yacc"
{ if (sym_table[l_s].var_formal)
					(void) putchar('*');
				  my_output(last_id); yyval = ex_32; ;
    break;}
case 154:
#line 806 "web2c.yacc"
{ yyval = ex_32; ;
    break;}
case 155:
#line 808 "web2c.yacc"
{ yyval = ex_32; ;
    break;}
case 158:
#line 816 "web2c.yacc"
{ my_output("["); ;
    break;}
case 159:
#line 818 "web2c.yacc"
{ my_output("]"); ;
    break;}
case 160:
#line 820 "web2c.yacc"
{if (tex || mf) {
				   if (strcmp(last_id, "int")==0)
					my_output(".cint");
				   else if (strcmp(last_id, "lh")==0)
					my_output(".v.LH");
				   else if (strcmp(last_id, "rh")==0)
					my_output(".v.RH");
				   else {
				     (void)sprintf(safe_string, ".%s", last_id);
				     my_output(safe_string);
				   }
				 }
				 else {
				    (void) sprintf(safe_string, ".%s", last_id);
				    my_output(safe_string);
				 }
				;
    break;}
case 161:
#line 838 "web2c.yacc"
{ my_output(".hh.b0");;
    break;}
case 162:
#line 840 "web2c.yacc"
{ my_output(".hh.b1");;
    break;}
case 164:
#line 845 "web2c.yacc"
{ my_output("][");;
    break;}
case 166:
#line 850 "web2c.yacc"
{ yyval = yyvsp[0]; ;
    break;}
case 167:
#line 851 "web2c.yacc"
{my_output("+");;
    break;}
case 168:
#line 852 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 169:
#line 853 "web2c.yacc"
{my_output("-");;
    break;}
case 170:
#line 854 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 171:
#line 855 "web2c.yacc"
{my_output("*");;
    break;}
case 172:
#line 856 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 173:
#line 857 "web2c.yacc"
{my_output("/");;
    break;}
case 174:
#line 858 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 175:
#line 859 "web2c.yacc"
{my_output("==");;
    break;}
case 176:
#line 860 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 177:
#line 861 "web2c.yacc"
{my_output("!=");;
    break;}
case 178:
#line 862 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 179:
#line 863 "web2c.yacc"
{my_output("%");;
    break;}
case 180:
#line 864 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 181:
#line 865 "web2c.yacc"
{my_output("<");;
    break;}
case 182:
#line 866 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 183:
#line 867 "web2c.yacc"
{my_output(">");;
    break;}
case 184:
#line 868 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 185:
#line 869 "web2c.yacc"
{my_output("<=");;
    break;}
case 186:
#line 870 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 187:
#line 871 "web2c.yacc"
{my_output(">=");;
    break;}
case 188:
#line 872 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 189:
#line 873 "web2c.yacc"
{my_output("&&");;
    break;}
case 190:
#line 874 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 191:
#line 875 "web2c.yacc"
{my_output("||");;
    break;}
case 192:
#line 876 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]);;
    break;}
case 193:
#line 878 "web2c.yacc"
{ my_output("/ ((double)"); ;
    break;}
case 194:
#line 880 "web2c.yacc"
{yyval = max(yyvsp[-3], yyvsp[0]); my_output(")"); ;
    break;}
case 195:
#line 882 "web2c.yacc"
{ yyval = yyvsp[0]; ;
    break;}
case 197:
#line 887 "web2c.yacc"
{ my_output("- (integer)"); ;
    break;}
case 198:
#line 889 "web2c.yacc"
{ my_output("!"); ;
    break;}
case 199:
#line 893 "web2c.yacc"
{ my_output("("); ;
    break;}
case 200:
#line 895 "web2c.yacc"
{ my_output(")"); yyval = yyvsp[-3]; ;
    break;}
case 203:
#line 899 "web2c.yacc"
{ my_output(last_id); my_output("()"); ;
    break;}
case 204:
#line 901 "web2c.yacc"
{ my_output(last_id); ;
    break;}
case 206:
#line 906 "web2c.yacc"
{ my_output("("); ;
    break;}
case 207:
#line 908 "web2c.yacc"
{ my_output(")"); ;
    break;}
case 209:
#line 913 "web2c.yacc"
{ my_output(","); ;
    break;}
case 214:
#line 926 "web2c.yacc"
{ my_output(last_id); my_output("()"); ;
    break;}
case 215:
#line 928 "web2c.yacc"
{ my_output(last_id);
				  ii = add_to_table(last_id);
	  			  sym_table[ii].typ = proc_id_tok;
				  my_output("()");
				;
    break;}
case 216:
#line 934 "web2c.yacc"
{ my_output(last_id); ;
    break;}
case 218:
#line 939 "web2c.yacc"
{if (doreturn(temp)) {
				    if (strcmp(fn_return_type,"void"))
					my_output("return(Result)");
				    else
					my_output("return");
				 } else {
				     (void) sprintf(safe_string, "goto lab%s",
					temp);
				     my_output(safe_string);
				 }
				;
    break;}
case 227:
#line 969 "web2c.yacc"
{ my_output("if"); my_output("("); ;
    break;}
case 228:
#line 971 "web2c.yacc"
{ my_output(")"); new_line();;
    break;}
case 230:
#line 976 "web2c.yacc"
{ my_output("else"); ;
    break;}
case 232:
#line 981 "web2c.yacc"
{ my_output("switch"); my_output("("); ;
    break;}
case 233:
#line 983 "web2c.yacc"
{ my_output(")"); indent_line();
				  my_output("{"); indent++;
				;
    break;}
case 234:
#line 987 "web2c.yacc"
{ indent--; my_output("}"); new_line(); ;
    break;}
case 237:
#line 995 "web2c.yacc"
{ my_output("break"); semicolon(); ;
    break;}
case 240:
#line 1003 "web2c.yacc"
{ my_output("case"); 
				  my_output(temp);
				  my_output(":"); indent_line();
				;
    break;}
case 241:
#line 1008 "web2c.yacc"
{ my_output("default:"); indent_line(); ;
    break;}
case 247:
#line 1021 "web2c.yacc"
{ my_output("while");
				  my_output("(");
				;
    break;}
case 248:
#line 1025 "web2c.yacc"
{ my_output(")"); ;
    break;}
case 250:
#line 1030 "web2c.yacc"
{ my_output("do"); my_output("{"); indent++; ;
    break;}
case 251:
#line 1032 "web2c.yacc"
{ indent--; my_output("}"); 
				  my_output("while"); my_output("( ! (");
				;
    break;}
case 252:
#line 1036 "web2c.yacc"
{ my_output(") )"); ;
    break;}
case 253:
#line 1040 "web2c.yacc"
{
				  my_output("{");
				  my_output("register");
				  my_output("integer");
				  if (strict_for)
					my_output("for_begin,");
				  my_output("for_end;");
				 ;
    break;}
case 254:
#line 1049 "web2c.yacc"
{ if (strict_for)
					my_output("for_begin");
				  else
					my_output(control_var);
				  my_output("="); ;
    break;}
case 255:
#line 1055 "web2c.yacc"
{ my_output("; if (");
				  if (strict_for) my_output("for_begin");
				  else my_output(control_var);
				  my_output(relation);
				  my_output("for_end)");
				  if (strict_for) {
					my_output("{");
					my_output(control_var);
					my_output("=");
					my_output("for_begin");
					semicolon();
				  }
				  my_output("do"); 
				  indent++; 
				  new_line();;
    break;}
case 256:
#line 1071 "web2c.yacc"
{
				  char *top = strrchr (for_stack, '#');
				  indent--;
                                  new_line();
				  my_output("while"); 
				  my_output("("); 
				  my_output(top+1); 
				  my_output(")"); 
				  my_output(";");
				  my_output("}");
				  if (strict_for)
					my_output("}");
				  *top=0;
				  new_line();
				;
    break;}
case 257:
#line 1089 "web2c.yacc"
{(void) strcpy(control_var, last_id); ;
    break;}
case 258:
#line 1093 "web2c.yacc"
{ my_output(";"); ;
    break;}
case 259:
#line 1095 "web2c.yacc"
{ 
				  (void) strcpy(relation, "<=");
				  my_output("for_end");
				  my_output("="); ;
    break;}
case 260:
#line 1100 "web2c.yacc"
{ 
				  (void) sprintf(for_stack + strlen(for_stack),
				    "#%s++ < for_end", control_var);
				;
    break;}
case 261:
#line 1105 "web2c.yacc"
{ my_output(";"); ;
    break;}
case 262:
#line 1107 "web2c.yacc"
{
				  (void) strcpy(relation, ">=");
				  my_output("for_end");
				  my_output("="); ;
    break;}
case 263:
#line 1112 "web2c.yacc"
{ 
				  (void) sprintf(for_stack + strlen(for_stack),
				    "#%s-- > for_end", control_var);
				;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 442 "bison.simple"

  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;

#ifdef YYLSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = yylloc.first_line;
      yylsp->first_column = yylloc.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#endif

  /* Now "shift" the result of the reduction.
     Determine what state that goes to,
     based on the state we popped back to
     and the rule number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;

yyerrlab:   /* here on detecting error */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
		    if (yycheck[x + yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      yyerror(msg);
	      free(msg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

  goto yyerrlab1;
yyerrlab1:   /* here on error raised explicitly by an action */

  if (yyerrstatus == 3)
    {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif

      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token
     after shifting the error token.  */

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;

yyerrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

yyerrhandle:

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;
}
#line 1117 "web2c.yacc"


static void compute_array_bounds()
{
    long lb;
    char tmp[200];

    if (lower_sym == -1) {	/* lower is a constant */
	lb = lower_bound - 1;
	if (lb==0) lb = -1;	/* Treat lower_bound==1 as if lower_bound==0 */
	if (upper_sym == -1)	/* both constants */
	    (void) sprintf(tmp, "[%ld]", upper_bound - lb);
	else {			/* upper a symbol, lower constant */
	    if (lb < 0)
		(void) sprintf(tmp, "[%s + %ld]",
				symbol(upper_sym), (-lb));
	    else
		(void) sprintf(tmp, "[%s - %ld]",
				symbol(upper_sym), lb);
	}
	if (lower_bound < 0 || lower_bound > 1) {
	    if (*array_bounds) {
		fprintf(stderr, "Cannot handle offset in second dimension\n");
		exit(1);
	    }
	    if (lower_bound < 0) {
		(void) sprintf(array_offset, "+%ld", -lower_bound);
	    } else {
		(void) sprintf(array_offset, "-%ld", lower_bound);
	    }
	}
	(void) strcat(array_bounds, tmp);
    }
    else {			/* lower is a symbol */
	if (upper_sym != -1)	/* both are symbols */
	    (void) sprintf(tmp, "[%s - %s + 1]", symbol(upper_sym),
		symbol(lower_sym));
	else {			/* upper constant, lower symbol */
	    (void) sprintf(tmp, "[%ld - %s]", upper_bound + 1,
		symbol(lower_sym));
	}
	if (*array_bounds) {
	    fprintf(stderr, "Cannot handle symbolic offset in second dimension\n");
	    exit(1);
	}
	(void) sprintf(array_offset, "- (int)(%s)", symbol(lower_sym));
	(void) strcat(array_bounds, tmp);
    }
}


/* Kludge around negative lower array bounds.  */

static void
fixup_var_list ()
{
  int i, j;
  char output_string[100], real_symbol[100];

  for (i = 0; var_list[i++] == '!'; )
    {
      for (j = 0; real_symbol[j++] = var_list[i++]; )
        ;
      if (*array_offset)
        {
          (void) fprintf (std, "\n#define %s (%s %s)\n  ",
                          real_symbol, next_temp, array_offset);
          (void) strcpy (real_symbol, next_temp);
          /* Add the temp to the symbol table, so that change files can
             use it later on if necessary.  */
          j = add_to_table (next_temp);
          sym_table[j].typ = var_id_tok;
          find_next_temp ();
        }
      (void) sprintf (output_string, "%s%s%c", real_symbol, array_bounds,
                      var_list[i] == '!' ? ',' : ' ');
      my_output (output_string);
  }
  semicolon ();
}


/* If we're not processing TeX, we return false.  Otherwise,
   return true if the label is "10" and we're not in one of four TeX
   routines where the line labeled "10" isn't the end of the routine.
   Otherwise, return 0.  */
   
static boolean
doreturn (label)
    char *label;
{
    return
      tex
      && STREQ (label, "10")
      && !STREQ (my_routine, "macrocall")
      && !STREQ (my_routine, "hpack")
      && !STREQ (my_routine, "vpackage")
      && !STREQ (my_routine, "trybreak");
}


/* Return the absolute value of a long.  */
static long 
my_labs (x)
  long x;
{
    if (x < 0L) return(-x);
    return(x);
}

static void
do_proc_args ()
{
  fprintf (coerce, "%s %s();\n", fn_return_type, z_id);
}

static void
gen_function_head()
{
    int i;

    if (strcmp(my_routine, z_id)) {
	fprintf(coerce, "#define %s(", my_routine);
	for (i=0; i<ids_paramed; i++) {
	    if (i > 0)
		fprintf(coerce, ", %s", symbol(param_id_list[i]));
	    else
		fprintf(coerce, "%s", symbol(param_id_list[i]));
	}
	fprintf(coerce, ") %s(", z_id);
	for (i=0; i<ids_paramed; i++) {
	    if (i > 0)
		fputs(", ", coerce);
	    fprintf(coerce, "(%s) ", arg_type[i]);
	    fprintf(coerce, "%s(%s)",
		    sym_table[param_id_list[i]].var_formal?"&":"",
		    symbol(param_id_list[i]));
	}
	fprintf(coerce, ")\n");
    }
    std = orig_std;
    my_output(z_id);
    my_output("(");
    for (i=0; i<ids_paramed; i++) {
        if (i > 0) my_output(",");
        my_output(symbol(param_id_list[i]));
    }
    my_output(")");
    indent_line();
    for (i=0; i<ids_paramed; i++) {
        my_output(arg_type[i]);
        my_output(symbol(param_id_list[i]));
        semicolon();
    }
}
