extern char *malloc(), *realloc(); # line 2 "a2p.y" /* $RCSfile: a2p.y,v $$Revision: 4.0.1.2 $$Date: 92/06/08 16:13:03 $ * * Copyright (c) 1991, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. * * $Log: a2p.y,v $ * Revision 4.0.1.2 92/06/08 16:13:03 lwall * patch20: in a2p, getline should allow variable to be array element * * Revision 4.0.1.1 91/06/07 12:12:41 lwall * patch4: new copyright notice * * Revision 4.0 91/03/20 01:57:21 lwall * 4.0 baseline. * */ #include "INTERN.h" #include "a2p.h" int root; int begins = Nullop; int ends = Nullop; # define BEGIN 257 # define END 258 # define REGEX 259 # define SEMINEW 260 # define NEWLINE 261 # define COMMENT 262 # define FUN1 263 # define FUNN 264 # define GRGR 265 # define PRINT 266 # define PRINTF 267 # define SPRINTF 268 # define SPLIT 269 # define IF 270 # define ELSE 271 # define WHILE 272 # define FOR 273 # define IN 274 # define EXIT 275 # define NEXT 276 # define BREAK 277 # define CONTINUE 278 # define RET 279 # define GETLINE 280 # define DO 281 # define SUB 282 # define GSUB 283 # define MATCH 284 # define FUNCTION 285 # define USERFUN 286 # define DELETE 287 # define ASGNOP 288 # define OROR 289 # define ANDAND 290 # define NUMBER 291 # define VAR 292 # define SUBSTR 293 # define INDEX 294 # define MATCHOP 295 # define RELOP 296 # define OR 297 # define STRING 298 # define UMINUS 299 # define NOT 300 # define INCR 301 # define DECR 302 # define FIELD 303 # define VFIELD 304 #define yyclearin yychar = -1 #define yyerrok yyerrflag = 0 extern int yychar; extern int yyerrflag; #ifndef YYMAXDEPTH #define YYMAXDEPTH 150 #endif #ifndef YYSTYPE #define YYSTYPE int #endif YYSTYPE yylval, yyval; # define YYERRCODE 256 # line 402 "a2p.y" #include "a2py.c" int yyexca[] ={ -1, 1, 0, -1, -2, 0, }; # define YYNPROD 137 # define YYLAST 3142 int yyact[]={ 63, 44, 156, 32, 50, 31, 222, 73, 74, 75, 210, 53, 45, 46, 124, 49, 86, 307, 104, 158, 74, 75, 52, 54, 53, 302, 126, 271, 306, 265, 106, 107, 270, 245, 51, 157, 269, 21, 56, 92, 2, 131, 55, 20, 48, 72, 19, 90, 69, 132, 47, 196, 241, 102, 100, 272, 195, 193, 109, 110, 111, 112, 253, 76, 79, 252, 72, 139, 15, 77, 237, 68, 78, 311, 236, 160, 66, 64, 309, 65, 293, 67, 187, 174, 255, 139, 198, 184, 183, 130, 68, 80, 179, 129, 5, 66, 64, 71, 65, 128, 67, 68, 286, 214, 199, 212, 66, 211, 105, 103, 99, 67, 98, 97, 96, 95, 71, 108, 94, 89, 88, 152, 87, 4, 153, 10, 9, 200, 69, 14, 177, 178, 239, 140, 13, 3, 136, 137, 127, 1, 0, 0, 0, 185, 186, 0, 72, 69, 151, 0, 0, 154, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 204, 205, 72, 0, 106, 107, 0, 0, 0, 0, 0, 175, 176, 72, 213, 0, 215, 76, 0, 140, 0, 0, 0, 77, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 231, 232, 233, 234, 235, 0, 206, 207, 0, 0, 0, 0, 244, 0, 0, 0, 159, 106, 107, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 248, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 161, 36, 169, 44, 18, 247, 27, 44, 38, 40, 54, 53, 249, 28, 45, 46, 29, 30, 45, 46, 54, 53, 54, 53, 0, 282, 18, 18, 238, 284, 285, 242, 243, 289, 290, 54, 53, 240, 91, 54, 53, 0, 299, 300, 54, 53, 0, 304, 0, 0, 6, 7, 8, 18, 0, 0, 298, 0, 113, 114, 115, 116, 63, 70, 18, 32, 310, 31, 313, 312, 315, 314, 316, 0, 18, 0, 0, 303, 0, 247, 0, 158, 70, 201, 202, 203, 0, 133, 135, 91, 91, 308, 287, 247, 141, 143, 144, 145, 146, 147, 149, 91, 0, 0, 91, 0, 301, 0, 0, 0, 18, 18, 0, 0, 0, 63, 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 158, 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, 174, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 91, 63, 0, 208, 32, 209, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, 219, 220, 0, 221, 0, 223, 225, 226, 227, 228, 229, 0, 174, 0, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 18, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 32, 0, 31, 0, 0, 0, 0, 266, 0, 0, 0, 267, 268, 0, 0, 0, 158, 0, 174, 0, 217, 275, 0, 276, 0, 0, 0, 0, 0, 278, 0, 279, 0, 280, 0, 281, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, 34, 35, 18, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 0, 36, 169, 174, 0, 216, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 63, 0, 0, 32, 0, 31, 0, 0, 159, 0, 0, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 0, 36, 169, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 25, 0, 0, 32, 159, 31, 0, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 0, 36, 169, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 63, 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 158, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 0, 36, 169, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 63, 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, 174, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 32, 138, 31, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 162, 163, 37, 39, 59, 0, 58, 0, 0, 166, 165, 164, 167, 168, 33, 0, 42, 43, 41, 0, 36, 169, 174, 0, 155, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 106, 107, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 26, 29, 30, 45, 46, 0, 0, 0, 0, 159, 0, 0, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 63, 36, 169, 32, 0, 31, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 59, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, 34, 35, 0, 162, 163, 37, 39, 170, 0, 171, 173, 0, 166, 165, 164, 167, 168, 33, 172, 42, 43, 41, 0, 36, 169, 23, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 62, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 81, 82, 62, 62, 85, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 62, 27, 44, 38, 40, 60, 57, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 62, 62, 62, 62, 62, 62, 25, 62, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, 62, 63, 62, 0, 32, 0, 31, 0, 62, 0, 62, 62, 62, 62, 62, 0, 62, 0, 0, 0, 12, 0, 0, 0, 34, 35, 0, 0, 62, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 62, 36, 62, 0, 0, 0, 27, 44, 38, 40, 60, 57, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 0, 62, 0, 62, 62, 62, 62, 62, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 62, 62, 83, 84, 0, 0, 0, 0, 62, 62, 0, 62, 62, 62, 62, 0, 0, 101, 0, 0, 16, 17, 24, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 118, 119, 120, 121, 122, 123, 0, 125, 33, 0, 42, 43, 41, 11, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 61, 26, 29, 30, 45, 46, 0, 25, 0, 0, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 61, 61, 288, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 61, 0, 61, 33, 0, 42, 43, 41, 61, 36, 61, 61, 61, 61, 61, 25, 61, 0, 32, 0, 31, 28, 0, 0, 29, 30, 45, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 63, 263, 0, 32, 264, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 61, 0, 61, 0, 61, 61, 61, 61, 61, 0, 0, 63, 261, 0, 32, 262, 31, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 61, 61, 0, 0, 0, 0, 0, 0, 61, 61, 0, 61, 61, 61, 61, 63, 259, 0, 32, 260, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 257, 0, 32, 258, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 26, 29, 30, 45, 46, 0, 0, 0, 0, 24, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 251, 0, 32, 250, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 26, 29, 30, 45, 46, 34, 35, 0, 0, 0, 37, 39, 0, 0, 63, 0, 0, 32, 0, 31, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 142, 0, 0, 32, 33, 31, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 297, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 296, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 295, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 106, 107, 34, 35, 0, 0, 0, 37, 39, 63, 294, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 24, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 292, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 26, 29, 30, 45, 46, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 291, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 63, 37, 39, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 283, 63, 0, 0, 32, 0, 31, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 273, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 256, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 254, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 63, 0, 0, 32, 0, 31, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 277, 0, 0, 63, 34, 35, 32, 194, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 63, 34, 35, 32, 192, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 63, 34, 35, 32, 191, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 63, 34, 35, 32, 190, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 224, 0, 0, 63, 34, 35, 32, 189, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 63, 34, 35, 32, 188, 31, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 34, 35, 0, 0, 0, 37, 39, 63, 182, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 0, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 63, 0, 0, 32, 0, 31, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 63, 0, 0, 32, 138, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 34, 35, 0, 0, 0, 37, 39, 63, 134, 0, 32, 0, 31, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 0, 63, 37, 39, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 150, 0, 0, 0, 34, 35, 0, 0, 63, 37, 39, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 148, 0, 0, 0, 34, 35, 0, 0, 93, 37, 39, 32, 0, 31, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 117, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46, 0, 0, 0, 0, 34, 35, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 42, 43, 41, 0, 36, 0, 0, 0, 0, 27, 44, 38, 40, 0, 0, 0, 28, 0, 0, 29, 30, 45, 46 }; int yypact[]={ -1000, -1000, 35, 1016, -1000, -1000, -1000, -1000, -1000, -1000, -79, -271, -1000, -1000, -227, -22, -81, -85, 880, -1000, -1000, -1000, 53, -281, -1000, 1332, 1332, -1000, -1000, -291, -291, 2791, 2791, -44, 82, 80, 79, 2837, 78, 75, 74, 73, 72, 70, -37, -1000, 2791, 35, -1000, 69, -231, -1000, 1332, -1000, -1000, -1000, -1000, 2791, 2791, 2791, 2745, 53, -293, 1332, 2791, 2791, 2791, 2791, 2791, 2791, -278, 2791, -254, 1332, -1000, -1000, 58, 52, 48, 0, -1000, -1000, -1000, -46, -46, -11, 2791, 2697, 2837, 2837, -1000, 2654, 23, 1652, 2791, 2791, 2791, 2791, 2610, 2564, 2837, -67, -231, 2837, 697, -1000, -1000, -1000, -266, 586, 586, -231, -231, 1080, 1080, 1080, 1080, -1000, 64, 64, -46, -46, -46, -46, -1000, 34, -291, -266, -1000, -1000, -1000, -1000, 2791, 1080, -1000, 2518, 47, 46, -1000, -1000, 41, 742, 1652, 2467, 2424, 2378, 2334, 2288, 13, 2245, 12, -42, 635, 45, -1000, -1000, -1000, 68, -1000, -1000, -1000, 2791, 2837, 2837, -1000, -1000, 2791, -1000, 2791, -282, 67, 65, -1000, 63, -1000, -1000, -279, 432, 370, 2791, -1000, 1080, -1000, -1000, -1000, 1606, 1606, -1000, 2791, -286, 2791, 2202, 2791, 2791, 2791, 2791, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -231, -231, 8, 8, 2791, 2791, -39, 1332, 1332, -40, 532, -231, -1000, -1000, 53, 2791, 2791, 1562, 21, 2156, 43, 2112, 1512, 1466, 1416, 1374, -94, -231, -231, -231, -231, -231, 2791, -1000, -1000, -1000, 2791, 2791, -5, -9, -245, -4, 2066, -1000, 320, 35, 2791, -1000, 2023, -1000, -1000, -1000, -1000, -1000, 2791, -1000, 2791, -1000, 2791, -1000, 2791, -1000, 2791, 2791, 1969, -1000, -1000, 62, 1282, -1000, -1000, 1926, 1882, 39, 1836, 1792, 1742, 1696, -231, -1000, -40, -40, 1332, -34, 532, -40, -231, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 267, -243, -1000, -24, 532, 37, -1000, -1000, -1000, -1000, 32, -1000, -40, -1000, -40, -1000, -40, -1000, -1000 }; int yypgo[]={ 0, 139, 40, 135, 134, 4, 18, 129, 126, 125, 124, 47, 64, 245, 46, 43, 37, 1223, 985, 39, 123, 108, 104, 2, 35, 75, 33, 74 }; int yyr1[]={ 0, 1, 4, 7, 7, 3, 3, 8, 8, 8, 8, 8, 8, 10, 9, 9, 12, 12, 12, 12, 16, 16, 16, 16, 15, 15, 15, 15, 14, 14, 14, 14, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 11, 11, 11, 19, 19, 19, 2, 2, 20, 20, 20, 20, 5, 5, 21, 21, 22, 22, 22, 22, 6, 6, 23, 23, 23, 23, 26, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 27, 27, 27, 25, 25, 25, 25, 25, 25, 25, 25 }; int yyr2[]={ 0, 5, 13, 11, 5, 7, 1, 3, 11, 21, 9, 2, 2, 3, 3, 7, 2, 2, 2, 2, 7, 9, 9, 5, 7, 7, 7, 7, 7, 7, 3, 7, 3, 5, 7, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 11, 5, 5, 5, 5, 5, 5, 7, 3, 5, 7, 9, 7, 9, 3, 7, 9, 9, 9, 5, 17, 13, 17, 17, 13, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 3, 9, 3, 5, 2, 2, 1, 9, 9, 7, 5, 1, 3, 3, 3, 3, 5, 1, 3, 3, 5, 5, 5, 5, 5, 1, 7, 5, 5, 2, 2, 1, 2, 9, 5, 9, 5, 3, 3, 3, 5, 3, 3, 5, 11, 3, 3, 3, 13, 19, 13, 15, 21, 19, 13, 11 }; int yychk[]={ -1000, -1, -2, -3, -20, 59, 260, 261, 262, -8, -9, 285, 123, -4, -7, -12, 257, 258, -13, -14, -15, -16, -17, -18, 259, 40, 300, 291, 298, 301, 302, 45, 43, 280, 263, 264, 286, 268, 293, 269, 294, 284, 282, 283, 292, 303, 304, -2, 123, 286, -5, 261, 44, 290, 289, 123, 123, 296, 62, 60, 295, -17, -18, 40, 43, 45, 42, 47, 37, 94, 274, 63, 112, 288, 301, 302, -16, -15, -14, -12, -12, -18, -18, -17, -17, -18, 60, 40, 40, 40, -11, -13, -19, 40, 40, 40, 40, 40, 40, 40, 91, -17, -5, 40, -6, -21, 261, 262, -12, -5, -5, -5, -5, -13, -13, -13, -13, 259, -17, -17, -17, -17, -17, -17, 292, -17, 280, -12, 41, 41, 41, 41, 60, -13, 41, -13, -11, -11, 44, 44, -19, -13, 40, -13, -13, -13, -13, -13, 259, -13, 259, -11, -6, -10, -11, 125, -23, -24, 59, 260, -25, -13, 266, 267, 277, 276, 275, 278, 279, 287, 270, 272, 281, 273, 123, -12, -12, -6, -6, 58, -18, -13, 41, 41, 41, -5, -5, 41, 44, 44, 44, 44, 44, 44, 44, 44, 93, 125, 41, -22, 59, 260, 261, 262, -5, -5, -11, -11, -13, -13, 292, 40, 40, -5, 40, -5, 125, 125, -17, -13, -13, -13, 292, -13, 259, -13, -13, -13, -13, -13, -5, -5, -5, -5, -5, -5, -27, 62, 265, 124, -27, 91, -12, -12, -23, -26, -13, -24, -6, -2, 44, 41, 44, 41, 41, 41, 41, 41, 44, 41, 44, 41, 44, 41, 44, 123, -13, -13, -13, 41, 41, 272, 59, 41, 125, -13, -13, 259, -13, -13, -13, -13, -5, 93, -5, -5, 40, -12, 59, -5, -5, 41, 41, 41, 41, 41, 41, 41, -6, -23, -23, -12, 59, -26, -23, 125, 271, 41, -26, 41, -5, 41, -5, -23, -5, -23, -23 }; int yydef[]={ 92, -2, 6, 1, 91, 93, 94, 95, 96, 92, 7, 0, 98, 11, 12, 14, 0, 0, 16, 17, 18, 19, 32, 35, 30, 0, 0, 36, 37, 0, 0, 0, 0, 53, 59, 0, 0, 87, 0, 0, 0, 0, 0, 0, 81, 83, 0, 5, 98, 0, 106, 4, 0, 98, 98, 98, 98, 0, 0, 0, 0, 33, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 47, 19, 18, 17, 0, 23, 48, 49, 50, 51, 54, 0, 0, 87, 87, 64, 85, 86, 0, 0, 0, 0, 0, 0, 0, 87, 84, 106, 87, 0, 97, 99, 100, 15, 0, 0, 106, 106, 24, 25, 26, 28, 29, 38, 39, 40, 41, 42, 43, 44, 0, 57, 34, 20, 27, 31, 52, 0, 55, 60, 0, 0, 0, 98, 98, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 10, 105, 0, 98, 98, 110, 113, 87, 87, 118, 119, 120, 122, 123, 0, 0, 0, 98, 0, 98, 21, 22, 0, 0, 0, 58, 56, 61, 62, 63, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 82, 8, 98, 98, 98, 98, 98, 98, 108, 109, 115, 117, 121, 124, 0, 0, 0, 0, 112, 106, 92, 3, 45, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 101, 102, 103, 104, 0, 126, 127, 128, 0, 0, 0, 0, 0, 0, 113, 111, 0, 2, 0, 66, 0, 69, 70, 71, 72, 73, 0, 74, 0, 75, 0, 76, 0, 98, 114, 116, 0, 98, 98, 0, 0, 98, 98, 0, 0, 0, 0, 0, 0, 0, 106, 125, 0, 0, 0, 0, 112, 0, 136, 65, 67, 68, 77, 78, 79, 80, 0, 129, 131, 0, 112, 0, 135, 9, 98, 132, 0, 98, 0, 98, 0, 130, 0, 134, 133 }; typedef struct { char *t_name; int t_val; } yytoktype; #ifndef YYDEBUG # define YYDEBUG 0 /* don't allow debugging */ #endif #if YYDEBUG yytoktype yytoks[] = { "BEGIN", 257, "END", 258, "REGEX", 259, "SEMINEW", 260, "NEWLINE", 261, "COMMENT", 262, "FUN1", 263, "FUNN", 264, "GRGR", 265, "PRINT", 266, "PRINTF", 267, "SPRINTF", 268, "SPLIT", 269, "IF", 270, "ELSE", 271, "WHILE", 272, "FOR", 273, "IN", 274, "EXIT", 275, "NEXT", 276, "BREAK", 277, "CONTINUE", 278, "RET", 279, "GETLINE", 280, "DO", 281, "SUB", 282, "GSUB", 283, "MATCH", 284, "FUNCTION", 285, "USERFUN", 286, "DELETE", 287, "ASGNOP", 288, "?", 63, ":", 58, "OROR", 289, "ANDAND", 290, "NUMBER", 291, "VAR", 292, "SUBSTR", 293, "INDEX", 294, "MATCHOP", 295, "RELOP", 296, "<", 60, ">", 62, "OR", 297, "STRING", 298, "+", 43, "-", 45, "*", 42, "/", 47, "%", 37, "UMINUS", 299, "NOT", 300, "^", 94, "INCR", 301, "DECR", 302, "FIELD", 303, "VFIELD", 304, "-unknown-", -1 /* ends search */ }; char * yyreds[] = { "-no such reduction-", "program : junk hunks", "begin : BEGIN '{' maybe states '}' junk", "end : END '{' maybe states '}'", "end : end NEWLINE", "hunks : hunks hunk junk", "hunks : /* empty */", "hunk : patpat", "hunk : patpat '{' maybe states '}'", "hunk : FUNCTION USERFUN '(' arg_list ')' maybe '{' maybe states '}'", "hunk : '{' maybe states '}'", "hunk : begin", "hunk : end", "arg_list : expr_list", "patpat : cond", "patpat : cond ',' cond", "cond : expr", "cond : match", "cond : rel", "cond : compound_cond", "compound_cond : '(' compound_cond ')'", "compound_cond : cond ANDAND maybe cond", "compound_cond : cond OROR maybe cond", "compound_cond : NOT cond", "rel : expr RELOP expr", "rel : expr '>' expr", "rel : expr '<' expr", "rel : '(' rel ')'", "match : expr MATCHOP expr", "match : expr MATCHOP REGEX", "match : REGEX", "match : '(' match ')'", "expr : term", "expr : expr term", "expr : variable ASGNOP cond", "term : variable", "term : NUMBER", "term : STRING", "term : term '+' term", "term : term '-' term", "term : term '*' term", "term : term '/' term", "term : term '%' term", "term : term '^' term", "term : term IN VAR", "term : term '?' term ':' term", "term : variable INCR", "term : variable DECR", "term : INCR variable", "term : DECR variable", "term : '-' term", "term : '+' term", "term : '(' cond ')'", "term : GETLINE", "term : GETLINE variable", "term : GETLINE '<' expr", "term : GETLINE variable '<' expr", "term : term 'p' GETLINE", "term : term 'p' GETLINE variable", "term : FUN1", "term : FUN1 '(' ')'", "term : FUN1 '(' expr ')'", "term : FUNN '(' expr_list ')'", "term : USERFUN '(' expr_list ')'", "term : SPRINTF expr_list", "term : SUBSTR '(' expr ',' expr ',' expr ')'", "term : SUBSTR '(' expr ',' expr ')'", "term : SPLIT '(' expr ',' VAR ',' expr ')'", "term : SPLIT '(' expr ',' VAR ',' REGEX ')'", "term : SPLIT '(' expr ',' VAR ')'", "term : INDEX '(' expr ',' expr ')'", "term : MATCH '(' expr ',' REGEX ')'", "term : MATCH '(' expr ',' expr ')'", "term : SUB '(' expr ',' expr ')'", "term : SUB '(' REGEX ',' expr ')'", "term : GSUB '(' expr ',' expr ')'", "term : GSUB '(' REGEX ',' expr ')'", "term : SUB '(' expr ',' expr ',' expr ')'", "term : SUB '(' REGEX ',' expr ',' expr ')'", "term : GSUB '(' expr ',' expr ',' expr ')'", "term : GSUB '(' REGEX ',' expr ',' expr ')'", "variable : VAR", "variable : VAR '[' expr_list ']'", "variable : FIELD", "variable : VFIELD term", "expr_list : expr", "expr_list : clist", "expr_list : /* empty */", "clist : expr ',' maybe expr", "clist : clist ',' maybe expr", "clist : '(' clist ')'", "junk : junk hunksep", "junk : /* empty */", "hunksep : ';'", "hunksep : SEMINEW", "hunksep : NEWLINE", "hunksep : COMMENT", "maybe : maybe nlstuff", "maybe : /* empty */", "nlstuff : NEWLINE", "nlstuff : COMMENT", "separator : ';' maybe", "separator : SEMINEW maybe", "separator : NEWLINE maybe", "separator : COMMENT maybe", "states : states statement", "states : /* empty */", "statement : simple separator maybe", "statement : ';' maybe", "statement : SEMINEW maybe", "statement : compound", "simpnull : simple", "simpnull : /* empty */", "simple : expr", "simple : PRINT expr_list redir expr", "simple : PRINT expr_list", "simple : PRINTF expr_list redir expr", "simple : PRINTF expr_list", "simple : BREAK", "simple : NEXT", "simple : EXIT", "simple : EXIT expr", "simple : CONTINUE", "simple : RET", "simple : RET expr", "simple : DELETE VAR '[' expr ']'", "redir : '>'", "redir : GRGR", "redir : '|'", "compound : IF '(' cond ')' maybe statement", "compound : IF '(' cond ')' maybe statement ELSE maybe statement", "compound : WHILE '(' cond ')' maybe statement", "compound : DO maybe statement WHILE '(' cond ')'", "compound : FOR '(' simpnull ';' cond ';' simpnull ')' maybe statement", "compound : FOR '(' simpnull ';' ';' simpnull ')' maybe statement", "compound : FOR '(' expr ')' maybe statement", "compound : '{' maybe states '}' maybe", }; #endif /* YYDEBUG */ #line 1 "/usr/lib/yaccpar" /* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */ /* ** Skeleton parser driver for yacc output */ /* ** yacc user known macros and defines */ #define YYERROR goto yyerrlab #define YYACCEPT { free(yys); free(yyv); return(0); } #define YYABORT { free(yys); free(yyv); 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) /* ** static variables used by the parser */ static YYSTYPE *yyv; /* value stack */ static int *yys; /* state stack */ static YYSTYPE *yypv; /* top of value stack */ static int *yyps; /* top of state stack */ static int yystate; /* current state */ static int yytmp; /* extra var (lasts between blocks) */ 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() { register YYSTYPE *yypvt; /* top of value stack for $vars */ unsigned yymaxdepth = YYMAXDEPTH; /* ** Initialize externals - yyparse may be called more than once */ yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE)); yys = (int*)malloc(yymaxdepth*sizeof(int)); if (!yyv || !yys) { yyerror( "out of memory" ); return(1); } 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; (void)printf( "State %d, token ", yy_state ); if ( yychar == 0 ) (void)printf( "end-of-file\n" ); else if ( yychar < 0 ) (void)printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) break; } (void)printf( "%s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */ { /* ** reallocate and recover. Note that pointers ** have to be reset, or bad things will happen */ int yyps_index = (yy_ps - yys); int yypv_index = (yy_pv - yyv); int yypvt_index = (yypvt - yyv); yymaxdepth += YYMAXDEPTH; yyv = (YYSTYPE*)realloc((char*)yyv, yymaxdepth * sizeof(YYSTYPE)); yys = (int*)realloc((char*)yys, yymaxdepth * sizeof(int)); if (!yyv || !yys) { yyerror( "yacc stack overflow" ); return(1); } yy_ps = yys + yyps_index; yy_pv = yyv + yypv_index; yypvt = yyv + yypvt_index; } *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; (void)printf( "Received token " ); if ( yychar == 0 ) (void)printf( "end-of-file\n" ); else if ( yychar < 0 ) (void)printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) break; } (void)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; (void)printf( "Received token " ); if ( yychar == 0 ) (void)printf( "end-of-file\n" ); else if ( yychar < 0 ) (void)printf( "-none-\n" ); else { for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) { break; } } (void)printf( "%s\n", yytoks[yy_i].t_name ); } } #endif /* YYDEBUG */ /* ** look through exception table */ { register 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 ) (void)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; (void)printf( "Error recovery discards " ); if ( yychar == 0 ) (void)printf( "token end-of-file\n" ); else if ( yychar < 0 ) (void)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; } } (void)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 ) (void)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 1: # line 60 "a2p.y" { root = oper4(OPROG,yypvt[-1],begins,yypvt[-0],ends); } break; case 2: # line 64 "a2p.y" { begins = oper4(OJUNK,begins,yypvt[-3],yypvt[-2],yypvt[-0]); in_begin = FALSE; yyval = Nullop; } break; case 3: # line 69 "a2p.y" { ends = oper3(OJUNK,ends,yypvt[-2],yypvt[-1]); yyval = Nullop; } break; case 4: # line 71 "a2p.y" { yyval = yypvt[-1]; } break; case 5: # line 75 "a2p.y" { yyval = oper3(OHUNKS,yypvt[-2],yypvt[-1],yypvt[-0]); } break; case 6: # line 77 "a2p.y" { yyval = Nullop; } break; case 7: # line 81 "a2p.y" { yyval = oper1(OHUNK,yypvt[-0]); need_entire = TRUE; } break; case 8: # line 83 "a2p.y" { yyval = oper2(OHUNK,yypvt[-4],oper2(OJUNK,yypvt[-2],yypvt[-1])); } break; case 9: # line 85 "a2p.y" { fixfargs(yypvt[-8],yypvt[-6],0); yyval = oper5(OUSERDEF,yypvt[-8],yypvt[-6],yypvt[-4],yypvt[-2],yypvt[-1]); } break; case 10: # line 87 "a2p.y" { yyval = oper2(OHUNK,Nullop,oper2(OJUNK,yypvt[-2],yypvt[-1])); } break; case 13: # line 93 "a2p.y" { yyval = rememberargs(yyval); } break; case 14: # line 97 "a2p.y" { yyval = oper1(OPAT,yypvt[-0]); } break; case 15: # line 99 "a2p.y" { yyval = oper2(ORANGE,yypvt[-2],yypvt[-0]); } break; case 20: # line 110 "a2p.y" { yyval = oper1(OCPAREN,yypvt[-1]); } break; case 21: # line 112 "a2p.y" { yyval = oper3(OCANDAND,yypvt[-3],yypvt[-1],yypvt[-0]); } break; case 22: # line 114 "a2p.y" { yyval = oper3(OCOROR,yypvt[-3],yypvt[-1],yypvt[-0]); } break; case 23: # line 116 "a2p.y" { yyval = oper1(OCNOT,yypvt[-0]); } break; case 24: # line 120 "a2p.y" { yyval = oper3(ORELOP,yypvt[-1],yypvt[-2],yypvt[-0]); } break; case 25: # line 122 "a2p.y" { yyval = oper3(ORELOP,string(">",1),yypvt[-2],yypvt[-0]); } break; case 26: # line 124 "a2p.y" { yyval = oper3(ORELOP,string("<",1),yypvt[-2],yypvt[-0]); } break; case 27: # line 126 "a2p.y" { yyval = oper1(ORPAREN,yypvt[-1]); } break; case 28: # line 130 "a2p.y" { yyval = oper3(OMATCHOP,yypvt[-1],yypvt[-2],yypvt[-0]); } break; case 29: # line 132 "a2p.y" { yyval = oper3(OMATCHOP,yypvt[-1],yypvt[-2],oper1(OREGEX,yypvt[-0])); } break; case 30: # line 134 "a2p.y" { yyval = oper1(OREGEX,yypvt[-0]); } break; case 31: # line 136 "a2p.y" { yyval = oper1(OMPAREN,yypvt[-1]); } break; case 32: # line 140 "a2p.y" { yyval = yypvt[-0]; } break; case 33: # line 142 "a2p.y" { yyval = oper2(OCONCAT,yypvt[-1],yypvt[-0]); } break; case 34: # line 144 "a2p.y" { yyval = oper3(OASSIGN,yypvt[-1],yypvt[-2],yypvt[-0]); if ((ops[yypvt[-2]].ival & 255) == OFLD) lval_field = TRUE; if ((ops[yypvt[-2]].ival & 255) == OVFLD) lval_field = TRUE; } break; case 35: # line 153 "a2p.y" { yyval = yypvt[-0]; } break; case 36: # line 155 "a2p.y" { yyval = oper1(ONUM,yypvt[-0]); } break; case 37: # line 157 "a2p.y" { yyval = oper1(OSTR,yypvt[-0]); } break; case 38: # line 159 "a2p.y" { yyval = oper2(OADD,yypvt[-2],yypvt[-0]); } break; case 39: # line 161 "a2p.y" { yyval = oper2(OSUBTRACT,yypvt[-2],yypvt[-0]); } break; case 40: # line 163 "a2p.y" { yyval = oper2(OMULT,yypvt[-2],yypvt[-0]); } break; case 41: # line 165 "a2p.y" { yyval = oper2(ODIV,yypvt[-2],yypvt[-0]); } break; case 42: # line 167 "a2p.y" { yyval = oper2(OMOD,yypvt[-2],yypvt[-0]); } break; case 43: # line 169 "a2p.y" { yyval = oper2(OPOW,yypvt[-2],yypvt[-0]); } break; case 44: # line 171 "a2p.y" { yyval = oper2(ODEFINED,aryrefarg(yypvt[-0]),yypvt[-2]); } break; case 45: # line 173 "a2p.y" { yyval = oper3(OCOND,yypvt[-4],yypvt[-2],yypvt[-0]); } break; case 46: # line 175 "a2p.y" { yyval = oper1(OPOSTINCR,yypvt[-1]); } break; case 47: # line 177 "a2p.y" { yyval = oper1(OPOSTDECR,yypvt[-1]); } break; case 48: # line 179 "a2p.y" { yyval = oper1(OPREINCR,yypvt[-0]); } break; case 49: # line 181 "a2p.y" { yyval = oper1(OPREDECR,yypvt[-0]); } break; case 50: # line 183 "a2p.y" { yyval = oper1(OUMINUS,yypvt[-0]); } break; case 51: # line 185 "a2p.y" { yyval = oper1(OUPLUS,yypvt[-0]); } break; case 52: # line 187 "a2p.y" { yyval = oper1(OPAREN,yypvt[-1]); } break; case 53: # line 189 "a2p.y" { yyval = oper0(OGETLINE); } break; case 54: # line 191 "a2p.y" { yyval = oper1(OGETLINE,yypvt[-0]); } break; case 55: # line 193 "a2p.y" { yyval = oper3(OGETLINE,Nullop,string("<",1),yypvt[-0]); if (ops[yypvt[-0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 56: # line 196 "a2p.y" { yyval = oper3(OGETLINE,yypvt[-2],string("<",1),yypvt[-0]); if (ops[yypvt[-0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 57: # line 199 "a2p.y" { yyval = oper3(OGETLINE,Nullop,string("|",1),yypvt[-2]); if (ops[yypvt[-2]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 58: # line 202 "a2p.y" { yyval = oper3(OGETLINE,yypvt[-0],string("|",1),yypvt[-3]); if (ops[yypvt[-3]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 59: # line 205 "a2p.y" { yyval = oper0(yypvt[-0]); need_entire = do_chop = TRUE; } break; case 60: # line 207 "a2p.y" { yyval = oper1(yypvt[-2],Nullop); need_entire = do_chop = TRUE; } break; case 61: # line 209 "a2p.y" { yyval = oper1(yypvt[-3],yypvt[-1]); } break; case 62: # line 211 "a2p.y" { yyval = oper1(yypvt[-3],yypvt[-1]); } break; case 63: # line 213 "a2p.y" { yyval = oper2(OUSERFUN,yypvt[-3],yypvt[-1]); } break; case 64: # line 215 "a2p.y" { yyval = oper1(OSPRINTF,yypvt[-0]); } break; case 65: # line 217 "a2p.y" { yyval = oper3(OSUBSTR,yypvt[-5],yypvt[-3],yypvt[-1]); } break; case 66: # line 219 "a2p.y" { yyval = oper2(OSUBSTR,yypvt[-3],yypvt[-1]); } break; case 67: # line 221 "a2p.y" { yyval = oper3(OSPLIT,yypvt[-5],aryrefarg(numary(yypvt[-3])),yypvt[-1]); } break; case 68: # line 223 "a2p.y" { yyval = oper3(OSPLIT,yypvt[-5],aryrefarg(numary(yypvt[-3])),oper1(OREGEX,yypvt[-1]));} break; case 69: # line 225 "a2p.y" { yyval = oper2(OSPLIT,yypvt[-3],aryrefarg(numary(yypvt[-1]))); } break; case 70: # line 227 "a2p.y" { yyval = oper2(OINDEX,yypvt[-3],yypvt[-1]); } break; case 71: # line 229 "a2p.y" { yyval = oper2(OMATCH,yypvt[-3],oper1(OREGEX,yypvt[-1])); } break; case 72: # line 231 "a2p.y" { yyval = oper2(OMATCH,yypvt[-3],yypvt[-1]); } break; case 73: # line 233 "a2p.y" { yyval = oper2(OSUB,yypvt[-3],yypvt[-1]); } break; case 74: # line 235 "a2p.y" { yyval = oper2(OSUB,oper1(OREGEX,yypvt[-3]),yypvt[-1]); } break; case 75: # line 237 "a2p.y" { yyval = oper2(OGSUB,yypvt[-3],yypvt[-1]); } break; case 76: # line 239 "a2p.y" { yyval = oper2(OGSUB,oper1(OREGEX,yypvt[-3]),yypvt[-1]); } break; case 77: # line 241 "a2p.y" { yyval = oper3(OSUB,yypvt[-5],yypvt[-3],yypvt[-1]); } break; case 78: # line 243 "a2p.y" { yyval = oper3(OSUB,oper1(OREGEX,yypvt[-5]),yypvt[-3],yypvt[-1]); } break; case 79: # line 245 "a2p.y" { yyval = oper3(OGSUB,yypvt[-5],yypvt[-3],yypvt[-1]); } break; case 80: # line 247 "a2p.y" { yyval = oper3(OGSUB,oper1(OREGEX,yypvt[-5]),yypvt[-3],yypvt[-1]); } break; case 81: # line 251 "a2p.y" { yyval = oper1(OVAR,yypvt[-0]); } break; case 82: # line 253 "a2p.y" { yyval = oper2(OVAR,aryrefarg(yypvt[-3]),yypvt[-1]); } break; case 83: # line 255 "a2p.y" { yyval = oper1(OFLD,yypvt[-0]); } break; case 84: # line 257 "a2p.y" { yyval = oper1(OVFLD,yypvt[-0]); } break; case 87: # line 264 "a2p.y" { yyval = Nullop; } break; case 88: # line 268 "a2p.y" { yyval = oper3(OCOMMA,yypvt[-3],yypvt[-1],yypvt[-0]); } break; case 89: # line 270 "a2p.y" { yyval = oper3(OCOMMA,yypvt[-3],yypvt[-1],yypvt[-0]); } break; case 90: # line 272 "a2p.y" { yyval = yypvt[-1]; } break; case 91: # line 276 "a2p.y" { yyval = oper2(OJUNK,yypvt[-1],yypvt[-0]); } break; case 92: # line 278 "a2p.y" { yyval = Nullop; } break; case 93: # line 282 "a2p.y" { yyval = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } break; case 94: # line 284 "a2p.y" { yyval = oper2(OJUNK,oper0(OSEMICOLON),oper0(ONEWLINE)); } break; case 95: # line 286 "a2p.y" { yyval = oper0(ONEWLINE); } break; case 96: # line 288 "a2p.y" { yyval = oper1(OCOMMENT,yypvt[-0]); } break; case 97: # line 292 "a2p.y" { yyval = oper2(OJUNK,yypvt[-1],yypvt[-0]); } break; case 98: # line 294 "a2p.y" { yyval = Nullop; } break; case 99: # line 298 "a2p.y" { yyval = oper0(ONEWLINE); } break; case 100: # line 300 "a2p.y" { yyval = oper1(OCOMMENT,yypvt[-0]); } break; case 101: # line 305 "a2p.y" { yyval = oper2(OJUNK,oper0(OSEMICOLON),yypvt[-0]); } break; case 102: # line 307 "a2p.y" { yyval = oper2(OJUNK,oper0(OSNEWLINE),yypvt[-0]); } break; case 103: # line 309 "a2p.y" { yyval = oper2(OJUNK,oper0(OSNEWLINE),yypvt[-0]); } break; case 104: # line 311 "a2p.y" { yyval = oper2(OJUNK,oper1(OSCOMMENT,yypvt[-1]),yypvt[-0]); } break; case 105: # line 315 "a2p.y" { yyval = oper2(OSTATES,yypvt[-1],yypvt[-0]); } break; case 106: # line 317 "a2p.y" { yyval = Nullop; } break; case 107: # line 322 "a2p.y" { yyval = oper2(OJUNK,oper2(OSTATE,yypvt[-2],yypvt[-1]),yypvt[-0]); } break; case 108: # line 324 "a2p.y" { yyval = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSEMICOLON),yypvt[-0])); } break; case 109: # line 326 "a2p.y" { yyval = oper2(OSTATE,Nullop,oper2(OJUNK,oper0(OSNEWLINE),yypvt[-0])); } break; case 112: # line 332 "a2p.y" { yyval = Nullop; } break; case 114: # line 338 "a2p.y" { yyval = oper3(OPRINT,yypvt[-2],yypvt[-1],yypvt[-0]); do_opens = TRUE; saw_ORS = saw_OFS = TRUE; if (!yypvt[-2]) need_entire = TRUE; if (ops[yypvt[-0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 115: # line 344 "a2p.y" { yyval = oper1(OPRINT,yypvt[-0]); if (!yypvt[-0]) need_entire = TRUE; saw_ORS = saw_OFS = TRUE; } break; case 116: # line 349 "a2p.y" { yyval = oper3(OPRINTF,yypvt[-2],yypvt[-1],yypvt[-0]); do_opens = TRUE; if (!yypvt[-2]) need_entire = TRUE; if (ops[yypvt[-0]].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } break; case 117: # line 354 "a2p.y" { yyval = oper1(OPRINTF,yypvt[-0]); if (!yypvt[-0]) need_entire = TRUE; } break; case 118: # line 358 "a2p.y" { yyval = oper0(OBREAK); } break; case 119: # line 360 "a2p.y" { yyval = oper0(ONEXT); } break; case 120: # line 362 "a2p.y" { yyval = oper0(OEXIT); } break; case 121: # line 364 "a2p.y" { yyval = oper1(OEXIT,yypvt[-0]); } break; case 122: # line 366 "a2p.y" { yyval = oper0(OCONTINUE); } break; case 123: # line 368 "a2p.y" { yyval = oper0(ORETURN); } break; case 124: # line 370 "a2p.y" { yyval = oper1(ORETURN,yypvt[-0]); } break; case 125: # line 372 "a2p.y" { yyval = oper2(ODELETE,aryrefarg(yypvt[-3]),yypvt[-1]); } break; case 126: # line 376 "a2p.y" { yyval = oper1(OREDIR,string(">",1)); } break; case 127: # line 378 "a2p.y" { yyval = oper1(OREDIR,string(">>",2)); } break; case 128: # line 380 "a2p.y" { yyval = oper1(OREDIR,string("|",1)); } break; case 129: # line 385 "a2p.y" { yyval = oper2(OIF,yypvt[-3],bl(yypvt[-0],yypvt[-1])); } break; case 130: # line 387 "a2p.y" { yyval = oper3(OIF,yypvt[-6],bl(yypvt[-3],yypvt[-4]),bl(yypvt[-0],yypvt[-1])); } break; case 131: # line 389 "a2p.y" { yyval = oper2(OWHILE,yypvt[-3],bl(yypvt[-0],yypvt[-1])); } break; case 132: # line 391 "a2p.y" { yyval = oper2(ODO,bl(yypvt[-4],yypvt[-5]),yypvt[-1]); } break; case 133: # line 393 "a2p.y" { yyval = oper4(OFOR,yypvt[-7],yypvt[-5],yypvt[-3],bl(yypvt[-0],yypvt[-1])); } break; case 134: # line 395 "a2p.y" { yyval = oper4(OFOR,yypvt[-6],string("",0),yypvt[-3],bl(yypvt[-0],yypvt[-1])); } break; case 135: # line 397 "a2p.y" { yyval = oper2(OFORIN,yypvt[-3],bl(yypvt[-0],yypvt[-1])); } break; case 136: # line 399 "a2p.y" { yyval = oper3(OBLOCK,oper2(OJUNK,yypvt[-3],yypvt[-2]),Nullop,yypvt[-0]); } break; } goto yystack; /* reset registers in driver code */ }