bc.c

Go to the documentation of this file.
00001 #ifndef lint
00002 static char yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93";
00003 #endif
00004 #define YYBYACC 1
00005 #define YYMAJOR 1
00006 #define YYMINOR 9
00007 #define yyclearin (yychar=(-1))
00008 #define yyerrok (yyerrflag=0)
00009 #define YYRECOVERING (yyerrflag!=0)
00010 #define YYPREFIX "yy"
00011 #line 2 "bc.y"
00012 /* bc.y: The grammar for a POSIX compatable bc processor with some
00013          extensions to the language. */
00014 
00015 /*  This file is part of bc written for MINIX.
00016     Copyright (C) 1991, 1992 Free Software Foundation, Inc.
00017 
00018     This program is free software; you can redistribute it and/or modify
00019     it under the terms of the GNU General Public License as published by
00020     the Free Software Foundation; either version 2 of the License , or
00021     (at your option) any later version.
00022 
00023     This program is distributed in the hope that it will be useful,
00024     but WITHOUT ANY WARRANTY; without even the implied warranty of
00025     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026     GNU General Public License for more details.
00027 
00028     You should have received a copy of the GNU General Public License
00029     along with this program; see the file COPYING.  If not, write to
00030     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00031 
00032     You may contact the author by:
00033        e-mail:  phil@cs.wwu.edu
00034       us-mail:  Philip A. Nelson
00035                 Computer Science Department, 9062
00036                 Western Washington University
00037                 Bellingham, WA 98226-9062
00038        
00039 *************************************************************************/
00040 
00041 #include "bcdefs.h"
00042 #include "global.h"
00043 #include "proto.h"
00044 #line 38 "bc.y"
00045 typedef union {
00046         char     *s_value;
00047         char      c_value;
00048         int       i_value;
00049         arg_list *a_value;
00050        } YYSTYPE;
00051 #line 52 "y.tab.c"
00052 #define NEWLINE 257
00053 #define AND 258
00054 #define OR 259
00055 #define NOT 260
00056 #define STRING 261
00057 #define NAME 262
00058 #define NUMBER 263
00059 #define MUL_OP 264
00060 #define ASSIGN_OP 265
00061 #define REL_OP 266
00062 #define INCR_DECR 267
00063 #define Define 268
00064 #define Break 269
00065 #define Quit 270
00066 #define Length 271
00067 #define Return 272
00068 #define For 273
00069 #define If 274
00070 #define While 275
00071 #define Sqrt 276
00072 #define Else 277
00073 #define Scale 278
00074 #define Ibase 279
00075 #define Obase 280
00076 #define Auto 281
00077 #define Read 282
00078 #define Warranty 283
00079 #define Halt 284
00080 #define Last 285
00081 #define Continue 286
00082 #define Print 287
00083 #define Limits 288
00084 #define UNARY_MINUS 289
00085 #define YYERRCODE 256
00086 short yylhs[] = {                                        -1,
00087     0,    0,   10,   10,   10,   11,   11,   11,   11,   12,
00088    12,   12,   12,   12,   12,   15,   15,   13,   13,   13,
00089    13,   13,   13,   13,   13,   13,   13,   16,   17,   18,
00090    19,   13,   20,   13,   22,   23,   13,   13,   25,   13,
00091    24,   24,   26,   26,   21,   27,   21,   28,   14,    5,
00092     5,    6,    6,    6,    7,    7,    7,    7,    8,    8,
00093     9,    9,    9,    9,    4,    4,    2,    2,   29,    1,
00094    30,    1,   31,    1,    1,    1,    1,    1,    1,    1,
00095     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00096     1,    3,    3,    3,    3,    3,    3,
00097 };
00098 short yylen[] = {                                         2,
00099     0,    2,    2,    1,    2,    0,    1,    3,    2,    0,
00100     1,    2,    3,    2,    3,    1,    2,    1,    1,    1,
00101     1,    1,    1,    1,    1,    1,    4,    0,    0,    0,
00102     0,   13,    0,    7,    0,    0,    7,    3,    0,    3,
00103     1,    3,    1,    1,    0,    0,    3,    0,   12,    0,
00104     1,    0,    3,    3,    1,    3,    3,    5,    0,    1,
00105     1,    3,    3,    5,    0,    1,    0,    1,    0,    4,
00106     0,    4,    0,    4,    2,    3,    3,    3,    3,    3,
00107     2,    1,    1,    3,    4,    2,    2,    4,    4,    4,
00108     3,    1,    4,    1,    1,    1,    1,
00109 };
00110 short yydefred[] = {                                      1,
00111     0,    0,    0,   21,    0,   83,    0,    0,   22,   24,
00112     0,    0,   28,    0,   35,    0,    0,   94,   95,    0,
00113    18,   25,   97,   23,   39,   19,    0,    0,    0,    0,
00114     0,    2,    0,   16,    4,    7,    5,   17,    0,    0,
00115     0,    0,   96,   86,    0,    0,    0,    0,    0,    0,
00116     0,    0,    0,    0,   81,    0,    0,    0,   11,   71,
00117    73,    0,    0,    0,    0,    0,   69,   87,    3,    0,
00118     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00119     0,    0,    0,    0,   91,   43,    0,   40,    0,   84,
00120     0,    0,   38,    0,    0,    0,    0,    0,    0,    0,
00121     0,    8,    0,   85,    0,   93,    0,    0,    0,   88,
00122    27,    0,    0,   33,    0,   89,   90,    0,   13,   15,
00123     0,    0,    0,   62,    0,    0,    0,    0,    0,   29,
00124     0,    0,   42,    0,   56,    0,    0,    0,    0,    0,
00125    64,    0,    0,    0,   46,   34,   37,    0,   48,   58,
00126    30,    0,    0,    0,    0,   47,   53,   54,    0,    0,
00127     0,   31,   49,    0,   32,
00128 };
00129 short yydgoto[] = {                                       1,
00130    30,   79,   31,  113,  108,  149,  109,   73,   74,   32,
00131    33,   58,   34,   35,   59,   48,  138,  155,  164,  131,
00132   146,   50,  132,   88,   54,   89,  152,  154,  101,   94,
00133    95,
00134 };
00135 short yysindex[] = {                                      0,
00136    -7,   58,  212,    0,  -22,    0, -233, -241,    0,    0,
00137    -8,   -5,    0,   -4,    0,    2,    4,    0,    0,    9,
00138     0,    0,    0,    0,    0,    0,  212,  212,   91,  725,
00139  -240,    0,  -29,    0,    0,    0,    0,    0,   84,  245,
00140   212,  -57,    0,    0,   10,  212,  212,   14,  212,   16,
00141   212,  212,   23,  156,    0,  549,  127,  -52,    0,    0,
00142     0,  212,  212,  212,  212,  212,    0,    0,    0,   91,
00143   -17,  725,   24,   -3,  578, -205,  562,  725,   27,  212,
00144   606,  212,  669,  716,    0,    0,  725,    0,   19,    0,
00145    91,  127,    0,  212,  212,  -36,  -39,  -91,  -91,  -36,
00146   212,    0,  166,    0,  277,    0,  -21,   36,   40,    0,
00147     0,  725,   28,    0,  725,    0,    0,  156,    0,    0,
00148    84,  540,  -39,    0,   -9,  725,   -2,  -37, -174,    0,
00149   127,   48,    0,  346,    0, -167,    3,  212, -185,  127,
00150     0, -188,    6,   37,    0,    0,    0, -205,    0,    0,
00151     0,  127,  -42,   91,  212,    0,    0,    0,  -20,   54,
00152    26,    0,    0,  127,    0,
00153 };
00154 short yyrindex[] = {                                      0,
00155   -16,    0,    0,    0,  409,    0,    0,    0,    0,    0,
00156     0,  -58,    0,    0,    0,    0,  426,    0,    0,    0,
00157     0,    0,    0,    0,    0,    0,    0,    0,  -50,   46,
00158   470,    0,    0,    0,    0,    0,    0,    0,  661,   56,
00159     0,  525,    0,    0,    0,    0,   59,    0,    0,    0,
00160     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00161     0,    0,    0,    0,    0,    0,    0,    0,    0,   -6,
00162   705,    7,    0,   60,    0,   61,    0,   63,    0,   49,
00163     0,    0,    0,    0,    0,    0,   17,    0,   78,    0,
00164   -47,  -45,    0,    0,    0,  537,  440,  620,  637,  594,
00165     0,    0,    0,    0,    0,    0,  -33,    0,   66,    0,
00166     0,  -19,    0,    0,   68,    0,    0,    0,    0,    0,
00167   667,  680,  508,    0,  705,   18,    0,    0,    0,    0,
00168     0,    0,    0,    0,    0,    0,  -31,   49,  -44,    0,
00169     0,  -40,    0,    0,    0,    0,    0,    0,    0,    0,
00170     0,    0,    0,    1,   69,    0,    0,    0,    0,    0,
00171    13,    0,    0,    0,    0,
00172 };
00173 short yygindex[] = {                                      0,
00174   958,    0,  104, -118,    0,    0,  -35,    0,    0,    0,
00175     0,  -34,   22,    0,   15,    0,    0,    0,    0,    0,
00176     0,    0,    0,   -1,    0,    0,    0,    0,    0,    0,
00177     0,
00178 };
00179 #define YYTABLESIZE 1113
00180 short yytable[] = {                                      52,
00181    26,  129,   66,   64,   52,   65,   92,   55,   10,   57,
00182    55,   12,   57,   14,   45,   36,  158,   40,   52,  144,
00183    45,   66,   40,   38,   67,   55,   68,   57,   42,   70,
00184    40,   46,   28,   41,   47,   49,  160,   27,   92,   66,
00185   105,   51,    6,   52,   43,   18,   19,   61,   53,   76,
00186    61,   23,    9,   80,   66,   82,  107,   66,   63,   10,
00187    44,   63,  118,   85,  104,   28,   26,  111,   41,  127,
00188    27,   12,   93,  103,   10,   44,  128,   12,   38,   14,
00189    45,  134,   52,  129,  102,  136,  130,  137,  140,  142,
00190   135,  145,  148,  143,  162,  151,   59,   28,  150,   67,
00191    60,   50,   27,   68,   20,  119,   51,   65,   36,   65,
00192    44,    0,  153,  120,    0,   29,  133,    0,    0,  159,
00193     0,    0,    0,    0,    0,    0,   64,    0,   65,    0,
00194    28,    0,    0,    0,    0,   27,   41,    0,    0,    0,
00195     0,   44,    0,    0,    0,    0,    0,    0,   29,    0,
00196   163,    0,  139,    0,    0,    0,    0,    0,    0,    0,
00197     0,  147,    0,    0,    0,    0,   28,    0,    0,    0,
00198    20,   27,   62,  156,    0,  119,    0,   66,    0,    0,
00199    29,    0,    0,    0,    0,  165,    0,    0,    0,    0,
00200     0,    0,    0,    0,    0,   28,    0,    0,   26,    0,
00201    27,    0,   41,    0,   91,   28,   10,    0,    0,   12,
00202    27,   14,   45,   29,  157,   52,   52,    0,   26,   52,
00203    52,   52,   52,   55,   62,   57,   52,   69,   52,   52,
00204    52,   52,   52,   52,   52,   52,  161,   52,   52,   52,
00205     6,   52,   52,   52,   52,   52,   52,   52,    2,   29,
00206     9,   28,    3,    4,    5,    6,   27,   10,  124,    7,
00207     8,    9,   10,   11,   12,   13,   14,   15,   16,   12,
00208    17,   18,   19,   44,   20,   21,   22,   23,   24,   25,
00209    26,   57,    0,    0,   28,    3,    4,    5,    6,   27,
00210     0,    0,    7,   44,    9,   10,   11,   12,   13,   14,
00211    15,   16,   20,   17,   18,   19,    0,   20,   21,   22,
00212    23,   24,   25,   26,   37,    0,   28,    3,    4,    5,
00213     6,   27,   20,    0,    7,    0,    9,   10,   11,   12,
00214    13,   14,   15,   16,   41,   17,   18,   19,    0,   20,
00215    21,   22,   23,   24,   25,   26,   57,   62,    0,   63,
00216     3,    4,    5,    6,   41,    0,    0,    7,    0,    9,
00217    10,   11,   12,   13,   14,   15,   16,    0,   17,   18,
00218    19,    0,   20,   21,   22,   23,   24,   25,   26,    0,
00219     0,    0,    0,    0,    0,   28,    3,    4,    5,    6,
00220    27,    0,    0,    7,    0,    9,   10,   11,   12,   13,
00221    14,   15,   16,    0,   17,   18,   19,    0,   20,   21,
00222    22,   23,   24,   25,   26,    3,   86,    5,    6,    0,
00223     0,    0,    7,    0,    0,    3,   11,    5,    6,    0,
00224     0,   16,    7,   17,   18,   19,   11,   20,  141,    0,
00225    23,   16,    0,   17,   18,   19,    0,   20,    0,   92,
00226    23,   92,   92,   92,    0,    0,    0,    0,    0,    0,
00227     0,    0,    0,    0,    0,    0,   96,   92,   96,   96,
00228    96,    3,    0,    5,    6,    0,    0,    0,    7,    0,
00229    76,    0,   11,   76,   96,    0,    0,   16,    0,   17,
00230    18,   19,    0,   20,    0,    0,   23,    0,   76,    0,
00231     0,   92,   92,    0,    3,    0,   71,    6,    0,    0,
00232    82,    7,   82,   82,   82,   11,    0,    0,   96,   96,
00233    16,    0,   17,   18,   19,    0,   20,    0,   82,   23,
00234     0,    0,   76,   92,    0,    0,    3,    0,  125,    6,
00235     0,    0,    0,    7,    0,    0,    0,   11,   70,    0,
00236    96,   70,   16,    0,   17,   18,   19,    0,   20,    0,
00237     0,   23,   82,   82,   76,   92,   70,   92,   92,   92,
00238     0,    0,    0,    0,    0,    0,    0,   79,    0,   79,
00239    79,   79,   64,   92,   65,    0,    0,    0,    0,   90,
00240     0,   64,    0,   65,   82,   79,    0,    0,    0,    0,
00241    70,    0,  110,    0,   64,    3,   65,    5,    6,    0,
00242     0,    0,    7,    0,    0,    0,   11,   92,   92,    0,
00243    64,   16,   65,   17,   18,   19,    0,   20,    0,   79,
00244    23,    0,   70,   66,   80,    0,   80,   80,   80,    0,
00245     0,    0,   66,    0,    0,    0,  114,    0,   64,   92,
00246    65,    0,   80,    0,    0,   66,    0,    0,    0,    0,
00247    77,   79,   77,   77,   77,   92,   92,   92,    0,    0,
00248   106,   66,   92,   92,   92,   92,    0,   78,   77,   78,
00249    78,   78,   96,   96,   96,   92,   80,    0,    0,   96,
00250    96,   96,   96,    0,    0,   78,   76,   76,   76,   66,
00251     0,   75,   96,    0,   75,   76,    0,   72,    0,  116,
00252    72,   64,   77,   65,    0,    0,   76,    0,   80,   75,
00253    74,    0,    0,   74,    0,   72,   82,   82,   82,   78,
00254     0,    0,    0,   82,    0,   82,    0,    0,   74,    0,
00255     0,    0,    0,    0,   77,   92,   82,   92,   92,   92,
00256     0,    0,    0,   75,    0,    0,  117,    0,   64,   72,
00257    65,   78,   66,    0,   70,   70,   70,   64,    0,   65,
00258     0,    0,   74,   70,    0,    0,    0,    0,    0,    0,
00259     0,   92,   92,   92,   70,   75,    0,    0,   92,    0,
00260    92,   72,    0,   79,   79,   79,    0,   60,   92,    0,
00261    79,   92,   79,   62,   74,   63,   60,   61,    0,   66,
00262     0,    0,   62,   79,   63,    0,    0,    0,   66,   60,
00263    61,    0,    0,    0,    0,   62,    0,   63,    0,    0,
00264     0,    0,    0,    0,    0,   60,   61,    0,    0,    0,
00265     0,   62,    0,   63,    0,    0,    0,    0,    0,    0,
00266    80,   80,   80,    0,    0,    0,    0,   80,    0,   80,
00267     0,    0,    0,   60,   61,    0,    0,    0,    0,   62,
00268    80,   63,    0,    0,    0,    0,   77,   77,   77,    0,
00269     0,    0,    0,    0,    0,   77,    0,    0,    0,    0,
00270     0,    0,    0,   78,   78,   78,   77,    0,    0,    0,
00271     0,    0,   78,    0,    0,    0,    0,    0,    0,    0,
00272     0,    0,    0,   78,    0,    0,    0,   75,   75,   75,
00273     0,    0,    0,   72,   72,   72,   60,   61,    0,    0,
00274     0,    0,   62,    0,   63,    0,   74,   75,   74,    0,
00275     0,    0,    0,   72,    0,    0,    0,    0,    0,    0,
00276     0,    0,    0,    0,    0,    0,   74,    0,    0,    0,
00277    39,    0,   92,   92,    0,    0,    0,    0,   92,   92,
00278    92,   92,    0,   60,   61,    0,    0,    0,    0,   62,
00279     0,   63,   60,   61,   55,   56,    0,    0,   62,    0,
00280    63,    0,    0,    0,    0,    0,    0,   72,   75,    0,
00281     0,    0,    0,   77,   78,    0,   81,    0,   83,   84,
00282     0,   87,    0,    0,    0,    0,    0,    0,    0,   96,
00283    97,   98,   99,  100,    0,    0,    0,    0,    0,    0,
00284     0,    0,    0,    0,    0,    0,    0,  112,    0,  115,
00285     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00286     0,  121,  122,    0,    0,    0,    0,    0,  123,    0,
00287    75,    0,  126,    0,    0,    0,    0,    0,    0,    0,
00288     0,    0,    0,    0,    0,   87,    0,    0,    0,    0,
00289     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00290     0,   75,    0,    0,    0,  112,    0,    0,    0,    0,
00291     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00292     0,    0,  112,
00293 };
00294 short yycheck[] = {                                      40,
00295    59,   44,   94,   43,   45,   45,   59,   41,   59,   41,
00296    44,   59,   44,   59,   59,    1,   59,   40,   59,  138,
00297   262,   41,   40,    2,  265,   59,  267,   59,  262,   59,
00298    40,   40,   40,   91,   40,   40,  155,   45,   59,   59,
00299    44,   40,   59,   40,  278,  279,  280,   41,   40,   40,
00300    44,  285,   59,   40,   94,   40,  262,   94,   41,   59,
00301    44,   44,   44,   41,   41,   40,  125,   41,   91,   91,
00302    45,   59,  125,   91,  125,   59,   41,  125,   57,  125,
00303   125,   91,  123,   44,   70,  123,   59,  262,   41,  257,
00304    93,  277,  281,   91,   41,   59,   41,   40,   93,   41,
00305    41,   41,   45,   41,   59,   91,   41,   59,   41,   41,
00306     7,   -1,  148,   92,   -1,  123,  118,   -1,   -1,  154,
00307    -1,   -1,   -1,   -1,   -1,   -1,   43,   -1,   45,   -1,
00308    40,   -1,   -1,   -1,   -1,   45,   59,   -1,   -1,   -1,
00309    -1,  125,   -1,   -1,   -1,   -1,   -1,   -1,  123,   -1,
00310   125,   -1,  131,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00311    -1,  140,   -1,   -1,   -1,   -1,   40,   -1,   -1,   -1,
00312   125,   45,  264,  152,   -1,  161,   -1,   94,   -1,   -1,
00313   123,   -1,   -1,   -1,   -1,  164,   -1,   -1,   -1,   -1,
00314    -1,   -1,   -1,   -1,   -1,   40,   -1,   -1,  257,   -1,
00315    45,   -1,  125,   -1,  257,   40,  257,   -1,   -1,  257,
00316    45,  257,  257,  123,  257,  256,  257,   -1,  277,  260,
00317   261,  262,  263,  257,  264,  257,  267,  257,  269,  270,
00318   271,  272,  273,  274,  275,  276,  257,  278,  279,  280,
00319   257,  282,  283,  284,  285,  286,  287,  288,  256,  123,
00320   257,   40,  260,  261,  262,  263,   45,  257,   93,  267,
00321   268,  269,  270,  271,  272,  273,  274,  275,  276,  257,
00322   278,  279,  280,  257,  282,  283,  284,  285,  286,  287,
00323   288,  256,   -1,   -1,   40,  260,  261,  262,  263,   45,
00324    -1,   -1,  267,  277,  269,  270,  271,  272,  273,  274,
00325   275,  276,  257,  278,  279,  280,   -1,  282,  283,  284,
00326   285,  286,  287,  288,  257,   -1,   40,  260,  261,  262,
00327   263,   45,  277,   -1,  267,   -1,  269,  270,  271,  272,
00328   273,  274,  275,  276,  257,  278,  279,  280,   -1,  282,
00329   283,  284,  285,  286,  287,  288,  256,  264,   -1,  266,
00330   260,  261,  262,  263,  277,   -1,   -1,  267,   -1,  269,
00331   270,  271,  272,  273,  274,  275,  276,   -1,  278,  279,
00332   280,   -1,  282,  283,  284,  285,  286,  287,  288,   -1,
00333    -1,   -1,   -1,   -1,   -1,   40,  260,  261,  262,  263,
00334    45,   -1,   -1,  267,   -1,  269,  270,  271,  272,  273,
00335   274,  275,  276,   -1,  278,  279,  280,   -1,  282,  283,
00336   284,  285,  286,  287,  288,  260,  261,  262,  263,   -1,
00337    -1,   -1,  267,   -1,   -1,  260,  271,  262,  263,   -1,
00338    -1,  276,  267,  278,  279,  280,  271,  282,   93,   -1,
00339   285,  276,   -1,  278,  279,  280,   -1,  282,   -1,   41,
00340   285,   43,   44,   45,   -1,   -1,   -1,   -1,   -1,   -1,
00341    -1,   -1,   -1,   -1,   -1,   -1,   41,   59,   43,   44,
00342    45,  260,   -1,  262,  263,   -1,   -1,   -1,  267,   -1,
00343    41,   -1,  271,   44,   59,   -1,   -1,  276,   -1,  278,
00344   279,  280,   -1,  282,   -1,   -1,  285,   -1,   59,   -1,
00345    -1,   93,   94,   -1,  260,   -1,  262,  263,   -1,   -1,
00346    41,  267,   43,   44,   45,  271,   -1,   -1,   93,   94,
00347   276,   -1,  278,  279,  280,   -1,  282,   -1,   59,  285,
00348    -1,   -1,   93,  125,   -1,   -1,  260,   -1,  262,  263,
00349    -1,   -1,   -1,  267,   -1,   -1,   -1,  271,   41,   -1,
00350   125,   44,  276,   -1,  278,  279,  280,   -1,  282,   -1,
00351    -1,  285,   93,   94,  125,   41,   59,   43,   44,   45,
00352    -1,   -1,   -1,   -1,   -1,   -1,   -1,   41,   -1,   43,
00353    44,   45,   43,   59,   45,   -1,   -1,   -1,   -1,   41,
00354    -1,   43,   -1,   45,  125,   59,   -1,   -1,   -1,   -1,
00355    93,   -1,   41,   -1,   43,  260,   45,  262,  263,   -1,
00356    -1,   -1,  267,   -1,   -1,   -1,  271,   93,   94,   -1,
00357    43,  276,   45,  278,  279,  280,   -1,  282,   -1,   93,
00358   285,   -1,  125,   94,   41,   -1,   43,   44,   45,   -1,
00359    -1,   -1,   94,   -1,   -1,   -1,   41,   -1,   43,  125,
00360    45,   -1,   59,   -1,   -1,   94,   -1,   -1,   -1,   -1,
00361    41,  125,   43,   44,   45,  257,  258,  259,   -1,   -1,
00362    93,   94,  264,  265,  266,  267,   -1,   41,   59,   43,
00363    44,   45,  257,  258,  259,  277,   93,   -1,   -1,  264,
00364   265,  266,  267,   -1,   -1,   59,  257,  258,  259,   94,
00365    -1,   41,  277,   -1,   44,  266,   -1,   41,   -1,   41,
00366    44,   43,   93,   45,   -1,   -1,  277,   -1,  125,   59,
00367    41,   -1,   -1,   44,   -1,   59,  257,  258,  259,   93,
00368    -1,   -1,   -1,  264,   -1,  266,   -1,   -1,   59,   -1,
00369    -1,   -1,   -1,   -1,  125,   41,  277,   43,   44,   45,
00370    -1,   -1,   -1,   93,   -1,   -1,   41,   -1,   43,   93,
00371    45,  125,   94,   -1,  257,  258,  259,   43,   -1,   45,
00372    -1,   -1,   93,  266,   -1,   -1,   -1,   -1,   -1,   -1,
00373    -1,  257,  258,  259,  277,  125,   -1,   -1,  264,   -1,
00374   266,  125,   -1,  257,  258,  259,   -1,  258,   94,   -1,
00375   264,  277,  266,  264,  125,  266,  258,  259,   -1,   94,
00376    -1,   -1,  264,  277,  266,   -1,   -1,   -1,   94,  258,
00377   259,   -1,   -1,   -1,   -1,  264,   -1,  266,   -1,   -1,
00378    -1,   -1,   -1,   -1,   -1,  258,  259,   -1,   -1,   -1,
00379    -1,  264,   -1,  266,   -1,   -1,   -1,   -1,   -1,   -1,
00380   257,  258,  259,   -1,   -1,   -1,   -1,  264,   -1,  266,
00381    -1,   -1,   -1,  258,  259,   -1,   -1,   -1,   -1,  264,
00382   277,  266,   -1,   -1,   -1,   -1,  257,  258,  259,   -1,
00383    -1,   -1,   -1,   -1,   -1,  266,   -1,   -1,   -1,   -1,
00384    -1,   -1,   -1,  257,  258,  259,  277,   -1,   -1,   -1,
00385    -1,   -1,  266,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00386    -1,   -1,   -1,  277,   -1,   -1,   -1,  257,  258,  259,
00387    -1,   -1,   -1,  257,  258,  259,  258,  259,   -1,   -1,
00388    -1,   -1,  264,   -1,  266,   -1,  257,  277,  259,   -1,
00389    -1,   -1,   -1,  277,   -1,   -1,   -1,   -1,   -1,   -1,
00390    -1,   -1,   -1,   -1,   -1,   -1,  277,   -1,   -1,   -1,
00391     3,   -1,  258,  259,   -1,   -1,   -1,   -1,  264,  265,
00392   266,  267,   -1,  258,  259,   -1,   -1,   -1,   -1,  264,
00393    -1,  266,  258,  259,   27,   28,   -1,   -1,  264,   -1,
00394   266,   -1,   -1,   -1,   -1,   -1,   -1,   40,   41,   -1,
00395    -1,   -1,   -1,   46,   47,   -1,   49,   -1,   51,   52,
00396    -1,   54,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   62,
00397    63,   64,   65,   66,   -1,   -1,   -1,   -1,   -1,   -1,
00398    -1,   -1,   -1,   -1,   -1,   -1,   -1,   80,   -1,   82,
00399    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00400    -1,   94,   95,   -1,   -1,   -1,   -1,   -1,  101,   -1,
00401   103,   -1,  105,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00402    -1,   -1,   -1,   -1,   -1,  118,   -1,   -1,   -1,   -1,
00403    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00404    -1,  134,   -1,   -1,   -1,  138,   -1,   -1,   -1,   -1,
00405    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
00406    -1,   -1,  155,
00407 };
00408 #define YYFINAL 1
00409 #ifndef YYDEBUG
00410 #define YYDEBUG 0
00411 #endif
00412 #define YYMAXTOKEN 289
00413 #if YYDEBUG
00414 char *yyname[] = {
00415 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00416 0,0,0,0,0,0,"'('","')'",0,"'+'","','","'-'",0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,0,
00417 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,
00418 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,
00419 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00420 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00421 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00422 0,0,0,0,0,"NEWLINE","AND","OR","NOT","STRING","NAME","NUMBER","MUL_OP",
00423 "ASSIGN_OP","REL_OP","INCR_DECR","Define","Break","Quit","Length","Return",
00424 "For","If","While","Sqrt","Else","Scale","Ibase","Obase","Auto","Read",
00425 "Warranty","Halt","Last","Continue","Print","Limits","UNARY_MINUS",
00426 };
00427 char *yyrule[] = {
00428 "$accept : program",
00429 "program :",
00430 "program : program input_item",
00431 "input_item : semicolon_list NEWLINE",
00432 "input_item : function",
00433 "input_item : error NEWLINE",
00434 "semicolon_list :",
00435 "semicolon_list : statement_or_error",
00436 "semicolon_list : semicolon_list ';' statement_or_error",
00437 "semicolon_list : semicolon_list ';'",
00438 "statement_list :",
00439 "statement_list : statement_or_error",
00440 "statement_list : statement_list NEWLINE",
00441 "statement_list : statement_list NEWLINE statement_or_error",
00442 "statement_list : statement_list ';'",
00443 "statement_list : statement_list ';' statement",
00444 "statement_or_error : statement",
00445 "statement_or_error : error statement",
00446 "statement : Warranty",
00447 "statement : Limits",
00448 "statement : expression",
00449 "statement : STRING",
00450 "statement : Break",
00451 "statement : Continue",
00452 "statement : Quit",
00453 "statement : Halt",
00454 "statement : Return",
00455 "statement : Return '(' return_expression ')'",
00456 "$$1 :",
00457 "$$2 :",
00458 "$$3 :",
00459 "$$4 :",
00460 "statement : For $$1 '(' opt_expression ';' $$2 opt_expression ';' $$3 opt_expression ')' $$4 statement",
00461 "$$5 :",
00462 "statement : If '(' expression ')' $$5 statement opt_else",
00463 "$$6 :",
00464 "$$7 :",
00465 "statement : While $$6 '(' expression $$7 ')' statement",
00466 "statement : '{' statement_list '}'",
00467 "$$8 :",
00468 "statement : Print $$8 print_list",
00469 "print_list : print_element",
00470 "print_list : print_element ',' print_list",
00471 "print_element : STRING",
00472 "print_element : expression",
00473 "opt_else :",
00474 "$$9 :",
00475 "opt_else : Else $$9 statement",
00476 "$$10 :",
00477 "function : Define NAME '(' opt_parameter_list ')' '{' NEWLINE opt_auto_define_list $$10 statement_list NEWLINE '}'",
00478 "opt_parameter_list :",
00479 "opt_parameter_list : define_list",
00480 "opt_auto_define_list :",
00481 "opt_auto_define_list : Auto define_list NEWLINE",
00482 "opt_auto_define_list : Auto define_list ';'",
00483 "define_list : NAME",
00484 "define_list : NAME '[' ']'",
00485 "define_list : define_list ',' NAME",
00486 "define_list : define_list ',' NAME '[' ']'",
00487 "opt_argument_list :",
00488 "opt_argument_list : argument_list",
00489 "argument_list : expression",
00490 "argument_list : NAME '[' ']'",
00491 "argument_list : argument_list ',' expression",
00492 "argument_list : argument_list ',' NAME '[' ']'",
00493 "opt_expression :",
00494 "opt_expression : expression",
00495 "return_expression :",
00496 "return_expression : expression",
00497 "$$11 :",
00498 "expression : named_expression ASSIGN_OP $$11 expression",
00499 "$$12 :",
00500 "expression : expression AND $$12 expression",
00501 "$$13 :",
00502 "expression : expression OR $$13 expression",
00503 "expression : NOT expression",
00504 "expression : expression REL_OP expression",
00505 "expression : expression '+' expression",
00506 "expression : expression '-' expression",
00507 "expression : expression MUL_OP expression",
00508 "expression : expression '^' expression",
00509 "expression : '-' expression",
00510 "expression : named_expression",
00511 "expression : NUMBER",
00512 "expression : '(' expression ')'",
00513 "expression : NAME '(' opt_argument_list ')'",
00514 "expression : INCR_DECR named_expression",
00515 "expression : named_expression INCR_DECR",
00516 "expression : Length '(' expression ')'",
00517 "expression : Sqrt '(' expression ')'",
00518 "expression : Scale '(' expression ')'",
00519 "expression : Read '(' ')'",
00520 "named_expression : NAME",
00521 "named_expression : NAME '[' expression ']'",
00522 "named_expression : Ibase",
00523 "named_expression : Obase",
00524 "named_expression : Scale",
00525 "named_expression : Last",
00526 };
00527 #endif
00528 #ifdef YYSTACKSIZE
00529 #undef YYMAXDEPTH
00530 #define YYMAXDEPTH YYSTACKSIZE
00531 #else
00532 #ifdef YYMAXDEPTH
00533 #define YYSTACKSIZE YYMAXDEPTH
00534 #else
00535 #define YYSTACKSIZE 500
00536 #define YYMAXDEPTH 500
00537 #endif
00538 #endif
00539 int yydebug;
00540 int yynerrs;
00541 int yyerrflag;
00542 int yychar;
00543 short *yyssp;
00544 YYSTYPE *yyvsp;
00545 YYSTYPE yyval;
00546 YYSTYPE yylval;
00547 short yyss[YYSTACKSIZE];
00548 YYSTYPE yyvs[YYSTACKSIZE];
00549 #define yystacksize YYSTACKSIZE
00550 #define YYABORT goto yyabort
00551 #define YYREJECT goto yyabort
00552 #define YYACCEPT goto yyaccept
00553 #define YYERROR goto yyerrlab
00554 int
00555 yyparse()
00556 {
00557     register int yym, yyn, yystate;
00558 #if YYDEBUG
00559     register char *yys;
00560     extern char *getenv();
00561 
00562     if (yys = getenv("YYDEBUG"))
00563     {
00564         yyn = *yys;
00565         if (yyn >= '0' && yyn <= '9')
00566             yydebug = yyn - '0';
00567     }
00568 #endif
00569 
00570     yynerrs = 0;
00571     yyerrflag = 0;
00572     yychar = (-1);
00573 
00574     yyssp = yyss;
00575     yyvsp = yyvs;
00576     *yyssp = yystate = 0;
00577 
00578 yyloop:
00579     if (yyn = yydefred[yystate]) goto yyreduce;
00580     if (yychar < 0)
00581     {
00582         if ((yychar = yylex()) < 0) yychar = 0;
00583 #if YYDEBUG
00584         if (yydebug)
00585         {
00586             yys = 0;
00587             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
00588             if (!yys) yys = "illegal-symbol";
00589             printf("%sdebug: state %d, reading %d (%s)\n",
00590                     YYPREFIX, yystate, yychar, yys);
00591         }
00592 #endif
00593     }
00594     if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
00595             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
00596     {
00597 #if YYDEBUG
00598         if (yydebug)
00599             printf("%sdebug: state %d, shifting to state %d\n",
00600                     YYPREFIX, yystate, yytable[yyn]);
00601 #endif
00602         if (yyssp >= yyss + yystacksize - 1)
00603         {
00604             goto yyoverflow;
00605         }
00606         *++yyssp = yystate = yytable[yyn];
00607         *++yyvsp = yylval;
00608         yychar = (-1);
00609         if (yyerrflag > 0)  --yyerrflag;
00610         goto yyloop;
00611     }
00612     if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
00613             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
00614     {
00615         yyn = yytable[yyn];
00616         goto yyreduce;
00617     }
00618     if (yyerrflag) goto yyinrecovery;
00619 #ifdef lint
00620     goto yynewerror;
00621 #endif
00622 yynewerror:
00623     yyerror("syntax error");
00624 #ifdef lint
00625     goto yyerrlab;
00626 #endif
00627 yyerrlab:
00628     ++yynerrs;
00629 yyinrecovery:
00630     if (yyerrflag < 3)
00631     {
00632         yyerrflag = 3;
00633         for (;;)
00634         {
00635             if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
00636                     yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
00637             {
00638 #if YYDEBUG
00639                 if (yydebug)
00640                     printf("%sdebug: state %d, error recovery shifting\
00641  to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
00642 #endif
00643                 if (yyssp >= yyss + yystacksize - 1)
00644                 {
00645                     goto yyoverflow;
00646                 }
00647                 *++yyssp = yystate = yytable[yyn];
00648                 *++yyvsp = yylval;
00649                 goto yyloop;
00650             }
00651             else
00652             {
00653 #if YYDEBUG
00654                 if (yydebug)
00655                     printf("%sdebug: error recovery discarding state %d\n",
00656                             YYPREFIX, *yyssp);
00657 #endif
00658                 if (yyssp <= yyss) goto yyabort;
00659                 --yyssp;
00660                 --yyvsp;
00661             }
00662         }
00663     }
00664     else
00665     {
00666         if (yychar == 0) goto yyabort;
00667 #if YYDEBUG
00668         if (yydebug)
00669         {
00670             yys = 0;
00671             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
00672             if (!yys) yys = "illegal-symbol";
00673             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
00674                     YYPREFIX, yystate, yychar, yys);
00675         }
00676 #endif
00677         yychar = (-1);
00678         goto yyloop;
00679     }
00680 yyreduce:
00681 #if YYDEBUG
00682     if (yydebug)
00683         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
00684                 YYPREFIX, yystate, yyn, yyrule[yyn]);
00685 #endif
00686     yym = yylen[yyn];
00687     yyval = yyvsp[1-yym];
00688     switch (yyn)
00689     {
00690 case 1:
00691 #line 106 "bc.y"
00692 {
00693                               yyval.i_value = 0;
00694                               if (interactive)
00695                                 {
00696                                   printf ("%s\n", BC_VERSION);
00697                                   welcome ();
00698                                 }
00699                             }
00700 break;
00701 case 3:
00702 #line 117 "bc.y"
00703 { run_code (); }
00704 break;
00705 case 4:
00706 #line 119 "bc.y"
00707 { run_code (); }
00708 break;
00709 case 5:
00710 #line 121 "bc.y"
00711 {
00712                               yyerrok;
00713                               init_gen ();
00714                             }
00715 break;
00716 case 6:
00717 #line 127 "bc.y"
00718 { yyval.i_value = 0; }
00719 break;
00720 case 10:
00721 #line 133 "bc.y"
00722 { yyval.i_value = 0; }
00723 break;
00724 case 17:
00725 #line 142 "bc.y"
00726 { yyval.i_value = yyvsp[0].i_value; }
00727 break;
00728 case 18:
00729 #line 145 "bc.y"
00730 { warranty (""); }
00731 break;
00732 case 19:
00733 #line 147 "bc.y"
00734 { limits (); }
00735 break;
00736 case 20:
00737 #line 149 "bc.y"
00738 {
00739                               if (yyvsp[0].i_value & 2)
00740                                 warn ("comparison in expression");
00741                               if (yyvsp[0].i_value & 1)
00742                                 generate ("W");
00743                               else 
00744                                 generate ("p");
00745                             }
00746 break;
00747 case 21:
00748 #line 158 "bc.y"
00749 {
00750                               yyval.i_value = 0;
00751                               generate ("w");
00752                               generate (yyvsp[0].s_value);
00753                               free (yyvsp[0].s_value);
00754                             }
00755 break;
00756 case 22:
00757 #line 165 "bc.y"
00758 {
00759                               if (break_label == 0)
00760                                 yyerror ("Break outside a for/while");
00761                               else
00762                                 {
00763                                   sprintf (genstr, "J%1d:", break_label);
00764                                   generate (genstr);
00765                                 }
00766                             }
00767 break;
00768 case 23:
00769 #line 175 "bc.y"
00770 {
00771                               warn ("Continue statement");
00772                               if (continue_label == 0)
00773                                 yyerror ("Continue outside a for");
00774                               else
00775                                 {
00776                                   sprintf (genstr, "J%1d:", continue_label);
00777                                   generate (genstr);
00778                                 }
00779                             }
00780 break;
00781 case 24:
00782 #line 186 "bc.y"
00783 { exit (0); }
00784 break;
00785 case 25:
00786 #line 188 "bc.y"
00787 { generate ("h"); }
00788 break;
00789 case 26:
00790 #line 190 "bc.y"
00791 { generate ("0R"); }
00792 break;
00793 case 27:
00794 #line 192 "bc.y"
00795 { generate ("R"); }
00796 break;
00797 case 28:
00798 #line 194 "bc.y"
00799 {
00800                               yyvsp[0].i_value = break_label; 
00801                               break_label = next_label++;
00802                             }
00803 break;
00804 case 29:
00805 #line 199 "bc.y"
00806 {
00807                               if (yyvsp[-1].i_value > 1)
00808                                 warn ("Comparison in first for expression");
00809                               yyvsp[-1].i_value = next_label++;
00810                               if (yyvsp[-1].i_value < 0)
00811                                 sprintf (genstr, "N%1d:", yyvsp[-1].i_value);
00812                               else
00813                                 sprintf (genstr, "pN%1d:", yyvsp[-1].i_value);
00814                               generate (genstr);
00815                             }
00816 break;
00817 case 30:
00818 #line 210 "bc.y"
00819 {
00820                               if (yyvsp[-1].i_value < 0) generate ("1");
00821                               yyvsp[-1].i_value = next_label++;
00822                               sprintf (genstr, "B%1d:J%1d:", yyvsp[-1].i_value, break_label);
00823                               generate (genstr);
00824                               yyval.i_value = continue_label;
00825                               continue_label = next_label++;
00826                               sprintf (genstr, "N%1d:", continue_label);
00827                               generate (genstr);
00828                             }
00829 break;
00830 case 31:
00831 #line 221 "bc.y"
00832 {
00833                               if (yyvsp[-1].i_value > 1)
00834                                 warn ("Comparison in third for expression");
00835                               if (yyvsp[-1].i_value < 0)
00836                                 sprintf (genstr, "J%1d:N%1d:", yyvsp[-7].i_value, yyvsp[-4].i_value);
00837                               else
00838                                 sprintf (genstr, "pJ%1d:N%1d:", yyvsp[-7].i_value, yyvsp[-4].i_value);
00839                               generate (genstr);
00840                             }
00841 break;
00842 case 32:
00843 #line 231 "bc.y"
00844 {
00845                               sprintf (genstr, "J%1d:N%1d:",
00846                                        continue_label, break_label);
00847                               generate (genstr);
00848                               break_label = yyvsp[-12].i_value;
00849                               continue_label = yyvsp[-4].i_value;
00850                             }
00851 break;
00852 case 33:
00853 #line 239 "bc.y"
00854 {
00855                               yyvsp[-1].i_value = if_label;
00856                               if_label = next_label++;
00857                               sprintf (genstr, "Z%1d:", if_label);
00858                               generate (genstr);
00859                             }
00860 break;
00861 case 34:
00862 #line 246 "bc.y"
00863 {
00864                               sprintf (genstr, "N%1d:", if_label); 
00865                               generate (genstr);
00866                               if_label = yyvsp[-4].i_value;
00867                             }
00868 break;
00869 case 35:
00870 #line 252 "bc.y"
00871 {
00872                               yyvsp[0].i_value = next_label++;
00873                               sprintf (genstr, "N%1d:", yyvsp[0].i_value);
00874                               generate (genstr);
00875                             }
00876 break;
00877 case 36:
00878 #line 258 "bc.y"
00879 {
00880                               yyvsp[0].i_value = break_label; 
00881                               break_label = next_label++;
00882                               sprintf (genstr, "Z%1d:", break_label);
00883                               generate (genstr);
00884                             }
00885 break;
00886 case 37:
00887 #line 265 "bc.y"
00888 {
00889                               sprintf (genstr, "J%1d:N%1d:", yyvsp[-6].i_value, break_label);
00890                               generate (genstr);
00891                               break_label = yyvsp[-3].i_value;
00892                             }
00893 break;
00894 case 38:
00895 #line 271 "bc.y"
00896 { yyval.i_value = 0; }
00897 break;
00898 case 39:
00899 #line 273 "bc.y"
00900 {  warn ("print statement"); }
00901 break;
00902 case 43:
00903 #line 280 "bc.y"
00904 {
00905                               generate ("O");
00906                               generate (yyvsp[0].s_value);
00907                               free (yyvsp[0].s_value);
00908                             }
00909 break;
00910 case 44:
00911 #line 286 "bc.y"
00912 { generate ("P"); }
00913 break;
00914 case 46:
00915 #line 290 "bc.y"
00916 {
00917                               warn ("else clause in if statement");
00918                               yyvsp[0].i_value = next_label++;
00919                               sprintf (genstr, "J%d:N%1d:", yyvsp[0].i_value, if_label); 
00920                               generate (genstr);
00921                               if_label = yyvsp[0].i_value;
00922                             }
00923 break;
00924 case 48:
00925 #line 300 "bc.y"
00926 {
00927                               /* Check auto list against parameter list? */
00928                               check_params (yyvsp[-4].a_value,yyvsp[0].a_value);
00929                               sprintf (genstr, "F%d,%s.%s[", lookup(yyvsp[-6].s_value,FUNCT), 
00930                                        arg_str (yyvsp[-4].a_value,TRUE), arg_str (yyvsp[0].a_value,TRUE));
00931                               generate (genstr);
00932                               free_args (yyvsp[-4].a_value);
00933                               free_args (yyvsp[0].a_value);
00934                               yyvsp[-7].i_value = next_label;
00935                               next_label = 0;
00936                             }
00937 break;
00938 case 49:
00939 #line 312 "bc.y"
00940 {
00941                               generate ("0R]");
00942                               next_label = yyvsp[-11].i_value;
00943                             }
00944 break;
00945 case 50:
00946 #line 318 "bc.y"
00947 { yyval.a_value = NULL; }
00948 break;
00949 case 52:
00950 #line 322 "bc.y"
00951 { yyval.a_value = NULL; }
00952 break;
00953 case 53:
00954 #line 324 "bc.y"
00955 { yyval.a_value = yyvsp[-1].a_value; }
00956 break;
00957 case 54:
00958 #line 326 "bc.y"
00959 { yyval.a_value = yyvsp[-1].a_value; }
00960 break;
00961 case 55:
00962 #line 329 "bc.y"
00963 { yyval.a_value = nextarg (NULL, lookup (yyvsp[0].s_value,SIMPLE)); }
00964 break;
00965 case 56:
00966 #line 331 "bc.y"
00967 { yyval.a_value = nextarg (NULL, lookup (yyvsp[-2].s_value,ARRAY)); }
00968 break;
00969 case 57:
00970 #line 333 "bc.y"
00971 { yyval.a_value = nextarg (yyvsp[-2].a_value, lookup (yyvsp[0].s_value,SIMPLE)); }
00972 break;
00973 case 58:
00974 #line 335 "bc.y"
00975 { yyval.a_value = nextarg (yyvsp[-4].a_value, lookup (yyvsp[-2].s_value,ARRAY)); }
00976 break;
00977 case 59:
00978 #line 338 "bc.y"
00979 { yyval.a_value = NULL; }
00980 break;
00981 case 61:
00982 #line 342 "bc.y"
00983 {
00984                               if (yyvsp[0].i_value > 1) warn ("comparison in argument");
00985                               yyval.a_value = nextarg (NULL,0);
00986                             }
00987 break;
00988 case 62:
00989 #line 347 "bc.y"
00990 {
00991                               sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
00992                               generate (genstr);
00993                               yyval.a_value = nextarg (NULL,1);
00994                             }
00995 break;
00996 case 63:
00997 #line 353 "bc.y"
00998 {
00999                               if (yyvsp[0].i_value > 1) warn ("comparison in argument");
01000                               yyval.a_value = nextarg (yyvsp[-2].a_value,0);
01001                             }
01002 break;
01003 case 64:
01004 #line 358 "bc.y"
01005 {
01006                               sprintf (genstr, "K%d:", -lookup (yyvsp[-2].s_value,ARRAY));
01007                               generate (genstr);
01008                               yyval.a_value = nextarg (yyvsp[-4].a_value,1);
01009                             }
01010 break;
01011 case 65:
01012 #line 365 "bc.y"
01013 {
01014                               yyval.i_value = -1;
01015                               warn ("Missing expression in for statement");
01016                             }
01017 break;
01018 case 67:
01019 #line 372 "bc.y"
01020 {
01021                               yyval.i_value = 0;
01022                               generate ("0");
01023                             }
01024 break;
01025 case 68:
01026 #line 377 "bc.y"
01027 {
01028                               if (yyvsp[0].i_value > 1)
01029                                 warn ("comparison in return expresion");
01030                             }
01031 break;
01032 case 69:
01033 #line 383 "bc.y"
01034 {
01035                               if (yyvsp[0].c_value != '=')
01036                                 {
01037                                   if (yyvsp[-1].i_value < 0)
01038                                     sprintf (genstr, "DL%d:", -yyvsp[-1].i_value);
01039                                   else
01040                                     sprintf (genstr, "l%d:", yyvsp[-1].i_value);
01041                                   generate (genstr);
01042                                 }
01043                             }
01044 break;
01045 case 70:
01046 #line 394 "bc.y"
01047 {
01048                               if (yyvsp[0].i_value > 1) warn("comparison in assignment");
01049                               if (yyvsp[-2].c_value != '=')
01050                                 {
01051                                   sprintf (genstr, "%c", yyvsp[-2].c_value);
01052                                   generate (genstr);
01053                                 }
01054                               if (yyvsp[-3].i_value < 0)
01055                                 sprintf (genstr, "S%d:", -yyvsp[-3].i_value);
01056                               else
01057                                 sprintf (genstr, "s%d:", yyvsp[-3].i_value);
01058                               generate (genstr);
01059                               yyval.i_value = 0;
01060                             }
01061 break;
01062 case 71:
01063 #line 410 "bc.y"
01064 {
01065                               warn("&& operator");
01066                               yyvsp[0].i_value = next_label++;
01067                               sprintf (genstr, "DZ%d:p", yyvsp[0].i_value);
01068                               generate (genstr);
01069                             }
01070 break;
01071 case 72:
01072 #line 417 "bc.y"
01073 {
01074                               sprintf (genstr, "DZ%d:p1N%d:", yyvsp[-2].i_value, yyvsp[-2].i_value);
01075                               generate (genstr);
01076                               yyval.i_value = yyvsp[-3].i_value | yyvsp[0].i_value;
01077                             }
01078 break;
01079 case 73:
01080 #line 423 "bc.y"
01081 {
01082                               warn("|| operator");
01083                               yyvsp[0].i_value = next_label++;
01084                               sprintf (genstr, "B%d:", yyvsp[0].i_value);
01085                               generate (genstr);
01086                             }
01087 break;
01088 case 74:
01089 #line 430 "bc.y"
01090 {
01091                               int tmplab;
01092                               tmplab = next_label++;
01093                               sprintf (genstr, "B%d:0J%d:N%d:1N%d:",
01094                                        yyvsp[-2].i_value, tmplab, yyvsp[-2].i_value, tmplab);
01095                               generate (genstr);
01096                               yyval.i_value = yyvsp[-3].i_value | yyvsp[0].i_value;
01097                             }
01098 break;
01099 case 75:
01100 #line 439 "bc.y"
01101 {
01102                               yyval.i_value = yyvsp[0].i_value;
01103                               warn("! operator");
01104                               generate ("!");
01105                             }
01106 break;
01107 case 76:
01108 #line 445 "bc.y"
01109 {
01110                               yyval.i_value = 3;
01111                               switch (*(yyvsp[-1].s_value))
01112                                 {
01113                                 case '=':
01114                                   generate ("=");
01115                                   break;
01116 
01117                                 case '!':
01118                                   generate ("#");
01119                                   break;
01120 
01121                                 case '<':
01122                                   if (yyvsp[-1].s_value[1] == '=')
01123                                     generate ("{");
01124                                   else
01125                                     generate ("<");
01126                                   break;
01127 
01128                                 case '>':
01129                                   if (yyvsp[-1].s_value[1] == '=')
01130                                     generate ("}");
01131                                   else
01132                                     generate (">");
01133                                   break;
01134                                 }
01135                             }
01136 break;
01137 case 77:
01138 #line 473 "bc.y"
01139 {
01140                               generate ("+");
01141                               yyval.i_value = yyvsp[-2].i_value | yyvsp[0].i_value;
01142                             }
01143 break;
01144 case 78:
01145 #line 478 "bc.y"
01146 {
01147                               generate ("-");
01148                               yyval.i_value = yyvsp[-2].i_value | yyvsp[0].i_value;
01149                             }
01150 break;
01151 case 79:
01152 #line 483 "bc.y"
01153 {
01154                               genstr[0] = yyvsp[-1].c_value;
01155                               genstr[1] = 0;
01156                               generate (genstr);
01157                               yyval.i_value = yyvsp[-2].i_value | yyvsp[0].i_value;
01158                             }
01159 break;
01160 case 80:
01161 #line 490 "bc.y"
01162 {
01163                               generate ("^");
01164                               yyval.i_value = yyvsp[-2].i_value | yyvsp[0].i_value;
01165                             }
01166 break;
01167 case 81:
01168 #line 495 "bc.y"
01169 {
01170                               generate ("n");
01171                               yyval.i_value = yyvsp[0].i_value;
01172                             }
01173 break;
01174 case 82:
01175 #line 500 "bc.y"
01176 {
01177                               yyval.i_value = 1;
01178                               if (yyvsp[0].i_value < 0)
01179                                 sprintf (genstr, "L%d:", -yyvsp[0].i_value);
01180                               else
01181                                 sprintf (genstr, "l%d:", yyvsp[0].i_value);
01182                               generate (genstr);
01183                             }
01184 break;
01185 case 83:
01186 #line 509 "bc.y"
01187 {
01188                               int len = strlen(yyvsp[0].s_value);
01189                               yyval.i_value = 1;
01190                               if (len == 1 && *yyvsp[0].s_value == '0')
01191                                 generate ("0");
01192                               else if (len == 1 && *yyvsp[0].s_value == '1')
01193                                 generate ("1");
01194                               else
01195                                 {
01196                                   generate ("K");
01197                                   generate (yyvsp[0].s_value);
01198                                   generate (":");
01199                                 }
01200                               free (yyvsp[0].s_value);
01201                             }
01202 break;
01203 case 84:
01204 #line 525 "bc.y"
01205 { yyval.i_value = yyvsp[-1].i_value | 1; }
01206 break;
01207 case 85:
01208 #line 527 "bc.y"
01209 {
01210                               yyval.i_value = 1;
01211                               if (yyvsp[-1].a_value != NULL)
01212                                 { 
01213                                   sprintf (genstr, "C%d,%s:",
01214                                            lookup (yyvsp[-3].s_value,FUNCT),
01215                                            arg_str (yyvsp[-1].a_value,FALSE));
01216                                   free_args (yyvsp[-1].a_value);
01217                                 }
01218                               else
01219                                 {
01220                                   sprintf (genstr, "C%d:", lookup (yyvsp[-3].s_value,FUNCT));
01221                                 }
01222                               generate (genstr);
01223                             }
01224 break;
01225 case 86:
01226 #line 543 "bc.y"
01227 {
01228                               yyval.i_value = 1;
01229                               if (yyvsp[0].i_value < 0)
01230                                 {
01231                                   if (yyvsp[-1].c_value == '+')
01232                                     sprintf (genstr, "DA%d:L%d:", -yyvsp[0].i_value, -yyvsp[0].i_value);
01233                                   else
01234                                     sprintf (genstr, "DM%d:L%d:", -yyvsp[0].i_value, -yyvsp[0].i_value);
01235                                 }
01236                               else
01237                                 {
01238                                   if (yyvsp[-1].c_value == '+')
01239                                     sprintf (genstr, "i%d:l%d:", yyvsp[0].i_value, yyvsp[0].i_value);
01240                                   else
01241                                     sprintf (genstr, "d%d:l%d:", yyvsp[0].i_value, yyvsp[0].i_value);
01242                                 }
01243                               generate (genstr);
01244                             }
01245 break;
01246 case 87:
01247 #line 562 "bc.y"
01248 {
01249                               yyval.i_value = 1;
01250                               if (yyvsp[-1].i_value < 0)
01251                                 {
01252                                   sprintf (genstr, "DL%d:x", -yyvsp[-1].i_value);
01253                                   generate (genstr); 
01254                                   if (yyvsp[0].c_value == '+')
01255                                     sprintf (genstr, "A%d:", -yyvsp[-1].i_value);
01256                                   else
01257                                       sprintf (genstr, "M%d:", -yyvsp[-1].i_value);
01258                                 }
01259                               else
01260                                 {
01261                                   sprintf (genstr, "l%d:", yyvsp[-1].i_value);
01262                                   generate (genstr);
01263                                   if (yyvsp[0].c_value == '+')
01264                                     sprintf (genstr, "i%d:", yyvsp[-1].i_value);
01265                                   else
01266                                     sprintf (genstr, "d%d:", yyvsp[-1].i_value);
01267                                 }
01268                               generate (genstr);
01269                             }
01270 break;
01271 case 88:
01272 #line 585 "bc.y"
01273 { generate ("cL"); yyval.i_value = 1;}
01274 break;
01275 case 89:
01276 #line 587 "bc.y"
01277 { generate ("cR"); yyval.i_value = 1;}
01278 break;
01279 case 90:
01280 #line 589 "bc.y"
01281 { generate ("cS"); yyval.i_value = 1;}
01282 break;
01283 case 91:
01284 #line 591 "bc.y"
01285 {
01286                               warn ("read function");
01287                               generate ("cI"); yyval.i_value = 1;
01288                             }
01289 break;
01290 case 92:
01291 #line 597 "bc.y"
01292 { yyval.i_value = lookup(yyvsp[0].s_value,SIMPLE); }
01293 break;
01294 case 93:
01295 #line 599 "bc.y"
01296 {
01297                               if (yyvsp[-1].i_value > 1) warn("comparison in subscript");
01298                               yyval.i_value = lookup(yyvsp[-3].s_value,ARRAY);
01299                             }
01300 break;
01301 case 94:
01302 #line 604 "bc.y"
01303 { yyval.i_value = 0; }
01304 break;
01305 case 95:
01306 #line 606 "bc.y"
01307 { yyval.i_value = 1; }
01308 break;
01309 case 96:
01310 #line 608 "bc.y"
01311 { yyval.i_value = 2; }
01312 break;
01313 case 97:
01314 #line 610 "bc.y"
01315 { yyval.i_value = 3; }
01316 break;
01317 #line 1318 "y.tab.c"
01318     }
01319     yyssp -= yym;
01320     yystate = *yyssp;
01321     yyvsp -= yym;
01322     yym = yylhs[yyn];
01323     if (yystate == 0 && yym == 0)
01324     {
01325 #if YYDEBUG
01326         if (yydebug)
01327             printf("%sdebug: after reduction, shifting from state 0 to\
01328  state %d\n", YYPREFIX, YYFINAL);
01329 #endif
01330         yystate = YYFINAL;
01331         *++yyssp = YYFINAL;
01332         *++yyvsp = yyval;
01333         if (yychar < 0)
01334         {
01335             if ((yychar = yylex()) < 0) yychar = 0;
01336 #if YYDEBUG
01337             if (yydebug)
01338             {
01339                 yys = 0;
01340                 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
01341                 if (!yys) yys = "illegal-symbol";
01342                 printf("%sdebug: state %d, reading %d (%s)\n",
01343                         YYPREFIX, YYFINAL, yychar, yys);
01344             }
01345 #endif
01346         }
01347         if (yychar == 0) goto yyaccept;
01348         goto yyloop;
01349     }
01350     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
01351             yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
01352         yystate = yytable[yyn];
01353     else
01354         yystate = yydgoto[yym];
01355 #if YYDEBUG
01356     if (yydebug)
01357         printf("%sdebug: after reduction, shifting from state %d \
01358 to state %d\n", YYPREFIX, *yyssp, yystate);
01359 #endif
01360     if (yyssp >= yyss + yystacksize - 1)
01361     {
01362         goto yyoverflow;
01363     }
01364     *++yyssp = yystate;
01365     *++yyvsp = yyval;
01366     goto yyloop;
01367 yyoverflow:
01368     yyerror("yacc stack overflow");
01369 yyabort:
01370     return (1);
01371 yyaccept:
01372     return (0);
01373 }

Generated on Fri Apr 14 22:56:41 2006 for minix by  doxygen 1.4.6