# line 2 "bc.y" int *getout(); # define UMINUS 257 # define LETTER 258 # define DIGIT 259 # define SQRT 260 # define LENGTH 261 # define _IF 262 # define FFF 263 # define EQ 264 # define _WHILE 265 # define _FOR 266 # define NE 267 # define LE 268 # define GE 269 # define INCR 270 # define DECR 271 # define _RETURN 272 # define _BREAK 273 # define _DEFINE 274 # define BASE 275 # define OBASE 276 # define SCALE 277 # define EQPL 278 # define EQMI 279 # define EQMUL 280 # define EQDIV 281 # define EQREM 282 # define EQEXP 283 # define _AUTO 284 # define DOT 285 # define QSTR 286 # line 18 "bc.y" #include int in; char cary[1000], *cp = { cary }; char string[1000], *str = {string}; int crs = '0'; int rcrs = '0'; /* reset crs */ int bindx = 0; int lev = 0; int ln; char *ss; int bstack[10] = { 0 }; char *numb[15] = { " 0", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", " 10", " 11", " 12", " 13", " 14" }; int *pre, *post; #define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 extern int yychar; extern int yyerrflag; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif #ifndef YYSTYPE #define YYSTYPE long #endif YYSTYPE yylval, yyval; typedef int yytabelem; # define YYERRCODE 256 # line 327 "bc.y" # define error 256 int peekc = -1; int sargc; int ifile; char **sargv; char funtab[52] = { 01,0,02,0,03,0,04,0,05,0,06,0,07,0,010,0,011,0,012,0,013,0,014,0,015,0,016,0,017,0, 020,0,021,0,022,0,023,0,024,0,025,0,026,0,027,0,030,0,031,0,032,0 }; char atab[52] = { 0241,0,0242,0,0243,0,0244,0,0245,0,0246,0,0247,0,0250,0,0251,0,0252,0,0253,0, 0254,0,0255,0,0256,0,0257,0,0260,0,0261,0,0262,0,0263,0,0264,0,0265,0,0266,0, 0267,0,0270,0,0271,0,0272,0}; char *letr[26] = { "a","b","c","d","e","f","g","h","i","j", "k","l","m","n","o","p","q","r","s","t", "u","v","w","x","y","z" } ; char *dot = { "." }; yylex(){ int c, ch; restart: c = getch(); peekc = -1; while( c == ' ' || c == '\t' ) c = getch(); if(c == '\\'){ getch(); goto restart; } if( c<= 'z' && c >= 'a' ) { /* look ahead to look for reserved words */ peekc = getch(); if( peekc >= 'a' && peekc <= 'z' ){ /* must be reserved word */ if( c=='i' && peekc=='f' ){ c=_IF; goto skip; } if( c=='w' && peekc=='h' ){ c=_WHILE; goto skip; } if( c=='f' && peekc=='o' ){ c=_FOR; goto skip; } if( c=='s' && peekc=='q' ){ c=SQRT; goto skip; } if( c=='r' && peekc=='e' ){ c=_RETURN; goto skip; } if( c=='b' && peekc=='r' ){ c=_BREAK; goto skip; } if( c=='d' && peekc=='e' ){ c=_DEFINE; goto skip; } if( c=='s' && peekc=='c' ){ c= SCALE; goto skip; } if( c=='b' && peekc=='a' ){ c=BASE; goto skip; } if( c=='i' && peekc == 'b'){ c=BASE; goto skip; } if( c=='o' && peekc=='b' ){ c=OBASE; goto skip; } if( c=='d' && peekc=='i' ){ c=FFF; goto skip; } if( c=='a' && peekc=='u' ){ c=_AUTO; goto skip; } if( c == 'l' && peekc=='e'){ c=LENGTH; goto skip; } if( c == 'q' && peekc == 'u'){getout();} /* could not be found */ return( error ); skip: /* skip over rest of word */ peekc = -1; while( (ch = getch()) >= 'a' && ch <= 'z' ); peekc = ch; return( c ); } /* usual case; just one single letter */ yylval = letr[c-'a']; return( LETTER ); } if( c>= '0' && c <= '9' || c>= 'A' && c<= 'F' ){ yylval = c; return( DIGIT ); } switch( c ){ case '.': return( DOT ); case '=': switch( peekc = getch() ){ case '=': c=EQ; goto gotit; case '+': c=EQPL; goto gotit; case '-': c=EQMI; goto gotit; case '*': c=EQMUL; goto gotit; case '/': c=EQDIV; goto gotit; case '%': c=EQREM; goto gotit; case '^': c=EQEXP; goto gotit; default: return( '=' ); gotit: peekc = -1; return(c); } case '+': return( cpeek( '+', INCR, '+' ) ); case '-': return( cpeek( '-', DECR, '-' ) ); case '<': return( cpeek( '=', LE, '<' ) ); case '>': return( cpeek( '=', GE, '>' ) ); case '!': return( cpeek( '=', NE, '!' ) ); case '/': if((peekc = getch()) == '*'){ peekc = -1; while((getch() != '*') || ((peekc = getch()) != '/')); peekc = -1; goto restart; } else return(c); case '"': yylval = str; while((c=getch()) != '"'){*str++ = c; if(str >= &string[999]){yyerror("string space exceeded"); getout(); } } *str++ = '\0'; return(QSTR); default: return( c ); } } cpeek( c, yes, no ){ if( (peekc=getch()) != c ) return( no ); else { peekc = -1; return( yes ); } } getch(){ int ch; loop: ch = (peekc < 0) ? getc(in) : peekc; peekc = -1; if(ch != EOF)return(ch); if(++ifile > sargc){ if(ifile >= sargc+2)getout(); in = stdin; ln = 0; goto loop; } fclose(in); if((in = fopen(sargv[ifile],"r")) != NULL){ ln = 0; ss = sargv[ifile]; goto loop; } yyerror("cannot open input file"); } # define b_sp_max 3000 int b_space [ b_sp_max ]; int * b_sp_nxt = { b_space }; int bdebug = 0; bundle(a){ int i, *p, *q; p = &a; i = *p++; q = b_sp_nxt; if( bdebug ) printf("bundle %d elements at %o\n",i, q ); while(i-- > 0){ if( b_sp_nxt >= & b_space[b_sp_max] ) yyerror( "bundling space exceeded" ); * b_sp_nxt++ = *p++; } * b_sp_nxt++ = 0; yyval = q; return( q ); } routput(p) int *p; { if( bdebug ) printf("routput(%o)\n", p ); if( p >= &b_space[0] && p < &b_space[b_sp_max]){ /* part of a bundle */ while( *p != 0 ) routput( *p++ ); } else printf( p ); /* character string */ } output( p ) int *p; { routput( p ); b_sp_nxt = & b_space[0]; printf( "\n" ); fflush(stdout); cp = cary; crs = rcrs; } conout( p, s ) int *p; char *s; { printf("["); routput( p ); printf("]s%s\n", s ); fflush(stdout); lev--; } yyerror( s ) char *s; { if(ifile > sargc)ss="teletype"; printf("c[%s on line %d, %s]pc\n", s ,ln+1,ss); fflush(stdout); cp = cary; crs = rcrs; bindx = 0; lev = 0; b_sp_nxt = &b_space[0]; } pp( s ) char *s; { /* puts the relevant stuff on pre and post for the letter s */ bundle(3, "S", s, pre ); pre = yyval; bundle(4, post, "L", s, "s." ); post = yyval; } tp( s ) char *s; { /* same as pp, but for temps */ bundle(3, "0S", s, pre ); pre = yyval; bundle(4, post, "L", s, "s." ); post = yyval; } yyinit(argc,argv) int argc; char *argv[];{ signal( 2, (int(*)())1 ); /* ignore all interrupts */ sargv=argv; sargc= -- argc; if(sargc == 0)in=stdin; else if((in = fopen(sargv[1],"r")) == NULL) yyerror("cannot open input file"); ifile = 1; ln = 0; ss = sargv[1]; } int *getout(){ printf("q"); fflush(stdout); exit(1); } int * getf(p) char *p;{ return(&funtab[2*(*p -0141)]); } int * geta(p) char *p;{ return(&atab[2*(*p - 0141)]); } main(argc, argv) char **argv; { int p[2]; char *dc_prog = NULL; if ( argc > 1 && strcmp(argv[1], "-d") == 0 ) { dc_prog = argv[2]; argc -= 2 ; argv += 2 ; } if (argc > 1 && *argv[1] == '-') { if((argv[1][1] == 'd')||(argv[1][1] == 'c')){ yyinit(--argc, ++argv); yyparse(); exit(1); } if(argv[1][1] != 'l'){ printf("unrecognizable argument\n"); fflush(stdout); exit(1); } argv[1] = "/usr/lib/lib.b"; } pipe(p); if (fork()==0) { close(1); dup(p[1]); close(p[0]); close(p[1]); yyinit(argc, argv); yyparse(); exit(0); } close(0); dup(p[0]); close(p[0]); close(p[1]); if ( dc_prog != NULL ){ execl(dc_prog, "dc", "-", 0); } execlp("dc", "dc", "-", 0); execlp("dc215", "dc", "-", 0); execl("/bin/dc", "dc", "-", 0); execl("/usr/bin/dc", "dc", "-", 0); execlp("./dc", "dc", "-", 0); } static const yytabelem yyexca[] ={ -1, 1, 0, -1, 59, 7, 10, 7, -2, 0, -1, 12, 125, 7, 59, 7, 10, 7, -2, 0, -1, 126, 125, 7, 59, 7, 10, 7, -2, 0, -1, 184, 125, 7, 59, 7, 10, 7, -2, 0, -1, 193, 125, 7, 59, 7, 10, 7, -2, 0, -1, 208, 125, 7, 59, 7, 10, 7, -2, 0, -1, 210, 125, 7, 59, 7, 10, 7, -2, 0, }; # define YYNPROD 121 # define YYLAST 768 static const yytabelem yyact[]={ 26, 92, 31, 98, 38, 20, 142, 88, 77, 76, 84, 43, 126, 71, 129, 33, 41, 39, 113, 40, 34, 42, 150, 27, 90, 91, 89, 86, 87, 85, 44, 34, 23, 26, 164, 152, 165, 43, 20, 144, 143, 210, 41, 39, 43, 40, 101, 42, 43, 41, 39, 131, 40, 41, 42, 31, 27, 93, 42, 208, 34, 162, 34, 193, 127, 160, 26, 37, 44, 35, 154, 20, 99, 155, 132, 100, 128, 97, 96, 94, 35, 57, 30, 12, 111, 73, 18, 26, 31, 27, 17, 214, 20, 184, 44, 36, 222, 3, 1, 0, 203, 44, 74, 75, 0, 44, 0, 26, 117, 35, 27, 35, 20, 0, 0, 0, 12, 0, 0, 18, 0, 31, 0, 0, 0, 145, 0, 26, 112, 0, 27, 43, 20, 0, 0, 213, 41, 39, 0, 40, 191, 42, 31, 161, 0, 72, 125, 2, 26, 12, 27, 0, 18, 20, 0, 0, 50, 0, 0, 0, 0, 0, 31, 185, 0, 0, 32, 0, 151, 0, 62, 27, 0, 83, 190, 192, 0, 134, 0, 0, 0, 0, 31, 0, 0, 26, 0, 202, 44, 0, 20, 136, 0, 83, 0, 0, 50, 0, 204, 0, 0, 0, 0, 31, 43, 0, 0, 156, 27, 41, 39, 0, 40, 83, 42, 0, 14, 134, 6, 32, 28, 25, 15, 13, 0, 16, 29, 221, 0, 50, 21, 22, 8, 7, 83, 10, 11, 9, 163, 0, 31, 166, 168, 167, 205, 24, 5, 133, 0, 14, 45, 6, 32, 28, 25, 15, 13, 0, 16, 29, 62, 44, 0, 21, 22, 8, 7, 19, 10, 11, 9, 83, 159, 215, 217, 211, 0, 0, 24, 5, 46, 58, 14, 223, 6, 32, 28, 25, 15, 13, 224, 16, 29, 0, 0, 186, 21, 22, 8, 7, 0, 10, 11, 9, 0, 79, 32, 28, 25, 140, 0, 24, 5, 0, 0, 138, 0, 21, 22, 0, 0, 0, 81, 82, 80, 79, 32, 28, 25, 67, 0, 0, 24, 0, 0, 63, 0, 21, 22, 209, 0, 0, 81, 82, 80, 115, 32, 28, 25, 0, 0, 0, 24, 0, 216, 0, 218, 21, 22, 0, 0, 0, 81, 82, 80, 0, 79, 32, 28, 25, 0, 0, 24, 0, 0, 0, 0, 0, 21, 22, 0, 0, 0, 81, 82, 80, 48, 49, 0, 0, 0, 0, 0, 24, 51, 52, 53, 54, 55, 56, 60, 61, 0, 115, 32, 28, 25, 0, 51, 52, 53, 54, 55, 56, 0, 21, 22, 0, 0, 0, 81, 82, 80, 43, 0, 0, 48, 49, 41, 39, 24, 40, 0, 42, 51, 52, 53, 54, 55, 56, 135, 0, 0, 0, 0, 0, 0, 47, 0, 0, 59, 64, 68, 0, 0, 0, 0, 0, 0, 48, 49, 0, 0, 0, 0, 0, 0, 51, 52, 53, 54, 55, 56, 0, 0, 0, 0, 0, 0, 201, 44, 0, 0, 0, 188, 189, 0, 0, 0, 0, 60, 61, 51, 52, 53, 54, 55, 56, 51, 52, 53, 54, 55, 56, 188, 189, 0, 0, 0, 0, 0, 0, 51, 52, 53, 54, 55, 56, 69, 70, 0, 137, 139, 141, 65, 66, 51, 52, 53, 54, 55, 56, 51, 52, 53, 54, 55, 56, 69, 70, 4, 0, 0, 0, 65, 66, 51, 52, 53, 54, 55, 56, 51, 52, 53, 54, 55, 56, 0, 0, 0, 78, 0, 0, 0, 0, 0, 95, 43, 0, 0, 0, 0, 41, 39, 0, 40, 0, 42, 0, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 183, 114, 0, 0, 187, 0, 0, 0, 116, 118, 119, 0, 0, 120, 121, 122, 0, 43, 123, 124, 0, 182, 41, 39, 43, 40, 130, 42, 181, 41, 39, 0, 40, 0, 42, 44, 43, 0, 0, 0, 158, 41, 39, 0, 40, 146, 42, 148, 149, 0, 0, 43, 212, 0, 0, 157, 41, 39, 0, 40, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 41, 39, 0, 40, 44, 42, 0, 0, 0, 130, 0, 44, 169, 0, 170, 171, 172, 173, 174, 175, 176, 177, 178, 44, 179, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 170, 44, 0, 0, 130, 0, 194, 195, 196, 197, 198, 199, 200, 43, 153, 44, 0, 147, 41, 39, 0, 40, 0, 42, 0, 0, 0, 0, 0, 0, 206, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44 }; static const yytabelem yypact[]={ -1000, -7, 50, -254, 167, -1000, 189, -1000, 41, 220, 274, 268, 26, -1000, -1000, -1000, -1000, -1000, -249, -250, 108, -248, -251, -284, -93, 39, 108, -1000, 38, 37, -256, -1000, -1000, -1000, -1000, -1000, 31, -1000, -45, 108, 108, 108, 108, 108, 108, 108, 108, 108, -1000, -1000, 87, -1000, -1000, -1000, -1000, -1000, -1000, 67, 108, 108, -1000, -1000, 108, 108, 108, -1000, -1000, 108, 108, -1000, -1000, 21, -1000, -1000, 36, 108, -10, 34, -1000, 156, 130, 254, 248, -252, -51, -1000, -1000, -1000, -52, -1000, -1000, -1000, -93, -1000, 108, 673, 108, 108, -1000, -101, -254, -58, 11, 11, -64, -64, -64, -64, 167, 618, 167, 29, -1000, -1000, 167, 116, 604, -1000, 167, 167, 589, 167, 167, 167, 167, -1000, 26, 25, 108, 2, -26, 108, -1000, 108, 108, 108, 108, 108, 108, 108, 108, 108, -1000, 108, 108, -1000, 577, -1000, 570, 531, 50, -1000, -1000, 234, -1000, 145, 47, -1000, -1000, -1000, 108, 22, 108, 108, 108, 108, 108, 108, 108, 167, 386, 167, 167, 167, 167, 167, 167, 167, 167, 94, 7, -1000, -1000, -1000, -40, -1000, 108, 108, -1000, -1000, -1000, -1000, 18, 26, 0, 167, 167, 167, 167, 167, 167, 214, -1000, -1000, 10, -254, 167, 167, 26, -1000, 26, 108, 108, -1000, 52, -1000, -1000, -1000, -1000, 167, 167, -1000, -254, -1000, -1000 }; static const yytabelem yypgo[]={ 0, 98, 145, 12, 97, 95, 93, 13, 91, 540, 440, 85, 64, 14, 90, 84, 32, 18, 82, 67 }; static const yytabelem yyr1[]={ 0, 1, 1, 1, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 14, 12, 7, 7, 3, 3, 13, 13, 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 15, 15, 17, 17, 16, 18, 18, 18, 11, 4, 5, 5, 5, 8, 8, 19, 19 }; static const yytabelem yyr2[]={ 0, 0, 7, 17, 2, 8, 3, 1, 3, 7, 13, 7, 13, 3, 9, 7, 3, 7, 7, 7, 7, 7, 7, 7, 3, 3, 15, 15, 17, 9, 3, 3, 3, 3, 3, 3, 9, 1, 2, 7, 3, 2, 7, 7, 7, 7, 7, 7, 3, 7, 7, 5, 7, 7, 7, 7, 9, 5, 5, 5, 5, 11, 11, 11, 11, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, 7, 3, 5, 7, 5, 3, 3, 7, 7, 13, 13, 9, 9, 7, 3, 9, 5, 7, 7, 7, 7, 7, 7, 3, 3, 3, 2, 7, 2, 7, 3, 3, 3, 5, 1, 7, 0, 3, 7, 3, 7, 2, 7 }; static const yytabelem yychk[]={ -1000, -1, -2, -4, -9, 286, 258, 273, 272, 277, 275, 276, 123, 263, 256, 262, 265, -14, 126, 274, 45, 270, 271, -16, 285, 261, 40, 63, 260, 266, -18, 95, 259, -3, 10, 59, -5, -19, 258, 43, 45, 42, 47, 37, 94, 61, 91, -10, 270, 271, 40, 278, 279, 280, 281, 282, 283, 40, 61, -10, 270, 271, 40, 61, -10, 270, 271, 61, -10, 270, 271, -7, -2, -11, -11, -11, 258, 258, -9, 258, 277, 275, 276, 126, 258, 277, 275, 276, 258, 277, 275, 276, 285, -16, 40, -9, 40, 40, 259, 41, 44, 91, -9, -9, -9, -9, -9, -9, -9, -9, -9, -15, 41, -17, -9, 258, -9, 41, -9, -9, -9, -9, -9, -9, -9, 125, -3, -12, 40, -13, -9, 61, 40, 91, 61, -10, 61, -10, 61, -10, 61, -10, 258, 91, 91, -16, -9, 41, -9, -9, 123, -19, 93, 93, 41, 44, 91, 41, 41, -2, 40, -13, 59, 264, 60, 62, 267, 269, 268, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 41, 41, 59, -6, -3, 61, -10, 270, 271, -17, 93, -13, 41, -9, -9, -9, -9, -9, -9, -9, 93, 93, 93, -7, 284, -9, -9, 41, -2, 41, 61, -10, 125, -8, -19, -2, -12, -2, -9, -9, -3, 44, -12, -19 }; static const yytabelem yydef[]={ 1, -2, 0, 114, 6, 8, 84, 13, 16, 101, 102, 103, -2, 24, 25, 112, 112, 112, 0, 0, 0, 0, 0, 79, 83, 0, 0, 92, 0, 0, 108, 109, 110, 2, 40, 41, 0, 115, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 60, 0, 30, 31, 32, 33, 34, 35, 0, 0, 0, 65, 67, 0, 0, 0, 69, 71, 0, 0, 73, 75, 0, 38, 37, 0, 0, 94, 0, 51, 84, 101, 102, 103, 0, 58, 66, 70, 74, 59, 68, 72, 76, 82, 80, 0, 0, 0, 0, 111, 0, 0, 0, 49, 50, 52, 53, 54, 55, 9, 0, 11, 0, 78, 104, 106, 84, 0, 15, 17, 18, 0, 19, 20, 21, 22, 23, -2, 0, 0, 0, 48, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 81, 0, 91, 0, 0, 0, 116, 120, 56, 77, 0, 0, 14, 90, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 85, 86, 95, 96, 97, 98, 99, 100, 0, 0, 89, 93, 36, -2, 4, 0, 0, 61, 63, 105, 107, 0, -2, 0, 42, 43, 44, 45, 46, 47, 56, 62, 64, 0, 0, 10, 12, -2, 37, -2, 0, 0, 3, 0, 117, 26, 27, 37, 87, 88, 5, 0, 28, 118 }; typedef struct { char *t_name; int t_val; } yytoktype; #ifndef YYDEBUG # define YYDEBUG 0 /* don't allow debugging */ #endif #if YYDEBUG yytoktype yytoks[] = { "=", 61, "+", 43, "-", 45, "*", 42, "/", 47, "%", 37, "^", 94, "UMINUS", 257, "LETTER", 258, "DIGIT", 259, "SQRT", 260, "LENGTH", 261, "_IF", 262, "FFF", 263, "EQ", 264, "_WHILE", 265, "_FOR", 266, "NE", 267, "LE", 268, "GE", 269, "INCR", 270, "DECR", 271, "_RETURN", 272, "_BREAK", 273, "_DEFINE", 274, "BASE", 275, "OBASE", 276, "SCALE", 277, "EQPL", 278, "EQMI", 279, "EQMUL", 280, "EQDIV", 281, "EQREM", 282, "EQEXP", 283, "_AUTO", 284, "DOT", 285, "QSTR", 286, "-unknown-", -1 /* ends search */ }; char * yyreds[] = { "-no such reduction-", "start : /* empty */", "start : start stat tail", "start : start def dargs ')' '{' dlist slist '}'", "dlist : tail", "dlist : dlist _AUTO dlets tail", "stat : e", "stat : /* empty */", "stat : QSTR", "stat : LETTER '=' e", "stat : LETTER '[' e ']' '=' e", "stat : LETTER EQOP e", "stat : LETTER '[' e ']' EQOP e", "stat : _BREAK", "stat : _RETURN '(' e ')'", "stat : _RETURN '(' ')'", "stat : _RETURN", "stat : SCALE '=' e", "stat : SCALE EQOP e", "stat : BASE '=' e", "stat : BASE EQOP e", "stat : OBASE '=' e", "stat : OBASE EQOP e", "stat : '{' slist '}'", "stat : FFF", "stat : error", "stat : _IF CRS BLEV '(' re ')' stat", "stat : _WHILE CRS '(' re ')' stat BLEV", "stat : fprefix CRS re ';' e ')' stat BLEV", "stat : '~' LETTER '=' e", "EQOP : EQPL", "EQOP : EQMI", "EQOP : EQMUL", "EQOP : EQDIV", "EQOP : EQREM", "EQOP : EQEXP", "fprefix : _FOR '(' e ';'", "BLEV : /* empty */", "slist : stat", "slist : slist tail stat", "tail : '\n'", "tail : ';'", "re : e EQ e", "re : e '<' e", "re : e '>' e", "re : e NE e", "re : e GE e", "re : e LE e", "re : e", "e : e '+' e", "e : e '-' e", "e : '-' e", "e : e '*' e", "e : e '/' e", "e : e '%' e", "e : e '^' e", "e : LETTER '[' e ']'", "e : LETTER INCR", "e : INCR LETTER", "e : DECR LETTER", "e : LETTER DECR", "e : LETTER '[' e ']' INCR", "e : INCR LETTER '[' e ']'", "e : LETTER '[' e ']' DECR", "e : DECR LETTER '[' e ']'", "e : SCALE INCR", "e : INCR SCALE", "e : SCALE DECR", "e : DECR SCALE", "e : BASE INCR", "e : INCR BASE", "e : BASE DECR", "e : DECR BASE", "e : OBASE INCR", "e : INCR OBASE", "e : OBASE DECR", "e : DECR OBASE", "e : LETTER '(' cargs ')'", "e : LETTER '(' ')'", "e : cons", "e : DOT cons", "e : cons DOT cons", "e : cons DOT", "e : DOT", "e : LETTER", "e : LETTER '=' e", "e : LETTER EQOP e", "e : LETTER '[' e ']' '=' e", "e : LETTER '[' e ']' EQOP e", "e : LENGTH '(' e ')'", "e : SCALE '(' e ')'", "e : '(' e ')'", "e : '?'", "e : SQRT '(' e ')'", "e : '~' LETTER", "e : SCALE '=' e", "e : SCALE EQOP e", "e : BASE '=' e", "e : BASE EQOP e", "e : OBASE '=' e", "e : OBASE EQOP e", "e : SCALE", "e : BASE", "e : OBASE", "cargs : eora", "cargs : cargs ',' eora", "eora : e", "eora : LETTER '[' ']'", "cons : constant", "constant : '_'", "constant : DIGIT", "constant : constant DIGIT", "CRS : /* empty */", "def : _DEFINE LETTER '('", "dargs : /* empty */", "dargs : lora", "dargs : dargs ',' lora", "dlets : lora", "dlets : dlets ',' lora", "lora : LETTER", "lora : LETTER '[' ']'", }; #endif /* YYDEBUG */ /* * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED */ /* * OSF/1 Release 1.0 */ /* @(#)yaccpar 1.3 com/cmd/lang/yacc,3.1, 9/7/89 18:46:37 */ /* ** Skeleton parser driver for yacc output */ /* ** yacc user known macros and defines */ #ifdef YYSPLIT # define YYERROR return(-2) #else # define YYERROR goto yyerrlab #endif #define YYACCEPT return(0) #define YYABORT return(1) #define YYBACKUP( newtoken, newvalue )\ {\ if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\ {\ yyerror( "syntax error - cannot backup" );\ goto yyerrlab;\ }\ yychar = newtoken;\ yystate = *yyps;\ yylval = newvalue;\ goto yynewstate;\ } #define YYRECOVERING() (!!yyerrflag) #ifndef YYDEBUG # define YYDEBUG 1 /* make debugging available */ #endif /* ** user known globals */ int yydebug; /* set to 1 to get debugging */ /* ** driver internal defines */ #define YYFLAG (-1000) #ifdef YYSPLIT # define YYSCODE { \ extern int (*yyf[])(); \ register int yyret; \ if (yyf[yytmp]) \ if ((yyret=(*yyf[yytmp])()) == -2) \ goto yyerrlab; \ else if (yyret>=0) return(yyret); \ } #endif /* ** local variables used by the parser * these should be static in order to support * multiple parsers in a single executable program. POSIX 1003.2-1993 */ static YYSTYPE yyv[ YYMAXDEPTH ]; /* value stack */ static int yys[ YYMAXDEPTH ]; /* state stack */ static YYSTYPE *yypv; /* top of value stack */ static YYSTYPE *yypvt; /* top of value stack for $vars */ static int *yyps; /* top of state stack */ static int yystate; /* current state */ static int yytmp; /* extra var (lasts between blocks) */ /* ** global variables used by the parser - renamed as a result of -p */ int yynerrs; /* number of errors */ int yyerrflag; /* error recovery flag */ int yychar; /* current input token number */ /* ** yyparse - return 0 if worked, 1 if syntax error not recovered from */ int yyparse() { /* ** Initialize externals - yyparse may be called more than once */ yypv = &yyv[-1]; yyps = &yys[-1]; yystate = 0; yytmp = 0; yynerrs = 0; yyerrflag = 0; yychar = -1; goto yystack; { register YYSTYPE *yy_pv; /* top of value stack */ register int *yy_ps; /* top of state stack */ register int yy_state; /* current state */ register int yy_n; /* internal state number info */ /* ** get globals into registers. ** branch to here only if YYBACKUP was called. */ yynewstate: yy_pv = yypv; yy_ps = yyps; yy_state = yystate; goto yy_newstate; /* ** get globals into registers. ** either we just started, or we just finished a reduction */ yystack: yy_pv = yypv; yy_ps = yyps; yy_state = yystate; /* ** top of for (;;) loop while no reductions done */ yy_stack: /* ** put a state and value onto the stacks */ #if YYDEBUG /* ** if debugging, look up token value in list of value vs. ** name pairs. 0 and negative (-1) are special values. ** Note: linear search is used since time is not a real ** consideration while debugging. */ if ( yydebug ) { register int yy_i; printf( "State %d, token ", yy_state ); if ( yychar == 0 ) printf( "end-of-file\n" ); else if ( yychar < 0 ) printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) break; } printf( "%s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ if ( ++yy_ps >= &yys[ YYMAXDEPTH ] ) /* room on stack? */ { yyerror( "yacc stack overflow" ); YYABORT; } *yy_ps = yy_state; *++yy_pv = yyval; /* ** we have a new state - find out what to do */ yy_newstate: if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG ) goto yydefault; /* simple state */ #if YYDEBUG /* ** if debugging, need to mark whether new token grabbed */ yytmp = yychar < 0; #endif if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) yychar = 0; /* reached EOF */ #if YYDEBUG if ( yydebug && yytmp ) { register int yy_i; printf( "Received token " ); if ( yychar == 0 ) printf( "end-of-file\n" ); else if ( yychar < 0 ) printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) break; } printf( "%s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) ) goto yydefault; if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/ { yychar = -1; yyval = yylval; yy_state = yy_n; if ( yyerrflag > 0 ) yyerrflag--; goto yy_stack; } yydefault: if ( ( yy_n = yydef[ yy_state ] ) == -2 ) { #if YYDEBUG yytmp = yychar < 0; #endif if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) ) yychar = 0; /* reached EOF */ #if YYDEBUG if ( yydebug && yytmp ) { register int yy_i; printf( "Received token " ); if ( yychar == 0 ) printf( "end-of-file\n" ); else if ( yychar < 0 ) printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) { break; } } printf( "%s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ /* ** look through exception table */ { register const int *yyxi = yyexca; while ( ( *yyxi != -1 ) || ( yyxi[1] != yy_state ) ) { yyxi += 2; } while ( ( *(yyxi += 2) >= 0 ) && ( *yyxi != yychar ) ) ; if ( ( yy_n = yyxi[1] ) < 0 ) YYACCEPT; } } /* ** check for syntax error */ if ( yy_n == 0 ) /* have an error */ { /* no worry about speed here! */ switch ( yyerrflag ) { case 0: /* new error */ yyerror( "syntax error" ); goto skip_init; yyerrlab: /* ** get globals into registers. ** we have a user generated syntax type error */ yy_pv = yypv; yy_ps = yyps; yy_state = yystate; yynerrs++; skip_init: case 1: case 2: /* incompletely recovered error */ /* try again... */ yyerrflag = 3; /* ** find state where "error" is a legal ** shift action */ while ( yy_ps >= yys ) { yy_n = yypact[ *yy_ps ] + YYERRCODE; if ( yy_n >= 0 && yy_n < YYLAST && yychk[yyact[yy_n]] == YYERRCODE) { /* ** simulate shift of "error" */ yy_state = yyact[ yy_n ]; goto yy_stack; } /* ** current state has no shift on ** "error", pop stack */ #if YYDEBUG # define _POP_ "Error recovery pops state %d, uncovers state %d\n" if ( yydebug ) printf( _POP_, *yy_ps, yy_ps[-1] ); # undef _POP_ #endif yy_ps--; yy_pv--; } /* ** there is no state on stack with "error" as ** a valid shift. give up. */ YYABORT; case 3: /* no shift yet; eat a token */ #if YYDEBUG /* ** if debugging, look up token in list of ** pairs. 0 and negative shouldn't occur, ** but since timing doesn't matter when ** debugging, it doesn't hurt to leave the ** tests here. */ if ( yydebug ) { register int yy_i; printf( "Error recovery discards " ); if ( yychar == 0 ) printf( "token end-of-file\n" ); else if ( yychar < 0 ) printf( "token -none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) { break; } } printf( "token %s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ if ( yychar == 0 ) /* reached EOF. quit */ YYABORT; yychar = -1; goto yy_newstate; } }/* end if ( yy_n == 0 ) */ /* ** reduction by production yy_n ** put stack tops, etc. so things right after switch */ #if YYDEBUG /* ** if debugging, print the string that is the user's ** specification of the reduction which is just about ** to be done. */ if ( yydebug ) printf( "Reduce by (%d) \"%s\"\n", yy_n, yyreds[ yy_n ] ); #endif yytmp = yy_n; /* value to switch over */ yypvt = yy_pv; /* $vars top of value stack */ /* ** Look in goto table for next state ** Sorry about using yy_state here as temporary ** register variable, but why not, if it works... ** If yyr2[ yy_n ] doesn't have the low order bit ** set, then there is no action to be done for ** this reduction. So, no saving & unsaving of ** registers done. The only difference between the ** code just after the if and the body of the if is ** the goto yy_stack in the body. This way the test ** can be made before the choice of what to do is needed. */ { /* length of production doubled with extra bit */ register int yy_len = yyr2[ yy_n ]; if ( !( yy_len & 01 ) ) { yy_len >>= 1; yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + *( yy_ps -= yy_len ) + 1; if ( yy_state >= YYLAST || yychk[ yy_state = yyact[ yy_state ] ] != -yy_n ) { yy_state = yyact[ yypgo[ yy_n ] ]; } goto yy_stack; } yy_len >>= 1; yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + *( yy_ps -= yy_len ) + 1; if ( yy_state >= YYLAST || yychk[ yy_state = yyact[ yy_state ] ] != -yy_n ) { yy_state = yyact[ yypgo[ yy_n ] ]; } } /* save until reenter driver code */ yystate = yy_state; yyps = yy_ps; yypv = yy_pv; } /* ** code supplied by user is placed in this switch */ switch(yytmp){ case 2: # line 38 "bc.y" output( yypvt[-1] ); /*NOTREACHED*/ break; case 3: # line 40 "bc.y" { bundle( 6,pre, yypvt[-1], post ,"0",numb[lev],"Q"); conout( yyval, yypvt[-6] ); rcrs = crs; output( "" ); lev = bindx = 0; } /*NOTREACHED*/ break; case 6: # line 53 "bc.y" { bundle(2, yypvt[-0], "ps." ); } /*NOTREACHED*/ break; case 7: # line 55 "bc.y" { bundle(1, "" ); } /*NOTREACHED*/ break; case 8: # line 57 "bc.y" { bundle(3,"[",yypvt[-0],"]P");} /*NOTREACHED*/ break; case 9: # line 59 "bc.y" { bundle(3, yypvt[-0], "s", yypvt[-2] ); } /*NOTREACHED*/ break; case 10: # line 61 "bc.y" { bundle(4, yypvt[-0], yypvt[-3], ":", geta(yypvt[-5])); } /*NOTREACHED*/ break; case 11: # line 63 "bc.y" { bundle(6, "l", yypvt[-2], yypvt[-0], yypvt[-1], "s", yypvt[-2] ); } /*NOTREACHED*/ break; case 12: # line 65 "bc.y" { bundle(8,yypvt[-3], ";", geta(yypvt[-5]), yypvt[-0], yypvt[-1], yypvt[-3], ":", geta(yypvt[-5]));} /*NOTREACHED*/ break; case 13: # line 67 "bc.y" { bundle(2, numb[lev-bstack[bindx-1]], "Q" ); } /*NOTREACHED*/ break; case 14: # line 69 "bc.y" bundle(4, yypvt[-1], post, numb[lev], "Q" ); /*NOTREACHED*/ break; case 15: # line 71 "bc.y" bundle(4, "0", post, numb[lev], "Q" ); /*NOTREACHED*/ break; case 16: # line 73 "bc.y" bundle(4,"0",post,numb[lev],"Q"); /*NOTREACHED*/ break; case 17: # line 75 "bc.y" bundle(2, yypvt[-0], "k"); /*NOTREACHED*/ break; case 18: # line 77 "bc.y" bundle(4,"K",yypvt[-0],yypvt[-1],"k"); /*NOTREACHED*/ break; case 19: # line 79 "bc.y" bundle(2,yypvt[-0], "i"); /*NOTREACHED*/ break; case 20: # line 81 "bc.y" bundle(4,"I",yypvt[-0],yypvt[-1],"i"); /*NOTREACHED*/ break; case 21: # line 83 "bc.y" bundle(2,yypvt[-0],"o"); /*NOTREACHED*/ break; case 22: # line 85 "bc.y" bundle(4,"O",yypvt[-0],yypvt[-1],"o"); /*NOTREACHED*/ break; case 23: # line 87 "bc.y" { yyval = yypvt[-1]; } /*NOTREACHED*/ break; case 24: # line 89 "bc.y" { bundle(1,"fY"); } /*NOTREACHED*/ break; case 25: # line 91 "bc.y" { bundle(1,"c"); } /*NOTREACHED*/ break; case 26: # line 93 "bc.y" { conout( yypvt[-0], yypvt[-5] ); bundle(3, yypvt[-2], yypvt[-5], " " ); } /*NOTREACHED*/ break; case 27: # line 97 "bc.y" { bundle(3, yypvt[-1], yypvt[-3], yypvt[-5] ); conout( yyval, yypvt[-5] ); bundle(3, yypvt[-3], yypvt[-5], " " ); } /*NOTREACHED*/ break; case 28: # line 102 "bc.y" { bundle(5, yypvt[-1], yypvt[-3], "s.", yypvt[-5], yypvt[-6] ); conout( yyval, yypvt[-6] ); bundle(5, yypvt[-7], "s.", yypvt[-5], yypvt[-6], " " ); } /*NOTREACHED*/ break; case 29: # line 107 "bc.y" { bundle(3,yypvt[-0],"S",yypvt[-2]); } /*NOTREACHED*/ break; case 30: # line 111 "bc.y" { yyval = "+"; } /*NOTREACHED*/ break; case 31: # line 113 "bc.y" { yyval = "-"; } /*NOTREACHED*/ break; case 32: # line 115 "bc.y" { yyval = "*"; } /*NOTREACHED*/ break; case 33: # line 117 "bc.y" { yyval = "/"; } /*NOTREACHED*/ break; case 34: # line 119 "bc.y" { yyval = "%%"; } /*NOTREACHED*/ break; case 35: # line 121 "bc.y" { yyval = "^"; } /*NOTREACHED*/ break; case 36: # line 125 "bc.y" { yyval = yypvt[-1]; } /*NOTREACHED*/ break; case 37: # line 129 "bc.y" { --bindx; } /*NOTREACHED*/ break; case 39: # line 134 "bc.y" { bundle(2, yypvt[-2], yypvt[-0] ); } /*NOTREACHED*/ break; case 40: # line 138 "bc.y" {ln++;} /*NOTREACHED*/ break; case 42: # line 143 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "=" ); /*NOTREACHED*/ break; case 43: # line 145 "bc.y" bundle(3, yypvt[-2], yypvt[-0], ">" ); /*NOTREACHED*/ break; case 44: # line 147 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "<" ); /*NOTREACHED*/ break; case 45: # line 149 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "!=" ); /*NOTREACHED*/ break; case 46: # line 151 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "!>" ); /*NOTREACHED*/ break; case 47: # line 153 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "!<" ); /*NOTREACHED*/ break; case 48: # line 155 "bc.y" bundle(2, yypvt[-0], " 0!=" ); /*NOTREACHED*/ break; case 49: # line 159 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "+" ); /*NOTREACHED*/ break; case 50: # line 161 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "-" ); /*NOTREACHED*/ break; case 51: # line 163 "bc.y" bundle(3, " 0", yypvt[-0], "-" ); /*NOTREACHED*/ break; case 52: # line 165 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "*" ); /*NOTREACHED*/ break; case 53: # line 167 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "/" ); /*NOTREACHED*/ break; case 54: # line 169 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "%%" ); /*NOTREACHED*/ break; case 55: # line 171 "bc.y" bundle(3, yypvt[-2], yypvt[-0], "^" ); /*NOTREACHED*/ break; case 56: # line 173 "bc.y" { bundle(3,yypvt[-1], ";", geta(yypvt[-3])); } /*NOTREACHED*/ break; case 57: # line 175 "bc.y" bundle(4, "l", yypvt[-1], "d1+s", yypvt[-1] ); /*NOTREACHED*/ break; case 58: # line 177 "bc.y" bundle(4, "l", yypvt[-0], "1+ds", yypvt[-0] ); /*NOTREACHED*/ break; case 59: # line 179 "bc.y" bundle(4, "l", yypvt[-0], "1-ds", yypvt[-0] ); /*NOTREACHED*/ break; case 60: # line 181 "bc.y" bundle(4, "l", yypvt[-1], "d1-s", yypvt[-1] ); /*NOTREACHED*/ break; case 61: # line 183 "bc.y" bundle(7,yypvt[-2],";",geta(yypvt[-4]),"d1+",yypvt[-2],":",geta(yypvt[-4])); /*NOTREACHED*/ break; case 62: # line 185 "bc.y" bundle(7,yypvt[-1],";",geta(yypvt[-3]),"1+d",yypvt[-1],":",geta(yypvt[-3])); /*NOTREACHED*/ break; case 63: # line 187 "bc.y" bundle(7,yypvt[-2],";",geta(yypvt[-4]),"d1-",yypvt[-2],":",geta(yypvt[-4])); /*NOTREACHED*/ break; case 64: # line 189 "bc.y" bundle(7,yypvt[-1],";",geta(yypvt[-3]),"1-d",yypvt[-1],":",geta(yypvt[-3])); /*NOTREACHED*/ break; case 65: # line 191 "bc.y" bundle(1,"Kd1+k"); /*NOTREACHED*/ break; case 66: # line 193 "bc.y" bundle(1,"K1+dk"); /*NOTREACHED*/ break; case 67: # line 195 "bc.y" bundle(1,"Kd1-k"); /*NOTREACHED*/ break; case 68: # line 197 "bc.y" bundle(1,"K1-dk"); /*NOTREACHED*/ break; case 69: # line 199 "bc.y" bundle(1,"Id1+i"); /*NOTREACHED*/ break; case 70: # line 201 "bc.y" bundle(1,"I1+di"); /*NOTREACHED*/ break; case 71: # line 203 "bc.y" bundle(1,"Id1-i"); /*NOTREACHED*/ break; case 72: # line 205 "bc.y" bundle(1,"I1-di"); /*NOTREACHED*/ break; case 73: # line 207 "bc.y" bundle(1,"Od1+o"); /*NOTREACHED*/ break; case 74: # line 209 "bc.y" bundle(1,"O1+do"); /*NOTREACHED*/ break; case 75: # line 211 "bc.y" bundle(1,"Od1-o"); /*NOTREACHED*/ break; case 76: # line 213 "bc.y" bundle(1,"O1-do"); /*NOTREACHED*/ break; case 77: # line 215 "bc.y" bundle(4, yypvt[-1], "l", getf(yypvt[-3]), "x" ); /*NOTREACHED*/ break; case 78: # line 217 "bc.y" bundle(3, "l", getf(yypvt[-2]), "x" ); /*NOTREACHED*/ break; case 79: # line 219 "bc.y" { bundle(2, " ", yypvt[-0] ); } /*NOTREACHED*/ break; case 80: # line 221 "bc.y" { bundle(2, " .", yypvt[-0] ); } /*NOTREACHED*/ break; case 81: # line 223 "bc.y" { bundle(4, " ", yypvt[-2], ".", yypvt[-0] ); } /*NOTREACHED*/ break; case 82: # line 225 "bc.y" { bundle(3, " ", yypvt[-1], "." ); } /*NOTREACHED*/ break; case 83: # line 227 "bc.y" { yyval = "l."; } /*NOTREACHED*/ break; case 84: # line 229 "bc.y" { bundle(2, "l", yypvt[-0] ); } /*NOTREACHED*/ break; case 85: # line 231 "bc.y" { bundle(3, yypvt[-0], "ds", yypvt[-2] ); } /*NOTREACHED*/ break; case 86: # line 233 "bc.y" { bundle(6, "l", yypvt[-2], yypvt[-0], yypvt[-1], "ds", yypvt[-2] ); } /*NOTREACHED*/ break; case 87: # line 235 "bc.y" { bundle(5,yypvt[-0],"d",yypvt[-3],":",geta(yypvt[-5])); } /*NOTREACHED*/ break; case 88: # line 237 "bc.y" { bundle(9,yypvt[-3],";",geta(yypvt[-5]),yypvt[-0],yypvt[-1],"d",yypvt[-3],":",geta(yypvt[-5])); } /*NOTREACHED*/ break; case 89: # line 239 "bc.y" bundle(2,yypvt[-1],"Z"); /*NOTREACHED*/ break; case 90: # line 241 "bc.y" bundle(2,yypvt[-1],"X"); /*NOTREACHED*/ break; case 91: # line 243 "bc.y" { yyval = yypvt[-1]; } /*NOTREACHED*/ break; case 92: # line 245 "bc.y" { bundle(1, "?" ); } /*NOTREACHED*/ break; case 93: # line 247 "bc.y" { bundle(2, yypvt[-1], "v" ); } /*NOTREACHED*/ break; case 94: # line 249 "bc.y" { bundle(2,"L",yypvt[-0]); } /*NOTREACHED*/ break; case 95: # line 251 "bc.y" bundle(2,yypvt[-0],"dk"); /*NOTREACHED*/ break; case 96: # line 253 "bc.y" bundle(4,"K",yypvt[-0],yypvt[-1],"dk"); /*NOTREACHED*/ break; case 97: # line 255 "bc.y" bundle(2,yypvt[-0],"di"); /*NOTREACHED*/ break; case 98: # line 257 "bc.y" bundle(4,"I",yypvt[-0],yypvt[-1],"di"); /*NOTREACHED*/ break; case 99: # line 259 "bc.y" bundle(2,yypvt[-0],"do"); /*NOTREACHED*/ break; case 100: # line 261 "bc.y" bundle(4,"O",yypvt[-0],yypvt[-1],"do"); /*NOTREACHED*/ break; case 101: # line 263 "bc.y" bundle(1,"K"); /*NOTREACHED*/ break; case 102: # line 265 "bc.y" bundle(1,"I"); /*NOTREACHED*/ break; case 103: # line 267 "bc.y" bundle(1,"O"); /*NOTREACHED*/ break; case 105: # line 272 "bc.y" bundle(2, yypvt[-2], yypvt[-0] ); /*NOTREACHED*/ break; case 107: # line 276 "bc.y" bundle(2,"l",geta(yypvt[-2])); /*NOTREACHED*/ break; case 108: # line 280 "bc.y" { *cp++ = '\0'; } /*NOTREACHED*/ break; case 109: # line 284 "bc.y" { yyval = cp; *cp++ = '_'; } /*NOTREACHED*/ break; case 110: # line 286 "bc.y" { yyval = cp; *cp++ = yypvt[-0]; } /*NOTREACHED*/ break; case 111: # line 288 "bc.y" { *cp++ = yypvt[-0]; } /*NOTREACHED*/ break; case 112: # line 292 "bc.y" { yyval = cp; *cp++ = crs++; *cp++ = '\0'; if(crs == '[')crs=+3; if(crs == 'a')crs='{'; if(crs >= 0241){yyerror("program too big"); getout(); } bstack[bindx++] = lev++; } /*NOTREACHED*/ break; case 113: # line 302 "bc.y" { yyval = getf(yypvt[-1]); pre = ""; post = ""; lev = 1; bstack[bindx=0] = 0; } /*NOTREACHED*/ break; case 115: # line 312 "bc.y" { pp( yypvt[-0] ); } /*NOTREACHED*/ break; case 116: # line 314 "bc.y" { pp( yypvt[-0] ); } /*NOTREACHED*/ break; case 117: # line 318 "bc.y" { tp(yypvt[-0]); } /*NOTREACHED*/ break; case 118: # line 320 "bc.y" { tp(yypvt[-0]); } /*NOTREACHED*/ break; case 120: # line 324 "bc.y" { yyval = geta(yypvt[-2]); } /*NOTREACHED*/ break; } goto yystack; /* reset registers in driver code */ }