1 | 2 | /* A Bison parser, made from er.yacc 3 | by GNU Bison version 1.28 */ 4 | 5 | #define YYBISON 1 /* Identify Bison output. */ 6 | 7 | #define yyparse er_yyparse 8 | #define yylex er_yylex 9 | #define yyerror er_yyerror 10 | #define yylval er_yylval 11 | #define yychar er_yychar 12 | #define yydebug er_yydebug 13 | #define yynerrs er_yynerrs 14 | #define EOL 257 15 | #define K_SOCK 258 16 | #define K_NAME 259 17 | #define K_FAC 260 18 | #define K_ADD 261 19 | #define K_RM 262 20 | #define K_CREATE 263 21 | #define K_DELETE 264 22 | #define K_MODIFY 265 23 | #define K_AUTO 266 24 | #define K_ASP 267 25 | #define K_SEV 268 26 | #define K_THR 269 27 | #define K_FORMAT 270 28 | #define K_SELF 271 29 | #define K_DATE 272 30 | #define K_ALL 273 31 | #define K_EXEC 274 32 | #define K_PATH 275 33 | #define STRING 276 34 | #define NUMBER 277 35 | #define HEXNUM 278 36 | 37 | 38 | 39 | /* NOTE: We'd like to use "rip.h", but "mm.h" defines STRING which 40 | collides with the STRING here */ 41 | #include "erroutines.h" 42 | #include "memwrap.h" 43 | #include "bitmask.h" 44 | #include "er_yacc_helper.h" 45 | #include "er_arrays.h" 46 | #include "er_macro.h" 47 | #include "er_paths.h" 48 | 49 | #include <stdlib.h> 50 | #include <string.h> 51 | 52 | #define YYPARSE_PARAM ypar 53 | #define YYLEX_PARAM ypar 54 | #define YYDEBUG 0 55 | /* #define YYERROR_VERBOSE */ 56 | 57 | #define er_yyerror(a) myerror(ypar,a) 58 | 59 | #define adderr(a,b) {strcat(a->errtxt,b);} 60 | 61 | #define myfree(mem) {lexerr_t *erst = ypar; free(mem); erst->token = NULL} 62 | 63 | #define MYABORT { mycleanup(ypar); YYABORT; } 64 | 65 | 66 | typedef union { 67 | int inum; 68 | char *text; 69 | } YYSTYPE; 70 | #include <stdio.h> 71 | 72 | #ifndef __cplusplus 73 | #ifndef __STDC__ 74 | #define const 75 | #endif 76 | #endif 77 | 78 | 79 | 80 | #define YYFINAL 85 81 | #define YYFLAG -32768 82 | #define YYNTBASE 31 83 | 84 | #define YYTRANSLATE(x) ((unsigned)(x) <= 278 ? yytranslate[x] : 62) 85 | 86 | static const char yytranslate[] = { 0, 87 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 88 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 89 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 90 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 28, 91 | 29, 2, 2, 2, 30, 2, 2, 2, 2, 2, 92 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 93 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 94 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 95 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 96 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 97 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 98 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 99 | 2, 2, 25, 27, 26, 2, 2, 2, 2, 2, 100 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 101 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 102 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 103 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 104 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 105 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 106 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 107 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 108 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 109 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 110 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 111 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 112 | 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 113 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 114 | 17, 18, 19, 20, 21, 22, 23, 24 115 | }; 116 | 117 | #if YYDEBUG != 0 118 | static const short yyprhs[] = { 0, 119 | 0, 2, 5, 7, 8, 14, 17, 21, 26, 31, 120 | 33, 35, 40, 42, 44, 46, 48, 51, 53, 55, 121 | 59, 61, 64, 68, 71, 72, 74, 78, 79, 81, 122 | 83, 86, 88, 90, 93, 97, 102, 104, 107, 110, 123 | 111, 114, 115, 118, 120, 124, 126, 128, 132, 134, 124 | 135, 137, 138, 140, 142, 144, 148, 150 125 | }; 126 | 127 | static const short yyrhs[] = { 32, 128 | 0, 32, 3, 0, 1, 0, 0, 9, 34, 33, 129 | 35, 47, 0, 10, 34, 0, 11, 34, 35, 0, 130 | 11, 34, 8, 46, 0, 11, 34, 7, 47, 0, 131 | 22, 0, 12, 0, 25, 37, 36, 26, 0, 40, 132 | 0, 41, 0, 43, 0, 1, 0, 16, 38, 0, 133 | 1, 0, 39, 0, 38, 27, 39, 0, 22, 0, 134 | 4, 23, 0, 5, 22, 42, 0, 5, 1, 0, 135 | 0, 18, 0, 20, 44, 45, 0, 0, 21, 0, 136 | 22, 0, 45, 22, 0, 23, 0, 48, 0, 47, 137 | 48, 0, 28, 49, 29, 0, 50, 52, 51, 53, 138 | 0, 1, 0, 6, 54, 0, 14, 56, 0, 0, 139 | 13, 60, 0, 0, 15, 17, 0, 55, 0, 54, 140 | 27, 55, 0, 19, 0, 22, 0, 57, 30, 58, 141 | 0, 59, 0, 0, 22, 0, 0, 22, 0, 22, 142 | 0, 61, 0, 60, 27, 61, 0, 22, 0, 24, 143 | 0 144 | }; 145 | 146 | #endif 147 | 148 | #if YYDEBUG != 0 149 | static const short yyrline[] = { 0, 150 | 80, 81, 82, 87, 92, 121, 134, 149, 165, 181, 151 | 182, 187, 192, 193, 194, 195, 200, 201, 206, 207, 152 | 210, 227, 235, 242, 247, 247, 253, 259, 259, 265, 153 | 270, 278, 281, 282, 285, 294, 295, 302, 304, 306, 154 | 307, 309, 310, 316, 317, 322, 326, 343, 344, 347, 155 | 350, 356, 359, 365, 378, 379, 384, 399 156 | }; 157 | #endif 158 | 159 | 160 | #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) 161 | 162 | static const char * const yytname[] = { "$","error","$undefined.","EOL","K_SOCK", 163 | "K_NAME","K_FAC","K_ADD","K_RM","K_CREATE","K_DELETE","K_MODIFY","K_AUTO","K_ASP", 164 | "K_SEV","K_THR","K_FORMAT","K_SELF","K_DATE","K_ALL","K_EXEC","K_PATH","STRING", 165 | "NUMBER","HEXNUM","'{'","'}'","'|'","'('","')'","'-'","fullline","stmt","@1", 166 | "pathid","path","pathspec","formatspec","formlist","oneform","sockspec","namespec", 167 | "nameoptions","execspec","opt_path","execwords","filterid","filters","filter", 168 | "filtspec","mand_fac","mand_sev","opt_asp","opt_thr","facspec","onefac","sevspec", 169 | "sevmin","sevmax","seveql","aspspec","oneasp", NULL 170 | }; 171 | #endif 172 | 173 | static const short yyr1[] = { 0, 174 | 31, 31, 31, 33, 32, 32, 32, 32, 32, 34, 175 | 34, 35, 36, 36, 36, 36, 37, 37, 38, 38, 176 | 39, 40, 41, 41, 42, 42, 43, 44, 44, 45, 177 | 45, 46, 47, 47, 48, 49, 49, 50, 51, 52, 178 | 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 179 | 57, 58, 58, 59, 60, 60, 61, 61 180 | }; 181 | 182 | static const short yyr2[] = { 0, 183 | 1, 2, 1, 0, 5, 2, 3, 4, 4, 1, 184 | 1, 4, 1, 1, 1, 1, 2, 1, 1, 3, 185 | 1, 2, 3, 2, 0, 1, 3, 0, 1, 1, 186 | 2, 1, 1, 2, 3, 4, 1, 2, 2, 0, 187 | 2, 0, 2, 1, 3, 1, 1, 3, 1, 0, 188 | 1, 0, 1, 1, 1, 3, 1, 1 189 | }; 190 | 191 | static const short yydefact[] = { 0, 192 | 3, 0, 0, 0, 1, 11, 10, 4, 6, 0, 193 | 2, 0, 0, 0, 0, 7, 0, 0, 9, 33, 194 | 32, 8, 18, 0, 0, 5, 37, 0, 0, 40, 195 | 34, 21, 17, 19, 16, 0, 0, 28, 0, 13, 196 | 14, 15, 46, 47, 38, 44, 35, 0, 0, 0, 197 | 22, 24, 25, 29, 0, 12, 0, 57, 58, 41, 198 | 55, 50, 42, 20, 26, 23, 30, 27, 45, 0, 199 | 54, 39, 0, 49, 0, 36, 31, 56, 52, 43, 200 | 53, 48, 0, 0, 0 201 | }; 202 | 203 | static const short yydefgoto[] = { 83, 204 | 5, 12, 8, 16, 39, 25, 33, 34, 40, 41, 205 | 66, 42, 55, 68, 22, 19, 20, 29, 30, 63, 206 | 49, 76, 45, 46, 72, 73, 82, 74, 60, 61 207 | }; 208 | 209 | static const short yypact[] = { 5, 210 | -32768, -10, -10, -10, 4,-32768,-32768,-32768,-32768, 1, 211 | -32768, -2, 6, 7, 2,-32768, 6, 18, 6,-32768, 212 | -32768,-32768,-32768, 9, 0, 6,-32768, 3, 8, 16, 213 | -32768,-32768, 11,-32768,-32768, 10, -1, 14, 13,-32768, 214 | -32768,-32768,-32768,-32768, 15,-32768,-32768, -11, 22, 9, 215 | -32768,-32768, 23,-32768, 21,-32768, 3,-32768,-32768, 17, 216 | -32768, 25, 30,-32768,-32768,-32768,-32768, 26,-32768, -11, 217 | 19,-32768, 20,-32768, 29,-32768,-32768,-32768, 31,-32768, 218 | -32768,-32768, 32, 40,-32768 219 | }; 220 | 221 | static const short yypgoto[] = {-32768, 222 | -32768,-32768, 24, 39,-32768,-32768,-32768, 12,-32768,-32768, 223 | -32768,-32768,-32768,-32768,-32768, 35, -9,-32768,-32768,-32768, 224 | -32768,-32768,-32768, -3,-32768,-32768,-32768,-32768,-32768, -15 225 | }; 226 | 227 | 228 | #define YYLAST 62 229 | 230 | 231 | static const short yytable[] = { 52, 232 | 35, 6, 23, 36, 37, 1, 11, 13, 14, 31, 233 | 58, 7, 59, 2, 3, 4, 31, 24, 27, 38, 234 | 53, 43, 15, 28, 44, 15, 9, 10, 48, 21, 235 | 32, 84, 51, 18, 54, 62, 47, 50, 56, 85, 236 | 65, 57, 67, 70, 75, 80, 71, 77, -51, 79, 237 | 17, 26, 81, 69, 78, 0, 0, 0, 0, 0, 238 | 0, 64 239 | }; 240 | 241 | static const short yycheck[] = { 1, 242 | 1, 12, 1, 4, 5, 1, 3, 7, 8, 19, 243 | 22, 22, 24, 9, 10, 11, 26, 16, 1, 20, 244 | 22, 19, 25, 6, 22, 25, 3, 4, 13, 23, 245 | 22, 0, 23, 28, 21, 14, 29, 27, 26, 0, 246 | 18, 27, 22, 27, 15, 17, 22, 22, 30, 30, 247 | 12, 17, 22, 57, 70, -1, -1, -1, -1, -1, 248 | -1, 50 249 | }; 250 | #define YYPURE 1 251 | 252 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ 253 | 254 | /* This file comes from bison-1.28. */ 255 | 256 | /* Skeleton output parser for bison, 257 | Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. 258 | 259 | This program is free software; you can redistribute it and/or modify 260 | it under the terms of the GNU General Public License as published by 261 | the Free Software Foundation; either version 2, or (at your option) 262 | any later version. 263 | 264 | This program is distributed in the hope that it will be useful, 265 | but WITHOUT ANY WARRANTY; without even the implied warranty of 266 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 267 | GNU General Public License for more details. 268 | 269 | You should have received a copy of the GNU General Public License 270 | along with this program; if not, write to the Free Software 271 | Foundation, Inc., 59 Temple Place - Suite 330, 272 | Boston, MA 02111-1307, USA. */ 273 | 274 | /* As a special exception, when this file is copied by Bison into a 275 | Bison output file, you may use that output file without restriction. 276 | This special exception was added by the Free Software Foundation 277 | in version 1.24 of Bison. */ 278 | 279 | /* This is the parser code that is written into each bison parser 280 | when the %semantic_parser declaration is not specified in the grammar. 281 | It was written by Richard Stallman by simplifying the hairy parser 282 | used when %semantic_parser is specified. */ 283 | 284 | #ifndef YYSTACK_USE_ALLOCA 285 | #ifdef alloca 286 | #define YYSTACK_USE_ALLOCA 287 | #else /* alloca not defined */ 288 | #ifdef __GNUC__ 289 | #define YYSTACK_USE_ALLOCA 290 | #define alloca __builtin_alloca 291 | #else /* not GNU C. */ 292 | #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) 293 | #define YYSTACK_USE_ALLOCA 294 | #include <alloca.h> 295 | #else /* not sparc */ 296 | /* We think this test detects Watcom and Microsoft C. */ 297 | /* This used to test MSDOS, but that is a bad idea 298 | since that symbol is in the user namespace. */ 299 | #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) 300 | #if 0 /* No need for malloc.h, which pollutes the namespace; 301 | instead, just don't use alloca. */ 302 | #include <malloc.h> 303 | #endif 304 | #else /* not MSDOS, or __TURBOC__ */ 305 | #if defined(_AIX) 306 | /* I don't know what this was needed for, but it pollutes the namespace. 307 | So I turned it off. rms, 2 May 1997. */ 308 | /* #include <malloc.h> */ 309 | #pragma alloca 310 | #define YYSTACK_USE_ALLOCA 311 | #else /* not MSDOS, or __TURBOC__, or _AIX */ 312 | #if 0 313 | #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, 314 | and on HPUX 10. Eventually we can turn this on. */ 315 | #define YYSTACK_USE_ALLOCA 316 | #define alloca __builtin_alloca 317 | #endif /* __hpux */ 318 | #endif 319 | #endif /* not _AIX */ 320 | #endif /* not MSDOS, or __TURBOC__ */ 321 | #endif /* not sparc */ 322 | #endif /* not GNU C */ 323 | #endif /* alloca not defined */ 324 | #endif /* YYSTACK_USE_ALLOCA not defined */ 325 | 326 | #ifdef YYSTACK_USE_ALLOCA 327 | #define YYSTACK_ALLOC alloca 328 | #else 329 | #define YYSTACK_ALLOC malloc 330 | #endif 331 | 332 | /* Note: there must be only one dollar sign in this file. 333 | It is replaced by the list of actions, each action 334 | as one case of the switch. */ 335 | 336 | #define yyerrok (yyerrstatus = 0) 337 | #define yyclearin (yychar = YYEMPTY) 338 | #define YYEMPTY -2 339 | #define YYEOF 0 340 | #define YYACCEPT goto yyacceptlab 341 | #define YYABORT goto yyabortlab 342 | #define YYERROR goto yyerrlab1 343 | /* Like YYERROR except do call yyerror. 344 | This remains here temporarily to ease the 345 | transition to the new meaning of YYERROR, for GCC. 346 | Once GCC version 2 has supplanted version 1, this can go. */ 347 | #define YYFAIL goto yyerrlab 348 | #define YYRECOVERING() (!!yyerrstatus) 349 | #define YYBACKUP(token, value) \ 350 | do \ 351 | if (yychar == YYEMPTY && yylen == 1) \ 352 | { yychar = (token), yylval = (value); \ 353 | yychar1 = YYTRANSLATE (yychar); \ 354 | YYPOPSTACK; \ 355 | goto yybackup; \ 356 | } \ 357 | else \ 358 | { yyerror ("syntax error: cannot back up"); YYERROR; } \ 359 | while (0) 360 | 361 | #define YYTERROR 1 362 | #define YYERRCODE 256 363 | 364 | #ifndef YYPURE 365 | #define YYLEX yylex() 366 | #endif 367 | 368 | #ifdef YYPURE 369 | #ifdef YYLSP_NEEDED 370 | #ifdef YYLEX_PARAM 371 | #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) 372 | #else 373 | #define YYLEX yylex(&yylval, &yylloc) 374 | #endif 375 | #else /* not YYLSP_NEEDED */ 376 | #ifdef YYLEX_PARAM 377 | #define YYLEX yylex(&yylval, YYLEX_PARAM) 378 | #else 379 | #define YYLEX yylex(&yylval) 380 | #endif 381 | #endif /* not YYLSP_NEEDED */ 382 | #endif 383 | 384 | /* If nonreentrant, generate the variables here */ 385 | 386 | #ifndef YYPURE 387 | 388 | int yychar; /* the lookahead symbol */ 389 | YYSTYPE yylval; /* the semantic value of the */ 390 | /* lookahead symbol */ 391 | 392 | #ifdef YYLSP_NEEDED 393 | YYLTYPE yylloc; /* location data for the lookahead */ 394 | /* symbol */ 395 | #endif 396 | 397 | int yynerrs; /* number of parse errors so far */ 398 | #endif /* not YYPURE */ 399 | 400 | #if YYDEBUG != 0 401 | int yydebug; /* nonzero means print parse trace */ 402 | /* Since this is uninitialized, it does not stop multiple parsers 403 | from coexisting. */ 404 | #endif 405 | 406 | /* YYINITDEPTH indicates the initial size of the parser's stacks */ 407 | 408 | #ifndef YYINITDEPTH 409 | #define YYINITDEPTH 200 410 | #endif 411 | 412 | /* YYMAXDEPTH is the maximum size the stacks can grow to 413 | (effective only if the built-in stack extension method is used). */ 414 | 415 | #if YYMAXDEPTH == 0 416 | #undef YYMAXDEPTH 417 | #endif 418 | 419 | #ifndef YYMAXDEPTH 420 | #define YYMAXDEPTH 10000 421 | #endif 422 | 423 | /* Define __yy_memcpy. Note that the size argument 424 | should be passed with type unsigned int, because that is what the non-GCC 425 | definitions require. With GCC, __builtin_memcpy takes an arg 426 | of type size_t, but it can handle unsigned int. */ 427 | 428 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ 429 | #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) 430 | #else /* not GNU C or C++ */ 431 | #ifndef __cplusplus 432 | 433 | /* This is the most reliable way to avoid incompatibilities 434 | in available built-in functions on various systems. */ 435 | static void 436 | __yy_memcpy (to, from, count) 437 | char *to; 438 | char *from; 439 | unsigned int count; 440 | { 441 | register char *f = from; 442 | register char *t = to; 443 | register int i = count; 444 | 445 | while (i-- > 0) 446 | *t++ = *f++; 447 | } 448 | 449 | #else /* __cplusplus */ 450 | 451 | /* This is the most reliable way to avoid incompatibilities 452 | in available built-in functions on various systems. */ 453 | static void 454 | __yy_memcpy (char *to, char *from, unsigned int count) 455 | { 456 | register char *t = to; 457 | register char *f = from; 458 | register int i = count; 459 | 460 | while (i-- > 0) 461 | *t++ = *f++; 462 | } 463 | 464 | #endif 465 | #endif 466 | 467 | 468 | 469 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed 470 | into yyparse. The argument should have type void *. 471 | It should actually point to an object. 472 | Grammar actions can access the variable by casting it 473 | to the proper pointer type. */ 474 | 475 | #ifdef YYPARSE_PARAM 476 | #ifdef __cplusplus 477 | #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM 478 | #define YYPARSE_PARAM_DECL 479 | #else /* not __cplusplus */ 480 | #define YYPARSE_PARAM_ARG YYPARSE_PARAM 481 | #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; 482 | #endif /* not __cplusplus */ 483 | #else /* not YYPARSE_PARAM */ 484 | #define YYPARSE_PARAM_ARG 485 | #define YYPARSE_PARAM_DECL 486 | #endif /* not YYPARSE_PARAM */ 487 | 488 | /* Prevent warning if -Wstrict-prototypes. */ 489 | #ifdef __GNUC__ 490 | #ifdef YYPARSE_PARAM 491 | int yyparse (void *); 492 | #else 493 | int yyparse (void); 494 | #endif 495 | #endif 496 | 497 | int 498 | yyparse(YYPARSE_PARAM_ARG) 499 | YYPARSE_PARAM_DECL 500 | { 501 | register int yystate; 502 | register int yyn; 503 | register short *yyssp; 504 | register YYSTYPE *yyvsp; 505 | int yyerrstatus; /* number of tokens to shift before error messages enabled */ 506 | int yychar1 = 0; /* lookahead token as an internal (translated) token number */ 507 | 508 | short yyssa[YYINITDEPTH]; /* the state stack */ 509 | YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ 510 | 511 | short *yyss = yyssa; /* refer to the stacks thru separate pointers */ 512 | YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ 513 | 514 | #ifdef YYLSP_NEEDED 515 | YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ 516 | YYLTYPE *yyls = yylsa; 517 | YYLTYPE *yylsp; 518 | 519 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) 520 | #else 521 | #define YYPOPSTACK (yyvsp--, yyssp--) 522 | #endif 523 | 524 | int yystacksize = YYINITDEPTH; 525 | int yyfree_stacks = 0; 526 | 527 | #ifdef YYPURE 528 | int yychar; 529 | YYSTYPE yylval; 530 | int yynerrs; 531 | #ifdef YYLSP_NEEDED 532 | YYLTYPE yylloc; 533 | #endif 534 | #endif 535 | 536 | YYSTYPE yyval; /* the variable used to return */ 537 | /* semantic values from the action */ 538 | /* routines */ 539 | 540 | int yylen; 541 | 542 | #if YYDEBUG != 0 543 | if (yydebug) 544 | fprintf(stderr, "Starting parse\n"); 545 | #endif 546 | 547 | yystate = 0; 548 | yyerrstatus = 0; 549 | yynerrs = 0; 550 | yychar = YYEMPTY; /* Cause a token to be read. */ 551 | 552 | /* Initialize stack pointers. 553 | Waste one element of value and location stack 554 | so that they stay on the same level as the state stack. 555 | The wasted elements are never initialized. */ 556 | 557 | yyssp = yyss - 1; 558 | yyvsp = yyvs; 559 | #ifdef YYLSP_NEEDED 560 | yylsp = yyls; 561 | #endif 562 | 563 | /* Push a new state, which is found in yystate . */ 564 | /* In all cases, when you get here, the value and location stacks 565 | have just been pushed. so pushing a state here evens the stacks. */ 566 | yynewstate: 567 | 568 | *++yyssp = yystate; 569 | 570 | if (yyssp >= yyss + yystacksize - 1) 571 | { 572 | /* Give user a chance to reallocate the stack */ 573 | /* Use copies of these so that the &'s don't force the real ones into memory. */ 574 | YYSTYPE *yyvs1 = yyvs; 575 | short *yyss1 = yyss; 576 | #ifdef YYLSP_NEEDED 577 | YYLTYPE *yyls1 = yyls; 578 | #endif 579 | 580 | /* Get the current used size of the three stacks, in elements. */ 581 | int size = yyssp - yyss + 1; 582 | 583 | #ifdef yyoverflow 584 | /* Each stack pointer address is followed by the size of 585 | the data in use in that stack, in bytes. */ 586 | #ifdef YYLSP_NEEDED 587 | /* This used to be a conditional around just the two extra args, 588 | but that might be undefined if yyoverflow is a macro. */ 589 | yyoverflow("parser stack overflow", 590 | &yyss1, size * sizeof (*yyssp), 591 | &yyvs1, size * sizeof (*yyvsp), 592 | &yyls1, size * sizeof (*yylsp), 593 | &yystacksize); 594 | #else 595 | yyoverflow("parser stack overflow", 596 | &yyss1, size * sizeof (*yyssp), 597 | &yyvs1, size * sizeof (*yyvsp), 598 | &yystacksize); 599 | #endif 600 | 601 | yyss = yyss1; yyvs = yyvs1; 602 | #ifdef YYLSP_NEEDED 603 | yyls = yyls1; 604 | #endif 605 | #else /* no yyoverflow */ 606 | /* Extend the stack our own way. */ 607 | if (yystacksize >= YYMAXDEPTH) 608 | { 609 | yyerror("parser stack overflow"); 610 | if (yyfree_stacks) 611 | { 612 | free (yyss); 613 | free (yyvs); 614 | #ifdef YYLSP_NEEDED 615 | free (yyls); 616 | #endif 617 | } 618 | return 2; 619 | } 620 | yystacksize *= 2; 621 | if (yystacksize > YYMAXDEPTH) 622 | yystacksize = YYMAXDEPTH; 623 | #ifndef YYSTACK_USE_ALLOCA 624 | yyfree_stacks = 1; 625 | #endif 626 | yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); 627 | __yy_memcpy ((char *)yyss, (char *)yyss1, 628 | size * (unsigned int) sizeof (*yyssp)); 629 | yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); 630 | __yy_memcpy ((char *)yyvs, (char *)yyvs1, 631 | size * (unsigned int) sizeof (*yyvsp)); 632 | #ifdef YYLSP_NEEDED 633 | yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); 634 | __yy_memcpy ((char *)yyls, (char *)yyls1, 635 | size * (unsigned int) sizeof (*yylsp)); 636 | #endif 637 | #endif /* no yyoverflow */ 638 | 639 | yyssp = yyss + size - 1; 640 | yyvsp = yyvs + size - 1; 641 | #ifdef YYLSP_NEEDED 642 | yylsp = yyls + size - 1; 643 | #endif 644 | 645 | #if YYDEBUG != 0 646 | if (yydebug) 647 | fprintf(stderr, "Stack size increased to %d\n", yystacksize); 648 | #endif 649 | 650 | if (yyssp >= yyss + yystacksize - 1) 651 | YYABORT; 652 | } 653 | 654 | #if YYDEBUG != 0 655 | if (yydebug) 656 | fprintf(stderr, "Entering state %d\n", yystate); 657 | #endif 658 | 659 | goto yybackup; 660 | yybackup: 661 | 662 | /* Do appropriate processing given the current state. */ 663 | /* Read a lookahead token if we need one and don't already have one. */ 664 | /* yyresume: */ 665 | 666 | /* First try to decide what to do without reference to lookahead token. */ 667 | 668 | yyn = yypact[yystate]; 669 | if (yyn == YYFLAG) 670 | goto yydefault; 671 | 672 | /* Not known => get a lookahead token if don't already have one. */ 673 | 674 | /* yychar is either YYEMPTY or YYEOF 675 | or a valid token in external form. */ 676 | 677 | if (yychar == YYEMPTY) 678 | { 679 | #if YYDEBUG != 0 680 | if (yydebug) 681 | fprintf(stderr, "Reading a token: "); 682 | #endif 683 | yychar = YYLEX; 684 | } 685 | 686 | /* Convert token to internal form (in yychar1) for indexing tables with */ 687 | 688 | if (yychar <= 0) /* This means end of input. */ 689 | { 690 | yychar1 = 0; 691 | yychar = YYEOF; /* Don't call YYLEX any more */ 692 | 693 | #if YYDEBUG != 0 694 | if (yydebug) 695 | fprintf(stderr, "Now at end of input.\n"); 696 | #endif 697 | } 698 | else 699 | { 700 | yychar1 = YYTRANSLATE(yychar); 701 | 702 | #if YYDEBUG != 0 703 | if (yydebug) 704 | { 705 | fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); 706 | /* Give the individual parser a way to print the precise meaning 707 | of a token, for further debugging info. */ 708 | #ifdef YYPRINT 709 | YYPRINT (stderr, yychar, yylval); 710 | #endif 711 | fprintf (stderr, ")\n"); 712 | } 713 | #endif 714 | } 715 | 716 | yyn += yychar1; 717 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) 718 | goto yydefault; 719 | 720 | yyn = yytable[yyn]; 721 | 722 | /* yyn is what to do for this token type in this state. 723 | Negative => reduce, -yyn is rule number. 724 | Positive => shift, yyn is new state. 725 | New state is final state => don't bother to shift, 726 | just return success. 727 | 0, or most negative number => error. */ 728 | 729 | if (yyn < 0) 730 | { 731 | if (yyn == YYFLAG) 732 | goto yyerrlab; 733 | yyn = -yyn; 734 | goto yyreduce; 735 | } 736 | else if (yyn == 0) 737 | goto yyerrlab; 738 | 739 | if (yyn == YYFINAL) 740 | YYACCEPT; 741 | 742 | /* Shift the lookahead token. */ 743 | 744 | #if YYDEBUG != 0 745 | if (yydebug) 746 | fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); 747 | #endif 748 | 749 | /* Discard the token being shifted unless it is eof. */ 750 | if (yychar != YYEOF) 751 | yychar = YYEMPTY; 752 | 753 | *++yyvsp = yylval; 754 | #ifdef YYLSP_NEEDED 755 | *++yylsp = yylloc; 756 | #endif 757 | 758 | /* count tokens shifted since error; after three, turn off error status. */ 759 | if (yyerrstatus) yyerrstatus--; 760 | 761 | yystate = yyn; 762 | goto yynewstate; 763 | 764 | /* Do the default action for the current state. */ 765 | yydefault: 766 | 767 | yyn = yydefact[yystate]; 768 | if (yyn == 0) 769 | goto yyerrlab; 770 | 771 | /* Do a reduction. yyn is the number of a rule to reduce with. */ 772 | yyreduce: 773 | yylen = yyr2[yyn]; 774 | if (yylen > 0) 775 | yyval = yyvsp[1-yylen]; /* implement default value of the action */ 776 | 777 | #if YYDEBUG != 0 778 | if (yydebug) 779 | { 780 | int i; 781 | 782 | fprintf (stderr, "Reducing via rule %d (line %d), ", 783 | yyn, yyrline[yyn]); 784 | 785 | /* Print the symbols being reduced, and their result. */ 786 | for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) 787 | fprintf (stderr, "%s ", yytname[yyrhs[i]]); 788 | fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); 789 | } 790 | #endif 791 | 792 | 793 | switch (yyn) { 794 | 795 | case 2: 796 | { er_yy_tracelog("parsed something\n"); ; 797 | break;} 798 | case 3: 799 | { 800 | MYABORT; 801 | ; 802 | break;} 803 | case 4: 804 | { 805 | lexerr_t *erst = ypar; 806 | strncpy(erst->path.name, yyvsp[0].text, 31); 807 | mycleanup(ypar); 808 | ; 809 | break;} 810 | case 5: 811 | { 812 | lexerr_t *erst = ypar; 813 | er_ret_t err; 814 | 815 | erst->path.active = 1; 816 | err=er_register_path(&(erst->path), erst->path.name); 817 | mycleanup(ypar); 818 | 819 | if( NOERR(err)) { 820 | adderr(erst, "created path "); 821 | adderr(erst, erst->path.name); 822 | 823 | } 824 | else { 825 | adderr(erst, "COULD NOT create path "); 826 | adderr(erst, erst->path.name); 827 | switch( err ) { 828 | case ER_DUPENT: 829 | adderr(erst, " - duplicate entry"); 830 | break; 831 | case ER_INSANE: 832 | adderr(erst, " - sanity check not passed"); 833 | break; 834 | } 835 | mycleanup(ypar); 836 | MYABORT; 837 | } 838 | ; 839 | break;} 840 | case 6: 841 | { 842 | lexerr_t *erst = ypar; 843 | 844 | if( NOERR(er_delete_path(yyvsp[0].text)) ) { 845 | adderr(erst, " path removed"); 846 | mycleanup(ypar); 847 | } 848 | else { 849 | adderr(erst, " COULD NOT remove path "); 850 | MYABORT; 851 | } 852 | 853 | ; 854 | break;} 855 | case 7: 856 | { 857 | lexerr_t *erst = ypar; 858 | 859 | erst->path.active = 1; 860 | if( NOERR(er_modify_path(&(erst->path), yyvsp[-1].text))) { 861 | adderr(erst, "modified path "); 862 | adderr(erst, yyvsp[-1].text); 863 | mycleanup(ypar); 864 | } 865 | else { 866 | adderr(erst, " COULD NOT modify path "); 867 | adderr(erst, yyvsp[-1].text); 868 | MYABORT; 869 | } 870 | ; 871 | break;} 872 | case 8: 873 | { 874 | lexerr_t *erst = ypar; 875 | 876 | if( NOERR(er_delete_filter(yyvsp[-2].text, (unsigned) yyvsp[0].inum))) { 877 | adderr(erst, "modified path "); 878 | adderr(erst, yyvsp[-2].text); 879 | mycleanup(ypar); 880 | } 881 | else { 882 | adderr(erst, " COULD NOT remove filter "); 883 | adderr(erst, "from path "); 884 | adderr(erst, yyvsp[-2].text); 885 | MYABORT; 886 | } 887 | 888 | ; 889 | break;} 890 | case 9: 891 | { 892 | lexerr_t *erst = ypar; 893 | 894 | if( NOERR(er_attach_filter_chain(yyvsp[-2].text, erst->path.filters ))) { 895 | adderr(erst, "modified path "); 896 | adderr(erst, yyvsp[-2].text); 897 | mycleanup(ypar); 898 | } 899 | else { 900 | adderr(erst, " COULD NOT attach filters to path "); 901 | adderr(erst, yyvsp[-2].text); 902 | MYABORT; 903 | } 904 | ; 905 | break;} 906 | case 10: 907 | { yyval.text = yyvsp[0].text; ; 908 | break;} 909 | case 11: 910 | { yyval.text = "AUTO"/* if AUTO then generate a new one */ ; 911 | break;} 912 | case 12: 913 | { 914 | er_yy_tracelog("set path"); 915 | ; 916 | break;} 917 | case 13: 918 | { ; 919 | break;} 920 | case 14: 921 | { ; 922 | break;} 923 | case 15: 924 | { ; 925 | break;} 926 | case 16: 927 | { lexerr_t *erst = ypar; 928 | adderr(erst, " - wrong PATH keyword"); 929 | MYABORT; ; 930 | break;} 931 | case 18: 932 | { lexerr_t *erst = ypar; 933 | adderr(erst, " - format spec missing"); 934 | MYABORT; ; 935 | break;} 936 | case 21: 937 | { 938 | lexerr_t *erst = ypar; 939 | int mod = er_getformatval(yyvsp[0].text); 940 | 941 | if( mod ) { 942 | erst->path.format |= mod; 943 | er_yy_tracelog("mode %s = 0x%x\n", yyvsp[0].text, mod); 944 | mycleanup(ypar); 945 | } else { 946 | adderr(erst, " incorrect mode specification: "); 947 | adderr(erst, yyvsp[0].text); 948 | mycleanup(ypar); 949 | MYABORT; 950 | } 951 | ; 952 | break;} 953 | case 22: 954 | { 955 | lexerr_t *erst = ypar; 956 | erst->path.type = ER_PATH_SOCK; 957 | erst->path.descr.sock.fd = yyvsp[0].inum; 958 | er_yy_tracelog("socket. Now check the associated socket\n"); 959 | ; 960 | break;} 961 | case 23: 962 | { 963 | lexerr_t *erst = ypar; 964 | erst->path.type = ER_PATH_NAME; 965 | er_yy_tracelog("namespec is %s\n", yyvsp[-1].text); 966 | strcpy(erst->path.descr.name.filename, yyvsp[-1].text); 967 | mycleanup(ypar); 968 | ; 969 | break;} 970 | case 24: 971 | { lexerr_t *erst = ypar; 972 | adderr(erst, " - filename missing"); 973 | MYABORT; ; 974 | break;} 975 | case 26: 976 | { 977 | lexerr_t *erst = ypar; 978 | erst->path.descr.name.date = 1; 979 | ; 980 | break;} 981 | case 27: 982 | { 983 | lexerr_t *erst = ypar; 984 | erst->path.type = ER_PATH_EXEC; 985 | ; 986 | break;} 987 | case 29: 988 | { 989 | lexerr_t *erst = ypar; 990 | erst->path.descr.exec.usepath = 1; 991 | ; 992 | break;} 993 | case 30: 994 | { /* first element */ 995 | lexerr_t *erst = ypar; 996 | er_add_exec_arg( &(erst->path), erst->token); 997 | mycleanup(ypar); 998 | ; 999 | break;} 1000 | case 31: 1001 | { /* next elements */ 1002 | lexerr_t *erst = ypar; 1003 | er_add_exec_arg( &(erst->path), erst->token); 1004 | mycleanup(ypar); 1005 | ; 1006 | break;} 1007 | case 34: 1008 | { er_yy_tracelog("one more filter done\n"); ; 1009 | break;} 1010 | case 35: 1011 | { 1012 | lexerr_t *erst = ypar; 1013 | /* add to list */ 1014 | er_add_filter( &erst->path, &(erst->curfilt)); 1015 | er_yy_tracelog("added a filter\n"); 1016 | memset( &(erst->curfilt), 0, sizeof(er_filter_t) ); 1017 | ; 1018 | break;} 1019 | case 36: 1020 | {; 1021 | break;} 1022 | case 37: 1023 | { lexerr_t *erst = ypar; 1024 | adderr(erst, " - bad filter spec"); 1025 | MYABORT; 1026 | ; 1027 | break;} 1028 | case 38: 1029 | {; 1030 | break;} 1031 | case 39: 1032 | {; 1033 | break;} 1034 | case 41: 1035 | {; 1036 | break;} 1037 | case 43: 1038 | { 1039 | lexerr_t *erst = ypar; 1040 | erst->curfilt.thr_id = pthread_self(); 1041 | ; 1042 | break;} 1043 | case 45: 1044 | { 1045 | er_yy_tracelog("added fac to mask\n"); 1046 | ; 1047 | break;} 1048 | case 46: 1049 | { 1050 | lexerr_t *erst = ypar; 1051 | erst->curfilt.fac_mask = er_getfacallmask(); 1052 | ; 1053 | break;} 1054 | case 47: 1055 | { 1056 | lexerr_t *erst = ypar; 1057 | er_ret_t ef = er_getfacval(yyvsp[0].text); 1058 | 1059 | if( ef ) { 1060 | MA_set( &(erst->curfilt.fac_mask), (unsigned) ef, 1); 1061 | er_yy_tracelog("fac %s = %x\n", yyvsp[0].text, ef); 1062 | mycleanup(ypar); 1063 | } else { 1064 | adderr(erst, " incorrect fac specification: "); 1065 | adderr(erst, yyvsp[0].text); 1066 | mycleanup(ypar); 1067 | MYABORT; 1068 | } 1069 | ; 1070 | break;} 1071 | case 50: 1072 | { 1073 | mysetsev(ypar, 0, "D") 1074 | ; 1075 | break;} 1076 | case 51: 1077 | { if( mysetsev(ypar, 0, yyvsp[0].text) == 0 ) { 1078 | MYABORT; 1079 | } 1080 | ; 1081 | break;} 1082 | case 52: 1083 | { 1084 | mysetsev(ypar, 1, "F") 1085 | ; 1086 | break;} 1087 | case 53: 1088 | { if( mysetsev(ypar, 1, yyvsp[0].text) == 0 ) { 1089 | MYABORT; 1090 | } 1091 | ; 1092 | break;} 1093 | case 54: 1094 | { 1095 | char *cp = strdup(yyvsp[0].text); 1096 | if( mysetsev(ypar, 0, yyvsp[0].text) != 0 ) { 1097 | mysetsev(ypar, 1, cp); 1098 | mycleanup(ypar); 1099 | } 1100 | else { 1101 | free(cp); 1102 | MYABORT; 1103 | } 1104 | ; 1105 | break;} 1106 | case 56: 1107 | { 1108 | er_yy_tracelog("added onefac\n"); 1109 | ; 1110 | break;} 1111 | case 57: 1112 | { lexerr_t *erst = ypar; 1113 | er_mask_t em = er_getaspval(yyvsp[0].text); 1114 | 1115 | if(em != 0) { 1116 | erst->curfilt.asp_mask |= em; 1117 | er_yy_tracelog("asp %s = %x\n", yyvsp[0].text, em); 1118 | mycleanup(ypar); 1119 | } 1120 | else { 1121 | adderr(erst, " incorrect asp specification: "); 1122 | adderr(erst, yyvsp[0].text); 1123 | mycleanup(ypar); 1124 | MYABORT; 1125 | } 1126 | ; 1127 | break;} 1128 | case 58: 1129 | { 1130 | lexerr_t *erst = ypar; 1131 | erst->curfilt.asp_mask |= yyvsp[0].inum; 1132 | mycleanup(ypar); 1133 | ; 1134 | break;} 1135 | } 1136 | /* the action file gets copied in in place of this dollarsign */ 1137 | 1138 | 1139 | yyvsp -= yylen; 1140 | yyssp -= yylen; 1141 | #ifdef YYLSP_NEEDED 1142 | yylsp -= yylen; 1143 | #endif 1144 | 1145 | #if YYDEBUG != 0 1146 | if (yydebug) 1147 | { 1148 | short *ssp1 = yyss - 1; 1149 | fprintf (stderr, "state stack now"); 1150 | while (ssp1 != yyssp) 1151 | fprintf (stderr, " %d", *++ssp1); 1152 | fprintf (stderr, "\n"); 1153 | } 1154 | #endif 1155 | 1156 | *++yyvsp = yyval; 1157 | 1158 | #ifdef YYLSP_NEEDED 1159 | yylsp++; 1160 | if (yylen == 0) 1161 | { 1162 | yylsp->first_line = yylloc.first_line; 1163 | yylsp->first_column = yylloc.first_column; 1164 | yylsp->last_line = (yylsp-1)->last_line; 1165 | yylsp->last_column = (yylsp-1)->last_column; 1166 | yylsp->text = 0; 1167 | } 1168 | else 1169 | { 1170 | yylsp->last_line = (yylsp+yylen-1)->last_line; 1171 | yylsp->last_column = (yylsp+yylen-1)->last_column; 1172 | } 1173 | #endif 1174 | 1175 | /* Now "shift" the result of the reduction. 1176 | Determine what state that goes to, 1177 | based on the state we popped back to 1178 | and the rule number reduced by. */ 1179 | 1180 | yyn = yyr1[yyn]; 1181 | 1182 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; 1183 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1184 | yystate = yytable[yystate]; 1185 | else 1186 | yystate = yydefgoto[yyn - YYNTBASE]; 1187 | 1188 | goto yynewstate; 1189 | 1190 | yyerrlab: /* here on detecting error */ 1191 | 1192 | if (! yyerrstatus) 1193 | /* If not already recovering from an error, report this error. */ 1194 | { 1195 | ++yynerrs; 1196 | 1197 | #ifdef YYERROR_VERBOSE 1198 | yyn = yypact[yystate]; 1199 | 1200 | if (yyn > YYFLAG && yyn < YYLAST) 1201 | { 1202 | int size = 0; 1203 | char *msg; 1204 | int x, count; 1205 | 1206 | count = 0; 1207 | /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ 1208 | for (x = (yyn < 0 ? -yyn : 0); 1209 | x < (sizeof(yytname) / sizeof(char *)); x++) 1210 | if (yycheck[x + yyn] == x) 1211 | size += strlen(yytname[x]) + 15, count++; 1212 | msg = (char *) malloc(size + 15); 1213 | if (msg != 0) 1214 | { 1215 | strcpy(msg, "parse error"); 1216 | 1217 | if (count < 5) 1218 | { 1219 | count = 0; 1220 | for (x = (yyn < 0 ? -yyn : 0); 1221 | x < (sizeof(yytname) / sizeof(char *)); x++) 1222 | if (yycheck[x + yyn] == x) 1223 | { 1224 | strcat(msg, count == 0 ? ", expecting `" : " or `"); 1225 | strcat(msg, yytname[x]); 1226 | strcat(msg, "'"); 1227 | count++; 1228 | } 1229 | } 1230 | yyerror(msg); 1231 | free(msg); 1232 | } 1233 | else 1234 | yyerror ("parse error; also virtual memory exceeded"); 1235 | } 1236 | else 1237 | #endif /* YYERROR_VERBOSE */ 1238 | yyerror("parse error"); 1239 | } 1240 | 1241 | goto yyerrlab1; 1242 | yyerrlab1: /* here on error raised explicitly by an action */ 1243 | 1244 | if (yyerrstatus == 3) 1245 | { 1246 | /* if just tried and failed to reuse lookahead token after an error, discard it. */ 1247 | 1248 | /* return failure if at end of input */ 1249 | if (yychar == YYEOF) 1250 | YYABORT; 1251 | 1252 | #if YYDEBUG != 0 1253 | if (yydebug) 1254 | fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); 1255 | #endif 1256 | 1257 | yychar = YYEMPTY; 1258 | } 1259 | 1260 | /* Else will try to reuse lookahead token 1261 | after shifting the error token. */ 1262 | 1263 | yyerrstatus = 3; /* Each real token shifted decrements this */ 1264 | 1265 | goto yyerrhandle; 1266 | 1267 | yyerrdefault: /* current state does not do anything special for the error token. */ 1268 | 1269 | #if 0 1270 | /* This is wrong; only states that explicitly want error tokens 1271 | should shift them. */ 1272 | yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ 1273 | if (yyn) goto yydefault; 1274 | #endif 1275 | 1276 | yyerrpop: /* pop the current state because it cannot handle the error token */ 1277 | 1278 | if (yyssp == yyss) YYABORT; 1279 | yyvsp--; 1280 | yystate = *--yyssp; 1281 | #ifdef YYLSP_NEEDED 1282 | yylsp--; 1283 | #endif 1284 | 1285 | #if YYDEBUG != 0 1286 | if (yydebug) 1287 | { 1288 | short *ssp1 = yyss - 1; 1289 | fprintf (stderr, "Error: state stack now"); 1290 | while (ssp1 != yyssp) 1291 | fprintf (stderr, " %d", *++ssp1); 1292 | fprintf (stderr, "\n"); 1293 | } 1294 | #endif 1295 | 1296 | yyerrhandle: 1297 | 1298 | yyn = yypact[yystate]; 1299 | if (yyn == YYFLAG) 1300 | goto yyerrdefault; 1301 | 1302 | yyn += YYTERROR; 1303 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) 1304 | goto yyerrdefault; 1305 | 1306 | yyn = yytable[yyn]; 1307 | if (yyn < 0) 1308 | { 1309 | if (yyn == YYFLAG) 1310 | goto yyerrpop; 1311 | yyn = -yyn; 1312 | goto yyreduce; 1313 | } 1314 | else if (yyn == 0) 1315 | goto yyerrpop; 1316 | 1317 | if (yyn == YYFINAL) 1318 | YYACCEPT; 1319 | 1320 | #if YYDEBUG != 0 1321 | if (yydebug) 1322 | fprintf(stderr, "Shifting error token, "); 1323 | #endif 1324 | 1325 | *++yyvsp = yylval; 1326 | #ifdef YYLSP_NEEDED 1327 | *++yylsp = yylloc; 1328 | #endif 1329 | 1330 | yystate = yyn; 1331 | goto yynewstate; 1332 | 1333 | yyacceptlab: 1334 | /* YYACCEPT comes here. */ 1335 | if (yyfree_stacks) 1336 | { 1337 | free (yyss); 1338 | free (yyvs); 1339 | #ifdef YYLSP_NEEDED 1340 | free (yyls); 1341 | #endif 1342 | } 1343 | return 0; 1344 | 1345 | yyabortlab: 1346 | /* YYABORT comes here. */ 1347 | if (yyfree_stacks) 1348 | { 1349 | free (yyss); 1350 | free (yyvs); 1351 | #ifdef YYLSP_NEEDED 1352 | free (yyls); 1353 | #endif 1354 | } 1355 | return 1; 1356 | } 1357 | 1358 | 1359 | #include "er_yacc_helper.inc"