#ifndef lint static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #endif #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 #define YYPATCH 20130304 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) #define yyerrok (yyerrflag = 0) #define YYRECOVERING() (yyerrflag != 0) #define YYPREFIX "yy" #define YYPURE 0 #line 2 "bc.y" int *getout(); #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; #line 38 "y.tab.c" #ifndef YYSTYPE typedef int YYSTYPE; #endif /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ # ifdef YYPARSE_PARAM_TYPE # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) # else # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) # endif #else # define YYPARSE_DECL() yyparse(void) #endif /* Parameters sent to lex. */ #ifdef YYLEX_PARAM # define YYLEX_DECL() yylex(void *YYLEX_PARAM) # define YYLEX yylex(YYLEX_PARAM) #else # define YYLEX_DECL() yylex(void) # define YYLEX yylex() #endif /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL #define YYERROR_DECL() yyerror(const char *s) #endif #ifndef YYERROR_CALL #define YYERROR_CALL(msg) yyerror(msg) #endif extern int YYPARSE_DECL(); #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 #define YYERRCODE 256 static const short yylhs[] = { -1, 0, 0, 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 13, 11, 6, 6, 2, 2, 12, 12, 12, 12, 12, 12, 12, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 14, 14, 16, 16, 15, 17, 17, 17, 10, 3, 4, 4, 4, 7, 7, 18, 18, }; static const short yylen[] = { 2, 0, 3, 8, 1, 4, 1, 0, 1, 3, 6, 3, 6, 1, 4, 3, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 7, 7, 8, 4, 1, 1, 1, 1, 1, 1, 4, 0, 1, 3, 1, 1, 3, 3, 3, 3, 3, 3, 1, 3, 3, 2, 3, 3, 3, 3, 4, 2, 2, 2, 2, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 3, 1, 2, 3, 2, 1, 1, 3, 3, 6, 6, 4, 4, 3, 1, 4, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 2, 0, 3, 0, 1, 3, 1, 3, 1, 3, }; static const short yydefred[] = { 1, 0, 25, 0, 0, 110, 0, 0, 112, 24, 112, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 8, 0, 0, 0, 92, 109, 0, 0, 0, 112, 0, 0, 0, 0, 0, 0, 0, 51, 0, 57, 60, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0, 37, 0, 0, 0, 70, 74, 66, 0, 72, 76, 68, 0, 0, 0, 69, 71, 0, 0, 73, 75, 0, 0, 65, 67, 0, 0, 80, 38, 0, 0, 0, 41, 40, 2, 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 78, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 113, 0, 0, 0, 0, 0, 0, 0, 23, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 93, 89, 0, 0, 36, 0, 0, 14, 90, 39, 0, 120, 0, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 63, 0, 107, 105, 0, 0, 62, 64, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 26, 27, 0, 117, 3, 37, 0, 5, 28, 118, }; static const short yydgoto[] = { 1, 80, 135, 28, 88, 196, 81, 217, 29, 101, 53, 119, 148, 30, 114, 31, 115, 32, 89, }; static const short yysindex[] = { 0, 594, 0, 860, 669, 0, -23, -17, 0, 0, 0, 5, 56, 59, 7, 0, -236, 956, 970, 936, -93, 0, 750, 860, -233, 0, 0, -3, -207, 953, 0, -217, -179, 771, 976, 1003, 942, -177, 0, 860, 0, 0, 0, 0, 0, 0, 0, 0, 860, 498, 860, 860, 860, 0, 42, 860, 27, 0, 0, 0, 39, 0, 0, 0, 798, 71, 860, 0, 0, 860, 860, 0, 0, 860, 860, 0, 0, 860, 860, 0, 0, -6, 987, 78, 0, 0, 0, 72, 66, 0, 860, 860, 860, 860, 860, 860, 860, -93, 0, 860, 860, 860, 860, 860, 860, 860, 860, 860, 0, 953, -27, 914, 0, 953, 162, 0, 953, 1097, 1134, 138, 860, 1068, 860, 860, 0, 1314, 0, 953, 953, 953, 953, 953, 1381, 953, 0, 750, 0, 860, 89, 87, -207, -18, -18, 124, 124, 124, 124, 1001, 160, 0, 953, 1398, 953, 953, 953, 953, 953, 953, 953, 1009, 832, 0, 893, 0, 0, 860, 187, 0, 1419, 1436, 0, 0, 0, 953, 0, -3, 0, 860, 860, 860, 860, 860, 860, 860, 1023, 860, 0, 0, 860, 0, 0, 188, 750, 0, 0, 0, 708, 953, 953, 953, 953, 953, 953, 1443, 860, 860, 953, 953, 750, 0, -207, -5, 750, 953, 953, 0, 0, 167, 0, 0, 0, -207, 0, 0, 0, }; static const short yyrindex[] = { 0, 18, 0, 0, 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 804, 1035, 1288, -1, 0, 1, 0, 0, 0, 0, 0, 168, 3, 0, 28, -10, 54, 90, 99, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1344, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 442, 0, 195, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 95, 98, 115, 145, 0, 146, 0, 1, 0, 0, 0, 0, 0, 245, 482, 369, 405, 431, 460, -20, 0, 0, 331, 0, 518, 524, 530, 553, 560, 617, 642, 1374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 44, 53, 121, 126, 127, 148, 0, 0, 0, 184, 228, 1, 0, 0, 0, 1, 652, 677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static const short yygindex[] = { 0, 73, -15, 0, 0, 0, 34, 0, 1272, 646, -4, -103, -117, 0, 0, -19, 79, 0, 41, }; #define YYTABLESIZE 1537 static const short yytable[] = { 108, 79, 26, 166, 85, 85, 54, 85, 16, 83, 94, 7, 86, 6, 9, 92, 90, 51, 91, 94, 93, 48, 65, 52, 92, 83, 96, 108, 7, 93, 11, 108, 108, 108, 108, 108, 83, 108, 79, 48, 83, 83, 83, 83, 83, 55, 83, 64, 191, 108, 108, 87, 108, 84, 84, 119, 84, 16, 83, 83, 7, 83, 6, 9, 84, 79, 159, 95, 97, 79, 79, 79, 79, 79, 27, 79, 95, 7, 149, 11, 98, 108, 120, 108, 108, 42, 119, 79, 79, 119, 79, 84, 83, 83, 45, 84, 84, 84, 84, 84, 102, 84, 19, 42, 119, 20, 216, 139, 21, 103, 140, 126, 45, 84, 84, 108, 84, 223, 122, 134, 219, 79, 79, 16, 83, 22, 7, 102, 6, 9, 123, 102, 102, 102, 102, 102, 103, 102, 101, 137, 103, 103, 103, 103, 103, 11, 103, 84, 84, 102, 102, 19, 102, 79, 20, 17, 18, 21, 103, 103, 195, 103, 47, 138, 58, 101, 5, 46, 43, 101, 101, 101, 101, 101, 22, 101, 29, 85, 165, 84, 47, 176, 174, 102, 102, 46, 43, 101, 101, 44, 101, 58, 103, 103, 10, 58, 58, 58, 58, 58, 59, 58, 222, 161, 17, 18, 162, 44, 172, 114, 175, 221, 114, 58, 58, 102, 58, 19, 95, 183, 20, 101, 101, 21, 103, 29, 84, 59, 192, 208, 211, 59, 59, 59, 59, 59, 106, 59, 12, 106, 22, 190, 0, 10, 0, 84, 0, 58, 58, 59, 59, 218, 59, 101, 108, 49, 0, 108, 108, 108, 0, 0, 224, 83, 0, 209, 83, 83, 83, 0, 17, 18, 84, 0, 0, 108, 0, 84, 84, 58, 84, 215, 84, 59, 59, 220, 49, 12, 49, 49, 49, 29, 79, 82, 84, 79, 79, 79, 0, 0, 0, 0, 0, 0, 49, 49, 0, 49, 0, 10, 0, 0, 0, 0, 56, 59, 0, 60, 84, 0, 82, 84, 84, 84, 82, 82, 82, 82, 82, 84, 82, 57, 58, 59, 61, 62, 63, 0, 49, 0, 0, 85, 82, 82, 0, 82, 0, 0, 0, 0, 0, 56, 0, 12, 102, 0, 0, 102, 102, 102, 84, 0, 0, 103, 0, 0, 103, 103, 103, 0, 49, 0, 85, 0, 0, 85, 82, 82, 56, 52, 0, 0, 56, 56, 56, 56, 56, 0, 56, 0, 85, 85, 101, 85, 0, 101, 101, 101, 0, 0, 56, 56, 0, 56, 0, 0, 52, 0, 82, 0, 52, 52, 52, 52, 52, 53, 52, 0, 58, 0, 0, 58, 58, 58, 85, 0, 0, 0, 52, 52, 0, 52, 0, 0, 56, 56, 0, 0, 0, 0, 0, 54, 53, 0, 0, 0, 53, 53, 53, 53, 53, 0, 53, 0, 59, 0, 85, 59, 59, 59, 0, 0, 52, 0, 53, 53, 56, 53, 54, 0, 55, 0, 54, 54, 54, 54, 54, 0, 54, 84, 0, 0, 0, 84, 84, 84, 84, 84, 0, 84, 54, 54, 50, 54, 52, 0, 0, 55, 53, 0, 0, 55, 55, 55, 55, 55, 0, 55, 0, 49, 0, 0, 49, 49, 49, 0, 0, 0, 0, 55, 55, 0, 55, 50, 54, 50, 50, 50, 86, 0, 53, 0, 0, 0, 97, 0, 84, 0, 23, 112, 98, 50, 50, 3, 50, 0, 0, 82, 0, 0, 82, 82, 82, 55, 0, 0, 54, 0, 0, 86, 0, 25, 86, 99, 0, 97, 0, 0, 97, 0, 100, 98, 0, 0, 98, 50, 0, 86, 86, 0, 86, 0, 0, 97, 97, 55, 97, 0, 0, 98, 98, 0, 98, 26, 99, 85, 0, 99, 85, 85, 85, 100, 0, 0, 100, 56, 0, 50, 56, 56, 56, 86, 99, 99, 0, 99, 0, 97, 0, 100, 100, 0, 100, 98, 37, 0, 0, 95, 0, 0, 0, 0, 0, 52, 23, 0, 52, 52, 52, 3, 0, 0, 0, 86, 0, 0, 99, 0, 0, 97, 50, 0, 96, 100, 0, 98, 0, 25, 95, 0, 0, 95, 87, 69, 73, 78, 0, 0, 0, 53, 0, 0, 53, 53, 53, 0, 95, 95, 99, 95, 103, 105, 107, 96, 0, 100, 96, 88, 0, 26, 0, 0, 0, 87, 0, 54, 87, 0, 54, 54, 54, 96, 96, 0, 96, 0, 0, 0, 0, 49, 95, 87, 87, 0, 87, 0, 0, 22, 88, 0, 24, 88, 0, 0, 55, 0, 0, 55, 55, 55, 39, 0, 0, 0, 0, 96, 88, 88, 0, 88, 0, 0, 95, 0, 0, 87, 50, 0, 23, 50, 50, 50, 0, 3, 0, 0, 111, 5, 6, 7, 48, 0, 0, 0, 0, 0, 0, 96, 12, 13, 88, 25, 0, 34, 35, 36, 0, 87, 0, 0, 0, 0, 86, 20, 0, 86, 86, 86, 97, 0, 23, 97, 97, 97, 98, 3, 0, 98, 98, 98, 0, 0, 88, 26, 0, 188, 0, 0, 0, 0, 0, 49, 0, 25, 102, 0, 0, 99, 0, 0, 99, 99, 99, 0, 100, 0, 0, 100, 100, 100, 205, 22, 99, 0, 24, 0, 0, 0, 23, 124, 0, 102, 0, 3, 0, 26, 102, 102, 0, 102, 2, 102, 4, 5, 6, 7, 8, 9, 0, 10, 11, 25, 100, 102, 12, 13, 14, 15, 16, 17, 18, 19, 23, 22, 0, 0, 24, 3, 0, 20, 21, 95, 0, 0, 95, 95, 95, 0, 0, 0, 0, 0, 0, 26, 0, 25, 0, 0, 102, 0, 23, 0, 0, 0, 0, 3, 96, 0, 0, 96, 96, 96, 0, 0, 0, 0, 87, 0, 0, 87, 87, 87, 0, 25, 37, 189, 0, 26, 0, 102, 0, 0, 0, 23, 0, 0, 0, 0, 3, 40, 41, 88, 0, 0, 88, 88, 88, 42, 43, 44, 45, 46, 47, 0, 49, 26, 25, 0, 37, 0, 0, 0, 0, 0, 2, 0, 4, 5, 6, 7, 8, 9, 0, 10, 11, 99, 77, 0, 12, 13, 14, 15, 77, 17, 18, 19, 37, 0, 26, 0, 94, 0, 210, 20, 21, 92, 90, 74, 91, 0, 93, 0, 0, 106, 0, 160, 2, 0, 4, 5, 6, 7, 8, 9, 0, 10, 11, 66, 0, 37, 12, 13, 14, 15, 94, 17, 18, 19, 136, 92, 90, 70, 91, 0, 93, 20, 21, 102, 94, 0, 0, 40, 41, 92, 90, 103, 91, 95, 93, 42, 43, 44, 45, 46, 47, 0, 33, 5, 6, 7, 0, 181, 0, 182, 104, 0, 0, 0, 12, 13, 185, 0, 103, 34, 35, 36, 0, 103, 103, 0, 103, 95, 103, 20, 204, 0, 0, 0, 0, 0, 33, 5, 6, 7, 103, 95, 0, 0, 0, 0, 0, 0, 12, 13, 0, 94, 0, 34, 35, 36, 92, 90, 0, 91, 0, 93, 0, 20, 33, 5, 6, 7, 0, 0, 0, 0, 0, 167, 0, 103, 12, 13, 0, 0, 94, 34, 35, 36, 163, 92, 90, 0, 91, 0, 93, 20, 0, 0, 0, 0, 0, 111, 5, 6, 7, 0, 0, 0, 0, 0, 103, 0, 95, 12, 13, 0, 0, 0, 34, 35, 36, 94, 0, 0, 0, 164, 92, 90, 20, 91, 0, 93, 0, 0, 40, 41, 0, 0, 0, 0, 0, 95, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, 0, 0, 0, 75, 76, 42, 43, 44, 45, 46, 47, 42, 43, 44, 45, 46, 47, 67, 68, 95, 0, 0, 0, 0, 0, 42, 43, 44, 45, 46, 47, 71, 72, 0, 0, 0, 0, 67, 68, 42, 43, 44, 45, 46, 47, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, 177, 0, 0, 178, 179, 180, 0, 0, 71, 72, 38, 0, 0, 0, 186, 187, 42, 43, 44, 45, 46, 47, 42, 43, 44, 45, 46, 47, 186, 187, 82, 0, 0, 101, 0, 0, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, 110, 113, 116, 117, 118, 101, 0, 121, 0, 0, 101, 101, 0, 101, 0, 101, 125, 0, 127, 0, 0, 128, 129, 0, 0, 130, 131, 101, 0, 132, 133, 94, 0, 0, 94, 170, 92, 90, 0, 91, 0, 93, 141, 142, 143, 144, 145, 146, 147, 0, 0, 150, 151, 152, 153, 154, 155, 156, 157, 158, 0, 94, 101, 0, 56, 0, 94, 94, 0, 94, 0, 94, 147, 0, 168, 169, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 95, 173, 0, 56, 0, 101, 0, 0, 56, 56, 94, 56, 0, 56, 171, 92, 90, 0, 91, 0, 93, 0, 0, 0, 151, 56, 113, 94, 0, 147, 94, 0, 92, 90, 0, 91, 0, 93, 0, 0, 0, 197, 198, 199, 200, 201, 202, 203, 94, 206, 0, 0, 207, 92, 90, 0, 91, 0, 93, 0, 56, 94, 0, 0, 0, 94, 0, 95, 213, 214, 92, 90, 94, 91, 0, 93, 212, 92, 90, 0, 91, 0, 93, 184, 95, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 193, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, 95, 0, 0, 0, 0, 0, 0, 95, }; static const short yycheck[] = { 10, 20, 95, 120, 10, 10, 10, 10, 10, 10, 37, 10, 27, 10, 10, 42, 43, 40, 45, 37, 47, 41, 258, 40, 42, 258, 30, 37, 10, 47, 10, 41, 42, 43, 44, 45, 37, 47, 10, 59, 41, 42, 43, 44, 45, 40, 47, 40, 165, 59, 60, 258, 62, 59, 59, 10, 59, 59, 59, 60, 59, 62, 59, 59, 10, 37, 93, 94, 285, 41, 42, 43, 44, 45, 1, 47, 94, 59, 97, 59, 259, 258, 40, 93, 94, 41, 41, 59, 60, 44, 62, 37, 93, 94, 41, 41, 42, 43, 44, 45, 10, 47, 10, 59, 59, 10, 209, 41, 10, 10, 44, 40, 59, 59, 60, 125, 62, 220, 91, 125, 125, 93, 94, 125, 125, 10, 125, 37, 125, 125, 91, 41, 42, 43, 44, 45, 37, 47, 10, 61, 41, 42, 43, 44, 45, 125, 47, 93, 94, 59, 60, 59, 62, 125, 59, 10, 10, 59, 59, 60, 175, 62, 41, 91, 10, 37, 259, 41, 41, 41, 42, 43, 44, 45, 59, 47, 10, 10, 40, 125, 59, 140, 93, 93, 94, 59, 59, 59, 60, 41, 62, 37, 93, 94, 10, 41, 42, 43, 44, 45, 10, 47, 217, 41, 59, 59, 44, 59, 135, 41, 123, 44, 44, 59, 60, 125, 62, 125, 94, 59, 125, 93, 94, 125, 125, 59, 59, 37, 41, 41, 196, 41, 42, 43, 44, 45, 41, 47, 10, 44, 125, 162, -1, 59, -1, 10, -1, 93, 94, 59, 60, 210, 62, 125, 264, 10, -1, 267, 268, 269, -1, -1, 221, 264, -1, 192, 267, 268, 269, -1, 125, 125, 37, -1, -1, 285, -1, 42, 43, 125, 45, 208, 47, 93, 94, 212, 41, 59, 43, 44, 45, 125, 264, 10, 59, 267, 268, 269, -1, -1, -1, -1, -1, -1, 59, 60, -1, 62, -1, 125, -1, -1, -1, -1, 258, 125, -1, 258, 264, -1, 37, 267, 268, 269, 41, 42, 43, 44, 45, 94, 47, 275, 276, 277, 275, 276, 277, -1, 93, -1, -1, 10, 59, 60, -1, 62, -1, -1, -1, -1, -1, 10, -1, 125, 264, -1, -1, 267, 268, 269, 125, -1, -1, 264, -1, -1, 267, 268, 269, -1, 125, -1, 41, -1, -1, 44, 93, 94, 37, 10, -1, -1, 41, 42, 43, 44, 45, -1, 47, -1, 59, 60, 264, 62, -1, 267, 268, 269, -1, -1, 59, 60, -1, 62, -1, -1, 37, -1, 125, -1, 41, 42, 43, 44, 45, 10, 47, -1, 264, -1, -1, 267, 268, 269, 93, -1, -1, -1, 59, 60, -1, 62, -1, -1, 93, 94, -1, -1, -1, -1, -1, 10, 37, -1, -1, -1, 41, 42, 43, 44, 45, -1, 47, -1, 264, -1, 125, 267, 268, 269, -1, -1, 93, -1, 59, 60, 125, 62, 37, -1, 10, -1, 41, 42, 43, 44, 45, -1, 47, 37, -1, -1, -1, 41, 42, 43, 44, 45, -1, 47, 59, 60, 10, 62, 125, -1, -1, 37, 93, -1, -1, 41, 42, 43, 44, 45, -1, 47, -1, 264, -1, -1, 267, 268, 269, -1, -1, -1, -1, 59, 60, -1, 62, 41, 93, 43, 44, 45, 10, -1, 125, -1, -1, -1, 10, -1, 94, -1, 40, 41, 10, 59, 60, 45, 62, -1, -1, 264, -1, -1, 267, 268, 269, 93, -1, -1, 125, -1, -1, 41, -1, 63, 44, 10, -1, 41, -1, -1, 44, -1, 10, 41, -1, -1, 44, 93, -1, 59, 60, -1, 62, -1, -1, 59, 60, 125, 62, -1, -1, 59, 60, -1, 62, 95, 41, 264, -1, 44, 267, 268, 269, 41, -1, -1, 44, 264, -1, 125, 267, 268, 269, 93, 59, 60, -1, 62, -1, 93, -1, 59, 60, -1, 62, 93, 126, -1, -1, 10, -1, -1, -1, -1, -1, 264, 40, -1, 267, 268, 269, 45, -1, -1, -1, 125, -1, -1, 93, -1, -1, 125, 4, -1, 10, 93, -1, 125, -1, 63, 41, -1, -1, 44, 10, 17, 18, 19, -1, -1, -1, 264, -1, -1, 267, 268, 269, -1, 59, 60, 125, 62, 34, 35, 36, 41, -1, 125, 44, 10, -1, 95, -1, -1, -1, 41, -1, 264, 44, -1, 267, 268, 269, 59, 60, -1, 62, -1, -1, -1, -1, 40, 93, 59, 60, -1, 62, -1, -1, 123, 41, -1, 126, 44, -1, -1, 264, -1, -1, 267, 268, 269, 61, -1, -1, -1, -1, 93, 59, 60, -1, 62, -1, -1, 125, -1, -1, 93, 264, -1, 40, 267, 268, 269, -1, 45, -1, -1, 258, 259, 260, 261, 91, -1, -1, -1, -1, -1, -1, 125, 270, 271, 93, 63, -1, 275, 276, 277, -1, 125, -1, -1, -1, -1, 264, 285, -1, 267, 268, 269, 264, -1, 40, 267, 268, 269, 264, 45, -1, 267, 268, 269, -1, -1, 125, 95, -1, 159, -1, -1, -1, -1, -1, 40, -1, 63, 10, -1, -1, 264, -1, -1, 267, 268, 269, -1, 264, -1, -1, 267, 268, 269, 184, 123, 61, -1, 126, -1, -1, -1, 40, 41, -1, 37, -1, 45, -1, 95, 42, 43, -1, 45, 256, 47, 258, 259, 260, 261, 262, 263, -1, 265, 266, 63, 91, 59, 270, 271, 272, 273, 274, 275, 276, 277, 40, 123, -1, -1, 126, 45, -1, 285, 286, 264, -1, -1, 267, 268, 269, -1, -1, -1, -1, -1, -1, 95, -1, 63, -1, -1, 94, -1, 40, -1, -1, -1, -1, 45, 264, -1, -1, 267, 268, 269, -1, -1, -1, -1, 264, -1, -1, 267, 268, 269, -1, 63, 126, 93, -1, 95, -1, 125, -1, -1, -1, 40, -1, -1, -1, -1, 45, 270, 271, 264, -1, -1, 267, 268, 269, 278, 279, 280, 281, 282, 283, -1, 40, 95, 63, -1, 126, -1, -1, -1, -1, -1, 256, -1, 258, 259, 260, 261, 262, 263, -1, 265, 266, 61, 40, -1, 270, 271, 272, 273, 40, 275, 276, 277, 126, -1, 95, -1, 37, -1, 284, 285, 286, 42, 43, 61, 45, -1, 47, -1, -1, 61, -1, 91, 256, -1, 258, 259, 260, 261, 262, 263, -1, 265, 266, 61, -1, 126, 270, 271, 272, 273, 37, 275, 276, 277, 41, 42, 43, 61, 45, -1, 47, 285, 286, 61, 37, -1, -1, 270, 271, 42, 43, 10, 45, 94, 47, 278, 279, 280, 281, 282, 283, -1, 258, 259, 260, 261, -1, 60, -1, 62, 61, -1, -1, -1, 270, 271, 61, -1, 37, 275, 276, 277, -1, 42, 43, -1, 45, 94, 47, 285, 61, -1, -1, -1, -1, -1, 258, 259, 260, 261, 59, 94, -1, -1, -1, -1, -1, -1, 270, 271, -1, 37, -1, 275, 276, 277, 42, 43, -1, 45, -1, 47, -1, 285, 258, 259, 260, 261, -1, -1, -1, -1, -1, 59, -1, 94, 270, 271, -1, -1, 37, 275, 276, 277, 41, 42, 43, -1, 45, -1, 47, 285, -1, -1, -1, -1, -1, 258, 259, 260, 261, -1, -1, -1, -1, -1, 125, -1, 94, 270, 271, -1, -1, -1, 275, 276, 277, 37, -1, -1, -1, 41, 42, 43, 285, 45, -1, 47, -1, -1, 270, 271, -1, -1, -1, -1, -1, 94, 278, 279, 280, 281, 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, 270, 271, -1, -1, -1, -1, 270, 271, 278, 279, 280, 281, 282, 283, 278, 279, 280, 281, 282, 283, 270, 271, 94, -1, -1, -1, -1, -1, 278, 279, 280, 281, 282, 283, 270, 271, -1, -1, -1, -1, 270, 271, 278, 279, 280, 281, 282, 283, 278, 279, 280, 281, 282, 283, -1, -1, -1, -1, -1, 264, -1, -1, 267, 268, 269, -1, -1, 270, 271, 3, -1, -1, -1, 270, 271, 278, 279, 280, 281, 282, 283, 278, 279, 280, 281, 282, 283, 270, 271, 23, -1, -1, 10, -1, -1, 278, 279, 280, 281, 282, 283, -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, -1, -1, -1, 48, 49, 50, 51, 52, 37, -1, 55, -1, -1, 42, 43, -1, 45, -1, 47, 64, -1, 66, -1, -1, 69, 70, -1, -1, 73, 74, 59, -1, 77, 78, 37, -1, -1, 10, 41, 42, 43, -1, 45, -1, 47, 90, 91, 92, 93, 94, 95, 96, -1, -1, 99, 100, 101, 102, 103, 104, 105, 106, 107, -1, 37, 94, -1, 10, -1, 42, 43, -1, 45, -1, 47, 120, -1, 122, 123, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, 94, 137, -1, 37, -1, 125, -1, -1, 42, 43, 37, 45, -1, 47, 41, 42, 43, -1, 45, -1, 47, -1, -1, -1, 160, 59, 162, 37, -1, 165, 94, -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, 177, 178, 179, 180, 181, 182, 183, 37, 185, -1, -1, 188, 42, 43, -1, 45, -1, 47, -1, 94, 125, -1, -1, -1, 37, -1, 94, 204, 205, 42, 43, 37, 45, -1, 47, 41, 42, 43, -1, 45, -1, 47, 93, 94, -1, -1, -1, -1, -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, 94, -1, -1, -1, -1, -1, -1, 94, }; #define YYFINAL 1 #ifndef YYDEBUG #define YYDEBUG 0 #endif #define YYMAXTOKEN 286 #if YYDEBUG static const char *yyname[] = { "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",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,"';'","'<'","'='","'>'","'?'",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,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, 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, 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, 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,"UMINUS","LETTER","DIGIT", "SQRT","LENGTH","_IF","FFF","EQ","_WHILE","_FOR","NE","LE","GE","INCR","DECR", "_RETURN","_BREAK","_DEFINE","BASE","OBASE","SCALE","EQPL","EQMI","EQMUL", "EQDIV","EQREM","EQEXP","_AUTO","DOT","QSTR", }; static const char *yyrule[] = { "$accept : start", "start :", "start : start stat tail", "start : start def dargs ')' '{' dlist slist '}'", "dlist : tail", "dlist : dlist _AUTO dlets tail", "stat : e", "stat :", "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 :", "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 :", "def : _DEFINE LETTER '('", "dargs :", "dargs : lora", "dargs : dargs ',' lora", "dlets : lora", "dlets : dlets ',' lora", "lora : LETTER", "lora : LETTER '[' ']'", }; #endif int yydebug; int yynerrs; int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH #define YYMAXDEPTH YYSTACKSIZE #else #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else #define YYSTACKSIZE 10000 #define YYMAXDEPTH 500 #endif #endif #define YYINITSTACKSIZE 500 typedef struct { unsigned stacksize; short *s_base; short *s_mark; short *s_last; YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; /* variables for the parser stack */ static YYSTACKDATA yystack; #line 328 "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(); } 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]; if (argc > 1 && *argv[1] == '-') { if((argv[1][1] == 'd')||(argv[1][1] == 'c')){ yyinit(--argc, ++argv); yyparse(); exit(); } if(argv[1][1] != 'l'){ printf("unrecognizable argument\n"); fflush(stdout); exit(); } 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(); } close(0); dup(p[0]); close(p[0]); close(p[1]); execl("/bin/dc", "dc", "-", 0); execl("/usr/bin/dc", "dc", "-", 0); } #line 980 "y.tab.c" #if YYDEBUG #include /* needed for printf */ #endif #include /* needed for malloc, etc */ #include /* needed for memset */ /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack(YYSTACKDATA *data) { int i; unsigned newsize; short *newss; YYSTYPE *newvs; if ((newsize = data->stacksize) == 0) newsize = YYINITSTACKSIZE; else if (newsize >= YYMAXDEPTH) return -1; else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); if (newvs == 0) return -1; data->l_base = newvs; data->l_mark = newvs + i; data->stacksize = newsize; data->s_last = data->s_base + newsize - 1; return 0; } #if YYPURE || defined(YY_NO_LEAKS) static void yyfreestack(YYSTACKDATA *data) { free(data->s_base); free(data->l_base); memset(data, 0, sizeof(*data)); } #else #define yyfreestack(data) /* nothing */ #endif #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab int YYPARSE_DECL() { int yym, yyn, yystate; #if YYDEBUG const char *yys; if ((yys = getenv("YYDEBUG")) != 0) { yyn = *yys; if (yyn >= '0' && yyn <= '9') yydebug = yyn - '0'; } #endif yynerrs = 0; yyerrflag = 0; yychar = YYEMPTY; yystate = 0; #if YYPURE memset(&yystack, 0, sizeof(yystack)); #endif if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; yystack.s_mark = yystack.s_base; yystack.l_mark = yystack.l_base; yystate = 0; *yystack.s_mark = 0; yyloop: if ((yyn = yydefred[yystate]) != 0) goto yyreduce; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif } if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, shifting to state %d\n", YYPREFIX, yystate, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; yychar = YYEMPTY; if (yyerrflag > 0) --yyerrflag; goto yyloop; } if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yychar) { yyn = yytable[yyn]; goto yyreduce; } if (yyerrflag) goto yyinrecovery; yyerror("syntax error"); goto yyerrlab; yyerrlab: ++yynerrs; yyinrecovery: if (yyerrflag < 3) { yyerrflag = 3; for (;;) { if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) { #if YYDEBUG if (yydebug) printf("%sdebug: state %d, error recovery shifting\ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } yystate = yytable[yyn]; *++yystack.s_mark = yytable[yyn]; *++yystack.l_mark = yylval; goto yyloop; } else { #if YYDEBUG if (yydebug) printf("%sdebug: error recovery discarding state %d\n", YYPREFIX, *yystack.s_mark); #endif if (yystack.s_mark <= yystack.s_base) goto yyabort; --yystack.s_mark; --yystack.l_mark; } } } else { if (yychar == 0) goto yyabort; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } #endif yychar = YYEMPTY; goto yyloop; } yyreduce: #if YYDEBUG if (yydebug) printf("%sdebug: state %d, reducing by rule %d (%s)\n", YYPREFIX, yystate, yyn, yyrule[yyn]); #endif yym = yylen[yyn]; if (yym) yyval = yystack.l_mark[1-yym]; else memset(&yyval, 0, sizeof yyval); switch (yyn) { case 2: #line 38 "bc.y" output( yystack.l_mark[-1] ); break; case 3: #line 40 "bc.y" { bundle( 6,pre, yystack.l_mark[-1], post ,"0",numb[lev],"Q"); conout( yyval, yystack.l_mark[-6] ); rcrs = crs; output( "" ); lev = bindx = 0; } break; case 6: #line 53 "bc.y" { bundle(2, yystack.l_mark[0], "ps." ); } break; case 7: #line 55 "bc.y" { bundle(1, "" ); } break; case 8: #line 57 "bc.y" { bundle(3,"[",yystack.l_mark[0],"]P");} break; case 9: #line 59 "bc.y" { bundle(3, yystack.l_mark[0], "s", yystack.l_mark[-2] ); } break; case 10: #line 61 "bc.y" { bundle(4, yystack.l_mark[0], yystack.l_mark[-3], ":", geta(yystack.l_mark[-5])); } break; case 11: #line 63 "bc.y" { bundle(6, "l", yystack.l_mark[-2], yystack.l_mark[0], yystack.l_mark[-1], "s", yystack.l_mark[-2] ); } break; case 12: #line 65 "bc.y" { bundle(8,yystack.l_mark[-3], ";", geta(yystack.l_mark[-5]), yystack.l_mark[0], yystack.l_mark[-1], yystack.l_mark[-3], ":", geta(yystack.l_mark[-5]));} break; case 13: #line 67 "bc.y" { bundle(2, numb[lev-bstack[bindx-1]], "Q" ); } break; case 14: #line 69 "bc.y" bundle(4, yystack.l_mark[-1], post, numb[lev], "Q" ); break; case 15: #line 71 "bc.y" bundle(4, "0", post, numb[lev], "Q" ); break; case 16: #line 73 "bc.y" bundle(4,"0",post,numb[lev],"Q"); break; case 17: #line 75 "bc.y" bundle(2, yystack.l_mark[0], "k"); break; case 18: #line 77 "bc.y" bundle(4,"K",yystack.l_mark[0],yystack.l_mark[-1],"k"); break; case 19: #line 79 "bc.y" bundle(2,yystack.l_mark[0], "i"); break; case 20: #line 81 "bc.y" bundle(4,"I",yystack.l_mark[0],yystack.l_mark[-1],"i"); break; case 21: #line 83 "bc.y" bundle(2,yystack.l_mark[0],"o"); break; case 22: #line 85 "bc.y" bundle(4,"O",yystack.l_mark[0],yystack.l_mark[-1],"o"); break; case 23: #line 87 "bc.y" { yyval = yystack.l_mark[-1]; } break; case 24: #line 89 "bc.y" { bundle(1,"fY"); } break; case 25: #line 91 "bc.y" { bundle(1,"c"); } break; case 26: #line 93 "bc.y" { conout( yystack.l_mark[0], yystack.l_mark[-5] ); bundle(3, yystack.l_mark[-2], yystack.l_mark[-5], " " ); } break; case 27: #line 97 "bc.y" { bundle(3, yystack.l_mark[-1], yystack.l_mark[-3], yystack.l_mark[-5] ); conout( yyval, yystack.l_mark[-5] ); bundle(3, yystack.l_mark[-3], yystack.l_mark[-5], " " ); } break; case 28: #line 102 "bc.y" { bundle(5, yystack.l_mark[-1], yystack.l_mark[-3], "s.", yystack.l_mark[-5], yystack.l_mark[-6] ); conout( yyval, yystack.l_mark[-6] ); bundle(5, yystack.l_mark[-7], "s.", yystack.l_mark[-5], yystack.l_mark[-6], " " ); } break; case 29: #line 107 "bc.y" { bundle(3,yystack.l_mark[0],"S",yystack.l_mark[-2]); } break; case 30: #line 111 "bc.y" { yyval = "+"; } break; case 31: #line 113 "bc.y" { yyval = "-"; } break; case 32: #line 115 "bc.y" { yyval = "*"; } break; case 33: #line 117 "bc.y" { yyval = "/"; } break; case 34: #line 119 "bc.y" { yyval = "%%"; } break; case 35: #line 121 "bc.y" { yyval = "^"; } break; case 36: #line 125 "bc.y" { yyval = yystack.l_mark[-1]; } break; case 37: #line 129 "bc.y" { --bindx; } break; case 39: #line 134 "bc.y" { bundle(2, yystack.l_mark[-2], yystack.l_mark[0] ); } break; case 40: #line 138 "bc.y" {ln++;} break; case 42: #line 143 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "=" ); break; case 43: #line 145 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], ">" ); break; case 44: #line 147 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "<" ); break; case 45: #line 149 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "!=" ); break; case 46: #line 151 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "!>" ); break; case 47: #line 153 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "!<" ); break; case 48: #line 155 "bc.y" bundle(2, yystack.l_mark[0], " 0!=" ); break; case 49: #line 159 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "+" ); break; case 50: #line 161 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "-" ); break; case 51: #line 163 "bc.y" bundle(3, " 0", yystack.l_mark[0], "-" ); break; case 52: #line 165 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "*" ); break; case 53: #line 167 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "/" ); break; case 54: #line 169 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "%%" ); break; case 55: #line 171 "bc.y" bundle(3, yystack.l_mark[-2], yystack.l_mark[0], "^" ); break; case 56: #line 173 "bc.y" { bundle(3,yystack.l_mark[-1], ";", geta(yystack.l_mark[-3])); } break; case 57: #line 175 "bc.y" bundle(4, "l", yystack.l_mark[-1], "d1+s", yystack.l_mark[-1] ); break; case 58: #line 177 "bc.y" bundle(4, "l", yystack.l_mark[0], "1+ds", yystack.l_mark[0] ); break; case 59: #line 179 "bc.y" bundle(4, "l", yystack.l_mark[0], "1-ds", yystack.l_mark[0] ); break; case 60: #line 181 "bc.y" bundle(4, "l", yystack.l_mark[-1], "d1-s", yystack.l_mark[-1] ); break; case 61: #line 183 "bc.y" bundle(7,yystack.l_mark[-2],";",geta(yystack.l_mark[-4]),"d1+",yystack.l_mark[-2],":",geta(yystack.l_mark[-4])); break; case 62: #line 185 "bc.y" bundle(7,yystack.l_mark[-1],";",geta(yystack.l_mark[-3]),"1+d",yystack.l_mark[-1],":",geta(yystack.l_mark[-3])); break; case 63: #line 187 "bc.y" bundle(7,yystack.l_mark[-2],";",geta(yystack.l_mark[-4]),"d1-",yystack.l_mark[-2],":",geta(yystack.l_mark[-4])); break; case 64: #line 189 "bc.y" bundle(7,yystack.l_mark[-1],";",geta(yystack.l_mark[-3]),"1-d",yystack.l_mark[-1],":",geta(yystack.l_mark[-3])); break; case 65: #line 191 "bc.y" bundle(1,"Kd1+k"); break; case 66: #line 193 "bc.y" bundle(1,"K1+dk"); break; case 67: #line 195 "bc.y" bundle(1,"Kd1-k"); break; case 68: #line 197 "bc.y" bundle(1,"K1-dk"); break; case 69: #line 199 "bc.y" bundle(1,"Id1+i"); break; case 70: #line 201 "bc.y" bundle(1,"I1+di"); break; case 71: #line 203 "bc.y" bundle(1,"Id1-i"); break; case 72: #line 205 "bc.y" bundle(1,"I1-di"); break; case 73: #line 207 "bc.y" bundle(1,"Od1+o"); break; case 74: #line 209 "bc.y" bundle(1,"O1+do"); break; case 75: #line 211 "bc.y" bundle(1,"Od1-o"); break; case 76: #line 213 "bc.y" bundle(1,"O1-do"); break; case 77: #line 215 "bc.y" bundle(4, yystack.l_mark[-1], "l", getf(yystack.l_mark[-3]), "x" ); break; case 78: #line 217 "bc.y" bundle(3, "l", getf(yystack.l_mark[-2]), "x" ); break; case 79: #line 219 "bc.y" { bundle(2, " ", yystack.l_mark[0] ); } break; case 80: #line 221 "bc.y" { bundle(2, " .", yystack.l_mark[0] ); } break; case 81: #line 223 "bc.y" { bundle(4, " ", yystack.l_mark[-2], ".", yystack.l_mark[0] ); } break; case 82: #line 225 "bc.y" { bundle(3, " ", yystack.l_mark[-1], "." ); } break; case 83: #line 227 "bc.y" { yyval = "l."; } break; case 84: #line 229 "bc.y" { bundle(2, "l", yystack.l_mark[0] ); } break; case 85: #line 231 "bc.y" { bundle(3, yystack.l_mark[0], "ds", yystack.l_mark[-2] ); } break; case 86: #line 233 "bc.y" { bundle(6, "l", yystack.l_mark[-2], yystack.l_mark[0], yystack.l_mark[-1], "ds", yystack.l_mark[-2] ); } break; case 87: #line 235 "bc.y" { bundle(5,yystack.l_mark[0],"d",yystack.l_mark[-3],":",geta(yystack.l_mark[-5])); } break; case 88: #line 237 "bc.y" { bundle(9,yystack.l_mark[-3],";",geta(yystack.l_mark[-5]),yystack.l_mark[0],yystack.l_mark[-1],"d",yystack.l_mark[-3],":",geta(yystack.l_mark[-5])); } break; case 89: #line 239 "bc.y" bundle(2,yystack.l_mark[-1],"Z"); break; case 90: #line 241 "bc.y" bundle(2,yystack.l_mark[-1],"X"); break; case 91: #line 243 "bc.y" { yyval = yystack.l_mark[-1]; } break; case 92: #line 245 "bc.y" { bundle(1, "?" ); } break; case 93: #line 247 "bc.y" { bundle(2, yystack.l_mark[-1], "v" ); } break; case 94: #line 249 "bc.y" { bundle(2,"L",yystack.l_mark[0]); } break; case 95: #line 251 "bc.y" bundle(2,yystack.l_mark[0],"dk"); break; case 96: #line 253 "bc.y" bundle(4,"K",yystack.l_mark[0],yystack.l_mark[-1],"dk"); break; case 97: #line 255 "bc.y" bundle(2,yystack.l_mark[0],"di"); break; case 98: #line 257 "bc.y" bundle(4,"I",yystack.l_mark[0],yystack.l_mark[-1],"di"); break; case 99: #line 259 "bc.y" bundle(2,yystack.l_mark[0],"do"); break; case 100: #line 261 "bc.y" bundle(4,"O",yystack.l_mark[0],yystack.l_mark[-1],"do"); break; case 101: #line 263 "bc.y" bundle(1,"K"); break; case 102: #line 265 "bc.y" bundle(1,"I"); break; case 103: #line 267 "bc.y" bundle(1,"O"); break; case 105: #line 272 "bc.y" bundle(2, yystack.l_mark[-2], yystack.l_mark[0] ); break; case 107: #line 276 "bc.y" bundle(2,"l",geta(yystack.l_mark[-2])); break; case 108: #line 280 "bc.y" { *cp++ = '\0'; } break; case 109: #line 284 "bc.y" { yyval = cp; *cp++ = '_'; } break; case 110: #line 286 "bc.y" { yyval = cp; *cp++ = yystack.l_mark[0]; } break; case 111: #line 288 "bc.y" { *cp++ = yystack.l_mark[0]; } 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++; } break; case 113: #line 302 "bc.y" { yyval = getf(yystack.l_mark[-1]); pre = ""; post = ""; lev = 1; bstack[bindx=0] = 0; } break; case 115: #line 312 "bc.y" { pp( yystack.l_mark[0] ); } break; case 116: #line 314 "bc.y" { pp( yystack.l_mark[0] ); } break; case 117: #line 318 "bc.y" { tp(yystack.l_mark[0]); } break; case 118: #line 320 "bc.y" { tp(yystack.l_mark[0]); } break; case 120: #line 324 "bc.y" { yyval = geta(yystack.l_mark[-2]); } break; #line 1654 "y.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; yystack.l_mark -= yym; yym = yylhs[yyn]; if (yystate == 0 && yym == 0) { #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state 0 to\ state %d\n", YYPREFIX, YYFINAL); #endif yystate = YYFINAL; *++yystack.s_mark = YYFINAL; *++yystack.l_mark = yyval; if (yychar < 0) { if ((yychar = YYLEX) < 0) yychar = 0; #if YYDEBUG if (yydebug) { yys = 0; if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } #endif } if (yychar == 0) goto yyaccept; goto yyloop; } if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && yyn <= YYTABLESIZE && yycheck[yyn] == yystate) yystate = yytable[yyn]; else yystate = yydgoto[yym]; #if YYDEBUG if (yydebug) printf("%sdebug: after reduction, shifting from state %d \ to state %d\n", YYPREFIX, *yystack.s_mark, yystate); #endif if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) { goto yyoverflow; } *++yystack.s_mark = (short) yystate; *++yystack.l_mark = yyval; goto yyloop; yyoverflow: yyerror("yacc stack overflow"); yyabort: yyfreestack(&yystack); return (1); yyaccept: yyfreestack(&yystack); return (0); }