Changeset e35a65e in rtems-libbsd
- Timestamp:
- 05/24/15 03:11:01 (8 years ago)
- Branches:
- 4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
- Children:
- 1383c80
- Parents:
- 11ec988
- git-author:
- Chris Johns <chrisj@…> (05/24/15 03:11:01)
- git-committer:
- Chris Johns <chrisj@…> (05/26/15 23:40:30)
- Location:
- freebsd
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd/include/rpc/rpcb_prot.h
r11ec988 re35a65e 5 5 6 6 #ifndef _RPCB_PROT_H_RPCGEN 7 #define 7 #define _RPCB_PROT_H_RPCGEN 8 8 9 9 #include <rpc/rpc.h> 10 11 10 12 11 #ifdef __cplusplus … … 276 275 */ 277 276 278 #define 279 #define 280 #define 281 #define 282 #define 283 #define 284 #define 285 #define 277 #define rpcb_highproc_2 RPCBPROC_CALLIT 278 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 279 #define rpcb_highproc_4 RPCBPROC_GETSTAT 280 #define RPCBSTAT_HIGHPROC 13 281 #define RPCBVERS_STAT 3 282 #define RPCBVERS_4_STAT 2 283 #define RPCBVERS_3_STAT 1 284 #define RPCBVERS_2_STAT 0 286 285 287 286 /* Link list of all the stats about getport and getaddr */ … … 491 490 #endif /* ndef _KERNEL */ 492 491 493 #define RPCBPROG 100000494 #define RPCBVERS 3495 496 #if defined(__STDC__) || defined(__cplusplus) 497 #define RPCBPROC_SET 1492 #define RPCBPROG ((unsigned long)(100000)) 493 #define RPCBVERS ((unsigned long)(3)) 494 495 extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp); 496 #define RPCBPROC_SET ((unsigned long)(1)) 498 497 extern bool_t * rpcbproc_set_3(rpcb *, CLIENT *); 499 498 extern bool_t * rpcbproc_set_3_svc(rpcb *, struct svc_req *); 500 #define RPCBPROC_UNSET 2499 #define RPCBPROC_UNSET ((unsigned long)(2)) 501 500 extern bool_t * rpcbproc_unset_3(rpcb *, CLIENT *); 502 501 extern bool_t * rpcbproc_unset_3_svc(rpcb *, struct svc_req *); 503 #define RPCBPROC_GETADDR 3502 #define RPCBPROC_GETADDR ((unsigned long)(3)) 504 503 extern char ** rpcbproc_getaddr_3(rpcb *, CLIENT *); 505 504 extern char ** rpcbproc_getaddr_3_svc(rpcb *, struct svc_req *); 506 #define RPCBPROC_DUMP 4505 #define RPCBPROC_DUMP ((unsigned long)(4)) 507 506 extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *); 508 507 extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *); 509 #define RPCBPROC_CALLIT 5508 #define RPCBPROC_CALLIT ((unsigned long)(5)) 510 509 extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *); 511 510 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *); 512 #define RPCBPROC_GETTIME 6511 #define RPCBPROC_GETTIME ((unsigned long)(6)) 513 512 extern u_int * rpcbproc_gettime_3(void *, CLIENT *); 514 513 extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *); 515 #define RPCBPROC_UADDR2TADDR 7514 #define RPCBPROC_UADDR2TADDR ((unsigned long)(7)) 516 515 extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *); 517 516 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *); 518 #define RPCBPROC_TADDR2UADDR 8517 #define RPCBPROC_TADDR2UADDR ((unsigned long)(8)) 519 518 extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *); 520 519 extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *); 521 extern int rpcbprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t); 522 523 #else /* K&R C */ 524 #define RPCBPROC_SET 1 525 extern bool_t * rpcbproc_set_3(); 526 extern bool_t * rpcbproc_set_3_svc(); 527 #define RPCBPROC_UNSET 2 528 extern bool_t * rpcbproc_unset_3(); 529 extern bool_t * rpcbproc_unset_3_svc(); 530 #define RPCBPROC_GETADDR 3 531 extern char ** rpcbproc_getaddr_3(); 532 extern char ** rpcbproc_getaddr_3_svc(); 533 #define RPCBPROC_DUMP 4 534 extern rpcblist_ptr * rpcbproc_dump_3(); 535 extern rpcblist_ptr * rpcbproc_dump_3_svc(); 536 #define RPCBPROC_CALLIT 5 537 extern rpcb_rmtcallres * rpcbproc_callit_3(); 538 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(); 539 #define RPCBPROC_GETTIME 6 540 extern u_int * rpcbproc_gettime_3(); 541 extern u_int * rpcbproc_gettime_3_svc(); 542 #define RPCBPROC_UADDR2TADDR 7 543 extern struct netbuf * rpcbproc_uaddr2taddr_3(); 544 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(); 545 #define RPCBPROC_TADDR2UADDR 8 546 extern char ** rpcbproc_taddr2uaddr_3(); 547 extern char ** rpcbproc_taddr2uaddr_3_svc(); 548 extern int rpcbprog_3_freeresult (); 549 #endif /* K&R C */ 550 #define RPCBVERS4 4 551 552 #if defined(__STDC__) || defined(__cplusplus) 520 extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 521 #define RPCBVERS4 ((unsigned long)(4)) 522 523 extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp); 553 524 extern bool_t * rpcbproc_set_4(rpcb *, CLIENT *); 554 525 extern bool_t * rpcbproc_set_4_svc(rpcb *, struct svc_req *); … … 559 530 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *); 560 531 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *); 561 #define RPCBPROC_BCAST RPCBPROC_CALLIT532 #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT)) 562 533 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *); 563 534 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *); … … 568 539 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *); 569 540 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *); 570 #define RPCBPROC_GETVERSADDR 9541 #define RPCBPROC_GETVERSADDR ((unsigned long)(9)) 571 542 extern char ** rpcbproc_getversaddr_4(rpcb *, CLIENT *); 572 543 extern char ** rpcbproc_getversaddr_4_svc(rpcb *, struct svc_req *); 573 #define RPCBPROC_INDIRECT 10544 #define RPCBPROC_INDIRECT ((unsigned long)(10)) 574 545 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *); 575 546 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *); 576 #define RPCBPROC_GETADDRLIST 11547 #define RPCBPROC_GETADDRLIST ((unsigned long)(11)) 577 548 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(rpcb *, CLIENT *); 578 549 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(rpcb *, struct svc_req *); 579 #define RPCBPROC_GETSTAT 12550 #define RPCBPROC_GETSTAT ((unsigned long)(12)) 580 551 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *); 581 552 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *); 582 extern int rpcbprog_4_freeresult (SVCXPRT *, xdrproc_t, caddr_t); 583 584 #else /* K&R C */ 585 extern bool_t * rpcbproc_set_4(); 586 extern bool_t * rpcbproc_set_4_svc(); 587 extern bool_t * rpcbproc_unset_4(); 588 extern bool_t * rpcbproc_unset_4_svc(); 589 extern char ** rpcbproc_getaddr_4(); 590 extern char ** rpcbproc_getaddr_4_svc(); 591 extern rpcblist_ptr * rpcbproc_dump_4(); 592 extern rpcblist_ptr * rpcbproc_dump_4_svc(); 593 #define RPCBPROC_BCAST RPCBPROC_CALLIT 594 extern rpcb_rmtcallres * rpcbproc_bcast_4(); 595 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(); 596 extern u_int * rpcbproc_gettime_4(); 597 extern u_int * rpcbproc_gettime_4_svc(); 598 extern struct netbuf * rpcbproc_uaddr2taddr_4(); 599 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(); 600 extern char ** rpcbproc_taddr2uaddr_4(); 601 extern char ** rpcbproc_taddr2uaddr_4_svc(); 602 #define RPCBPROC_GETVERSADDR 9 603 extern char ** rpcbproc_getversaddr_4(); 604 extern char ** rpcbproc_getversaddr_4_svc(); 605 #define RPCBPROC_INDIRECT 10 606 extern rpcb_rmtcallres * rpcbproc_indirect_4(); 607 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(); 608 #define RPCBPROC_GETADDRLIST 11 609 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(); 610 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(); 611 #define RPCBPROC_GETSTAT 12 612 extern rpcb_stat * rpcbproc_getstat_4(); 613 extern rpcb_stat * rpcbproc_getstat_4_svc(); 614 extern int rpcbprog_4_freeresult (); 615 #endif /* K&R C */ 553 extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 616 554 617 555 /* the xdr functions */ 618 619 #if defined(__STDC__) || defined(__cplusplus) 620 extern bool_t xdr_rpcb (XDR *, rpcb*); 621 extern bool_t xdr_rp__list (XDR *, rp__list*); 622 extern bool_t xdr_rpcblist_ptr (XDR *, rpcblist_ptr*); 623 extern bool_t xdr_rpcb_rmtcallargs (XDR *, rpcb_rmtcallargs*); 624 extern bool_t xdr_rpcb_rmtcallres (XDR *, rpcb_rmtcallres*); 625 extern bool_t xdr_rpcb_entry (XDR *, rpcb_entry*); 626 extern bool_t xdr_rpcb_entry_list (XDR *, rpcb_entry_list*); 627 extern bool_t xdr_rpcb_entry_list_ptr (XDR *, rpcb_entry_list_ptr*); 628 extern bool_t xdr_rpcbs_addrlist (XDR *, rpcbs_addrlist*); 629 extern bool_t xdr_rpcbs_rmtcalllist (XDR *, rpcbs_rmtcalllist*); 630 extern bool_t xdr_rpcbs_proc (XDR *, rpcbs_proc); 631 extern bool_t xdr_rpcbs_addrlist_ptr (XDR *, rpcbs_addrlist_ptr*); 632 extern bool_t xdr_rpcbs_rmtcalllist_ptr (XDR *, rpcbs_rmtcalllist_ptr*); 633 extern bool_t xdr_rpcb_stat (XDR *, rpcb_stat*); 634 extern bool_t xdr_rpcb_stat_byvers (XDR *, rpcb_stat_byvers); 635 636 #else /* K&R C */ 637 extern bool_t xdr_rpcb (); 638 extern bool_t xdr_rp__list (); 639 extern bool_t xdr_rpcblist_ptr (); 640 extern bool_t xdr_rpcb_rmtcallargs (); 641 extern bool_t xdr_rpcb_rmtcallres (); 642 extern bool_t xdr_rpcb_entry (); 643 extern bool_t xdr_rpcb_entry_list (); 644 extern bool_t xdr_rpcb_entry_list_ptr (); 645 extern bool_t xdr_rpcbs_addrlist (); 646 extern bool_t xdr_rpcbs_rmtcalllist (); 647 extern bool_t xdr_rpcbs_proc (); 648 extern bool_t xdr_rpcbs_addrlist_ptr (); 649 extern bool_t xdr_rpcbs_rmtcalllist_ptr (); 650 extern bool_t xdr_rpcb_stat (); 651 extern bool_t xdr_rpcb_stat_byvers (); 652 653 #endif /* K&R C */ 556 extern bool_t xdr_rpcb(XDR *, rpcb*); 557 extern bool_t xdr_rp__list(XDR *, rp__list*); 558 extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*); 559 extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*); 560 extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*); 561 extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*); 562 extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*); 563 extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*); 564 extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*); 565 extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*); 566 extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc); 567 extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*); 568 extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*); 569 extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*); 570 extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers); 654 571 655 572 #ifdef __cplusplus -
freebsd/lib/libc/net/nslexer.c
r11ec988 re35a65e 35 35 /* First, we deal with platform-specific or compiler-specific issues. */ 36 36 37 #if defined(__FreeBSD__) 38 #ifndef __STDC_LIMIT_MACROS 39 #define __STDC_LIMIT_MACROS 40 #endif 41 #include <sys/cdefs.h> 42 #include <stdint.h> 43 #else 44 #define __dead2 45 #endif 46 37 47 /* begin standard C headers. */ 38 48 #include <stdio.h> … … 50 60 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 51 61 52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 62 #if defined(__FreeBSD__) || \ 63 (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 53 64 54 65 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, … … 296 307 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 297 308 : NULL) 309 #define yy_current_buffer YY_CURRENT_BUFFER 298 310 299 311 /* Same as previous macro, but useful when we know that the buffer stack is not … … 371 383 typedef int yy_state_type; 372 384 373 #define YY_FLEX_LEX_COMPAT374 385 extern int _nsyylineno; 375 386 376 387 int _nsyylineno = 1; 377 388 378 extern char _nsyytext[]; 389 extern char *_nsyytext; 390 #define yytext_ptr _nsyytext 379 391 380 392 static yy_state_type yy_get_previous_state (void ); 381 393 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 382 394 static int yy_get_next_buffer (void ); 383 static void yy_fatal_error (yyconst char msg[] ) ;395 static void yy_fatal_error (yyconst char msg[] ) __dead2; 384 396 385 397 /* Done after the current pattern has been matched and before the … … 391 403 (yy_hold_char) = *yy_cp; \ 392 404 *yy_cp = '\0'; \ 393 if ( _nsyyleng + (yy_more_offset) >= YYLMAX ) \394 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \395 yy_flex_strncpy( &_nsyytext[(yy_more_offset)], (yytext_ptr), _nsyyleng + 1 ); \396 _nsyyleng += (yy_more_offset); \397 (yy_prev_more_offset) = (yy_more_offset); \398 (yy_more_offset) = 0; \399 405 (yy_c_buf_p) = yy_cp; 400 406 … … 408 414 flex_int32_t yy_nxt; 409 415 }; 410 static yyconst flex_int16_t yy_acc list[83] =416 static yyconst flex_int16_t yy_accept[59] = 411 417 { 0, 412 14, 12, 13, 1, 12, 13, 4, 13, 2, 12, 413 13, 11, 12, 13, 11, 12, 13, 11, 12, 13, 414 11, 12, 13, 11, 12, 13, 11, 12, 13, 11, 415 12, 13, 12, 13, 1, 2, 11, 11, 11, 11, 416 11, 11, 11, 3, 11, 11, 11, 11, 11, 11, 418 0, 0, 14, 12, 1, 4, 2, 11, 11, 11, 419 11, 11, 11, 11, 12, 1, 2, 11, 11, 11, 420 11, 11, 11, 11, 3, 11, 11, 11, 11, 11, 417 421 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 418 11, 11, 11, 11, 9, 11, 11, 11, 11, 11, 419 11, 5, 11, 11, 6, 11, 10, 11, 7, 11, 420 8, 11 421 } ; 422 423 static yyconst flex_int16_t yy_accept[60] = 424 { 0, 425 1, 1, 1, 2, 4, 7, 9, 12, 15, 18, 426 21, 24, 27, 30, 33, 35, 36, 37, 38, 39, 427 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 428 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 429 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 430 71, 72, 74, 75, 77, 79, 81, 83, 83 422 11, 11, 11, 11, 11, 9, 11, 11, 11, 11, 423 11, 5, 11, 6, 10, 7, 8, 0 431 424 } ; 432 425 … … 525 518 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; 526 519 520 static yy_state_type yy_last_accepting_state; 521 static char *yy_last_accepting_cpos; 522 527 523 extern int _nsyy_flex_debug; 528 524 int _nsyy_flex_debug = 0; 529 525 530 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; 531 static char *yy_full_match; 532 static int yy_lp; 533 #define REJECT \ 534 { \ 535 *yy_cp = (yy_hold_char); /* undo effects of setting up _nsyytext */ \ 536 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ 537 ++(yy_lp); \ 538 goto find_rule; \ 539 } 540 541 static int yy_more_offset = 0; 542 static int yy_prev_more_offset = 0; 543 #define yymore() ((yy_more_offset) = yy_flex_strlen( _nsyytext )) 544 #define YY_NEED_STRLEN 526 /* The intent behind this definition is that it'll catch 527 * any uses of REJECT which flex missed. 528 */ 529 #define REJECT reject_used_but_not_detected 530 #define yymore() yymore_used_but_not_detected 545 531 #define YY_MORE_ADJ 0 546 #define YY_RESTORE_YY_MORE_OFFSET \ 547 { \ 548 (yy_more_offset) = (yy_prev_more_offset); \ 549 _nsyyleng -= (yy_more_offset); \ 550 } 551 #ifndef YYLMAX 552 #define YYLMAX 8192 553 #endif 554 555 char _nsyytext[YYLMAX]; 556 char *yytext_ptr; 557 #line 1 "freebsd/lib/libc/net/nslexer.l" 558 #line 2 "freebsd/lib/libc/net/nslexer.l" 532 #define YY_RESTORE_YY_MORE_OFFSET 533 char *_nsyytext; 534 #line 1 "../../freebsd/lib/libc/net/nslexer.l" 535 #line 2 "../../freebsd/lib/libc/net/nslexer.l" 559 536 /* $NetBSD: nslexer.l,v 1.3 1999/01/25 00:16:17 lukem Exp $ */ 560 537 … … 612 589 613 590 #define YY_NO_INPUT 1 614 #line 615"<stdout>"591 #line 592 "<stdout>" 615 592 616 593 #define INITIAL 0 … … 788 765 YY_DECL 789 766 { 790 registeryy_state_type yy_current_state;791 registerchar *yy_cp, *yy_bp;792 registerint yy_act;767 yy_state_type yy_current_state; 768 char *yy_cp, *yy_bp; 769 int yy_act; 793 770 794 #line 66 " freebsd/lib/libc/net/nslexer.l"795 796 797 #line 7 98"<stdout>"771 #line 66 "../../freebsd/lib/libc/net/nslexer.l" 772 773 774 #line 775 "<stdout>" 798 775 799 776 if ( !(yy_init) ) … … 804 781 YY_USER_INIT; 805 782 #endif 806 807 /* Create the reject buffer large enough to save one state per allowed character. */808 if ( ! (yy_state_buf) )809 (yy_state_buf) = (yy_state_type *)_nsyyalloc(YY_STATE_BUF_SIZE );810 if ( ! (yy_state_buf) )811 YY_FATAL_ERROR( "out of dynamic memory in _nsyylex()" );812 783 813 784 if ( ! (yy_start) ) … … 842 813 843 814 yy_current_state = (yy_start); 844 845 (yy_state_ptr) = (yy_state_buf);846 *(yy_state_ptr)++ = yy_current_state;847 848 815 yy_match: 849 816 do 850 817 { 851 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 818 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 819 if ( yy_accept[yy_current_state] ) 820 { 821 (yy_last_accepting_state) = yy_current_state; 822 (yy_last_accepting_cpos) = yy_cp; 823 } 852 824 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 853 825 { … … 857 829 } 858 830 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 859 *(yy_state_ptr)++ = yy_current_state;860 831 ++yy_cp; 861 832 } … … 863 834 864 835 yy_find_action: 865 yy_current_state = *--(yy_state_ptr); 866 (yy_lp) = yy_accept[yy_current_state]; 867 find_rule: /* we branch to this label when backing up */ 868 for ( ; ; ) /* until we find what rule we matched */ 869 { 870 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) 871 { 872 yy_act = yy_acclist[(yy_lp)]; 873 { 874 (yy_full_match) = yy_cp; 875 break; 876 } 877 } 878 --yy_cp; 879 yy_current_state = *--(yy_state_ptr); 880 (yy_lp) = yy_accept[yy_current_state]; 836 yy_act = yy_accept[yy_current_state]; 837 if ( yy_act == 0 ) 838 { /* have to back up */ 839 yy_cp = (yy_last_accepting_cpos); 840 yy_current_state = (yy_last_accepting_state); 841 yy_act = yy_accept[yy_current_state]; 881 842 } 882 843 … … 885 846 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) 886 847 { 887 int yyl;888 for ( yyl = (yy_prev_more_offset); yyl < _nsyyleng; ++yyl )848 yy_size_t yyl; 849 for ( yyl = 0; yyl < _nsyyleng; ++yyl ) 889 850 if ( _nsyytext[yyl] == '\n' ) 890 851 … … 897 858 switch ( yy_act ) 898 859 { /* beginning of action switch */ 860 case 0: /* must back up */ 861 /* undo the effects of YY_DO_BEFORE_ACTION */ 862 *yy_cp = (yy_hold_char); 863 yy_cp = (yy_last_accepting_cpos); 864 yy_current_state = (yy_last_accepting_state); 865 goto yy_find_action; 866 899 867 case 1: 900 868 YY_RULE_SETUP 901 #line 68 " freebsd/lib/libc/net/nslexer.l"869 #line 68 "../../freebsd/lib/libc/net/nslexer.l" 902 870 ; /* skip whitespace */ 903 871 YY_BREAK 904 872 case 2: 905 873 YY_RULE_SETUP 906 #line 70 " freebsd/lib/libc/net/nslexer.l"874 #line 70 "../../freebsd/lib/libc/net/nslexer.l" 907 875 ; /* skip comments */ 908 876 YY_BREAK … … 910 878 /* rule 3 can match eol */ 911 879 YY_RULE_SETUP 912 #line 72 " freebsd/lib/libc/net/nslexer.l"880 #line 72 "../../freebsd/lib/libc/net/nslexer.l" 913 881 ; /* allow continuation */ 914 882 YY_BREAK … … 916 884 /* rule 4 can match eol */ 917 885 YY_RULE_SETUP 918 #line 74 " freebsd/lib/libc/net/nslexer.l"886 #line 74 "../../freebsd/lib/libc/net/nslexer.l" 919 887 return NL; 920 888 YY_BREAK 921 889 case 5: 922 890 YY_RULE_SETUP 923 #line 76 " freebsd/lib/libc/net/nslexer.l"891 #line 76 "../../freebsd/lib/libc/net/nslexer.l" 924 892 return SUCCESS; 925 893 YY_BREAK 926 894 case 6: 927 895 YY_RULE_SETUP 928 #line 77 " freebsd/lib/libc/net/nslexer.l"896 #line 77 "../../freebsd/lib/libc/net/nslexer.l" 929 897 return UNAVAIL; 930 898 YY_BREAK 931 899 case 7: 932 900 YY_RULE_SETUP 933 #line 78 " freebsd/lib/libc/net/nslexer.l"901 #line 78 "../../freebsd/lib/libc/net/nslexer.l" 934 902 return NOTFOUND; 935 903 YY_BREAK 936 904 case 8: 937 905 YY_RULE_SETUP 938 #line 79 " freebsd/lib/libc/net/nslexer.l"906 #line 79 "../../freebsd/lib/libc/net/nslexer.l" 939 907 return TRYAGAIN; 940 908 YY_BREAK 941 909 case 9: 942 910 YY_RULE_SETUP 943 #line 81 " freebsd/lib/libc/net/nslexer.l"911 #line 81 "../../freebsd/lib/libc/net/nslexer.l" 944 912 return RETURN; 945 913 YY_BREAK 946 914 case 10: 947 915 YY_RULE_SETUP 948 #line 82 " freebsd/lib/libc/net/nslexer.l"916 #line 82 "../../freebsd/lib/libc/net/nslexer.l" 949 917 return CONTINUE; 950 918 YY_BREAK 951 919 case 11: 952 920 YY_RULE_SETUP 953 #line 84 " freebsd/lib/libc/net/nslexer.l"921 #line 84 "../../freebsd/lib/libc/net/nslexer.l" 954 922 { 955 923 char *p; … … 971 939 case 12: 972 940 YY_RULE_SETUP 973 #line 101 " freebsd/lib/libc/net/nslexer.l"941 #line 101 "../../freebsd/lib/libc/net/nslexer.l" 974 942 return _nsyytext[0]; 975 943 YY_BREAK 976 944 case 13: 977 945 YY_RULE_SETUP 978 #line 103 " freebsd/lib/libc/net/nslexer.l"946 #line 103 "../../freebsd/lib/libc/net/nslexer.l" 979 947 ECHO; 980 948 YY_BREAK 981 #line 9 82"<stdout>"982 983 949 #line 950 "<stdout>" 950 case YY_STATE_EOF(INITIAL): 951 yyterminate(); 984 952 985 953 case YY_END_OF_BUFFER: … … 1121 1089 static int yy_get_next_buffer (void) 1122 1090 { 1123 registerchar *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;1124 registerchar *source = (yytext_ptr);1125 registerint number_to_move, i;1091 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1092 char *source = (yytext_ptr); 1093 int number_to_move, i; 1126 1094 int ret_val; 1127 1095 … … 1171 1139 { /* Not enough room in the buffer - grow it. */ 1172 1140 1173 YY_FATAL_ERROR( 1174 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 1141 /* just a shorter name for the current buffer */ 1142 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 1143 1144 int yy_c_buf_p_offset = 1145 (int) ((yy_c_buf_p) - b->yy_ch_buf); 1146 1147 if ( b->yy_is_our_buffer ) 1148 { 1149 yy_size_t new_size = b->yy_buf_size * 2; 1150 1151 if ( new_size <= 0 ) 1152 b->yy_buf_size += b->yy_buf_size / 8; 1153 else 1154 b->yy_buf_size *= 2; 1155 1156 b->yy_ch_buf = (char *) 1157 /* Include room in for 2 EOB chars. */ 1158 _nsyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1159 } 1160 else 1161 /* Can't grow it, we don't own it. */ 1162 b->yy_ch_buf = 0; 1163 1164 if ( ! b->yy_ch_buf ) 1165 YY_FATAL_ERROR( 1166 "fatal error - scanner input buffer overflow" ); 1167 1168 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1169 1170 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1171 number_to_move - 1; 1175 1172 1176 1173 } … … 1226 1223 static yy_state_type yy_get_previous_state (void) 1227 1224 { 1228 registeryy_state_type yy_current_state;1229 registerchar *yy_cp;1225 yy_state_type yy_current_state; 1226 char *yy_cp; 1230 1227 1231 1228 yy_current_state = (yy_start); 1232 1229 1233 (yy_state_ptr) = (yy_state_buf);1234 *(yy_state_ptr)++ = yy_current_state;1235 1236 1230 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1237 1231 { 1238 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1232 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1233 if ( yy_accept[yy_current_state] ) 1234 { 1235 (yy_last_accepting_state) = yy_current_state; 1236 (yy_last_accepting_cpos) = yy_cp; 1237 } 1239 1238 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1240 1239 { … … 1244 1243 } 1245 1244 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1246 *(yy_state_ptr)++ = yy_current_state;1247 1245 } 1248 1246 … … 1257 1255 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1258 1256 { 1259 register int yy_is_jam; 1260 1261 register YY_CHAR yy_c = 1; 1257 int yy_is_jam; 1258 char *yy_cp = (yy_c_buf_p); 1259 1260 YY_CHAR yy_c = 1; 1261 if ( yy_accept[yy_current_state] ) 1262 { 1263 (yy_last_accepting_state) = yy_current_state; 1264 (yy_last_accepting_cpos) = yy_cp; 1265 } 1262 1266 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1263 1267 { … … 1268 1272 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1269 1273 yy_is_jam = (yy_current_state == 58); 1270 if ( ! yy_is_jam )1271 *(yy_state_ptr)++ = yy_current_state;1272 1274 1273 1275 return yy_is_jam ? 0 : yy_current_state; … … 1677 1679 char *buf; 1678 1680 yy_size_t n; 1679 int i;1681 yy_size_t i; 1680 1682 1681 1683 /* Get memory for full buffer, including space for trailing EOB's. */ … … 1825 1827 (yy_start) = 0; 1826 1828 1827 (yy_state_buf) = 0;1828 (yy_state_ptr) = 0;1829 (yy_full_match) = 0;1830 (yy_lp) = 0;1831 1832 1829 /* Defined in main.c */ 1833 1830 #ifdef YY_STDINIT … … 1860 1857 (yy_buffer_stack) = NULL; 1861 1858 1862 _nsyyfree ( (yy_state_buf) );1863 (yy_state_buf) = NULL;1864 1865 1859 /* Reset the globals. This is important in a non-reentrant scanner so the next time 1866 1860 * _nsyylex() is called, initialization will occur. */ … … 1877 1871 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 1878 1872 { 1879 registerint i;1873 int i; 1880 1874 for ( i = 0; i < n; ++i ) 1881 1875 s1[i] = s2[i]; … … 1886 1880 static int yy_flex_strlen (yyconst char * s ) 1887 1881 { 1888 registerint n;1882 int n; 1889 1883 for ( n = 0; s[n]; ++n ) 1890 1884 ; … … 1918 1912 #define YYTABLES_NAME "yytables" 1919 1913 1920 #line 103 " freebsd/lib/libc/net/nslexer.l"1914 #line 103 "../../freebsd/lib/libc/net/nslexer.l" 1921 1915 1922 1916 -
freebsd/lib/libc/net/nsparser.c
r11ec988 re35a65e 1 /* A Bison parser, made by GNU Bison 2.7. */ 2 3 /* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 20 /* As a special exception, you may create a larger work that contains 21 part or all of the Bison parser skeleton and distribute that work 22 under terms of your choice, so long as that work isn't itself a 23 parser generator using the skeleton or a modified version thereof 24 as a parser skeleton. Alternatively, if you modify or redistribute 25 the parser skeleton itself, you may (at your option) remove this 26 special exception, which will cause the skeleton and the resulting 27 Bison output files to be licensed under the GNU General Public 28 License without this special exception. 29 30 This special exception was added by the Free Software Foundation in 31 version 2.2 of Bison. */ 32 33 /* C LALR(1) parser skeleton written by Richard Stallman, by 34 simplifying the original so-called "semantic" parser. */ 35 36 /* All symbols defined below should begin with yy or YY, to avoid 37 infringing on user name space. This should be done even for local 38 variables, as they might otherwise be expanded by user macros. 39 There are some unavoidable exceptions within include files to 40 define necessary library symbols; they are noted "INFRINGES ON 41 USER NAME SPACE" below. */ 42 43 /* Identify Bison output. */ 44 #define YYBISON 1 45 46 /* Bison version. */ 47 #define YYBISON_VERSION "2.7" 48 49 /* Skeleton name. */ 50 #define YYSKELETON_NAME "yacc.c" 51 52 /* Pure parsers. */ 1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 9 #define YYEMPTY (-1) 10 #define yyclearin (yychar = YYEMPTY) 11 #define yyerrok (yyerrflag = 0) 12 #define YYRECOVERING() (yyerrflag != 0) 13 #define YYENOMEM (-2) 14 #define YYEOF 0 15 16 #ifndef yyparse 17 #define yyparse _nsyyparse 18 #endif /* yyparse */ 19 20 #ifndef yylex 21 #define yylex _nsyylex 22 #endif /* yylex */ 23 24 #ifndef yyerror 25 #define yyerror _nsyyerror 26 #endif /* yyerror */ 27 28 #ifndef yychar 29 #define yychar _nsyychar 30 #endif /* yychar */ 31 32 #ifndef yyval 33 #define yyval _nsyyval 34 #endif /* yyval */ 35 36 #ifndef yylval 37 #define yylval _nsyylval 38 #endif /* yylval */ 39 40 #ifndef yydebug 41 #define yydebug _nsyydebug 42 #endif /* yydebug */ 43 44 #ifndef yynerrs 45 #define yynerrs _nsyynerrs 46 #endif /* yynerrs */ 47 48 #ifndef yyerrflag 49 #define yyerrflag _nsyyerrflag 50 #endif /* yyerrflag */ 51 52 #ifndef yylhs 53 #define yylhs _nsyylhs 54 #endif /* yylhs */ 55 56 #ifndef yylen 57 #define yylen _nsyylen 58 #endif /* yylen */ 59 60 #ifndef yydefred 61 #define yydefred _nsyydefred 62 #endif /* yydefred */ 63 64 #ifndef yydgoto 65 #define yydgoto _nsyydgoto 66 #endif /* yydgoto */ 67 68 #ifndef yysindex 69 #define yysindex _nsyysindex 70 #endif /* yysindex */ 71 72 #ifndef yyrindex 73 #define yyrindex _nsyyrindex 74 #endif /* yyrindex */ 75 76 #ifndef yygindex 77 #define yygindex _nsyygindex 78 #endif /* yygindex */ 79 80 #ifndef yytable 81 #define yytable _nsyytable 82 #endif /* yytable */ 83 84 #ifndef yycheck 85 #define yycheck _nsyycheck 86 #endif /* yycheck */ 87 88 #ifndef yyname 89 #define yyname _nsyyname 90 #endif /* yyname */ 91 92 #ifndef yyrule 93 #define yyrule _nsyyrule 94 #endif /* yyrule */ 95 #define YYPREFIX "_nsyy" 96 53 97 #define YYPURE 0 54 98 55 /* Push parsers. */ 56 #define YYPUSH 0 57 58 /* Pull parsers. */ 59 #define YYPULL 1 60 61 62 /* Substitute the variable and function names. */ 63 #define yyparse _nsyyparse 64 #define yylex _nsyylex 65 #define yyerror _nsyyerror 66 #define yylval _nsyylval 67 #define yychar _nsyychar 68 #define yydebug _nsyydebug 69 #define yynerrs _nsyynerrs 70 71 /* Copy the first part of user declarations. */ 72 /* Line 371 of yacc.c */ 73 #line 1 "freebsd/lib/libc/net/nsparser.y" 74 99 #line 2 "../../freebsd/lib/libc/net/nsparser.y" 75 100 /* $NetBSD: nsparser.y,v 1.3 1999/01/25 00:16:18 lukem Exp $ */ 76 101 … … 127 152 static ns_dbt curdbt; 128 153 static ns_src cursrc; 129 130 /* Line 371 of yacc.c */ 131 #line 132 "_nsyy.tab.c" 132 133 # ifndef YY_NULL 134 # if defined __cplusplus && 201103L <= __cplusplus 135 # define YY_NULL nullptr 136 # else 137 # define YY_NULL 0 138 # endif 139 # endif 140 141 /* Enabling verbose error messages. */ 142 #ifdef YYERROR_VERBOSE 143 # undef YYERROR_VERBOSE 144 # define YYERROR_VERBOSE 1 145 #else 146 # define YYERROR_VERBOSE 0 147 #endif 148 149 /* In a future release of Bison, this section will be replaced 150 by #include "_nsyy.tab.h". */ 151 #ifndef YY__NSYY_NSYY_TAB_H_INCLUDED 152 # define YY__NSYY_NSYY_TAB_H_INCLUDED 153 /* Enabling traces. */ 154 #ifndef YYDEBUG 155 # define YYDEBUG 0 156 #endif 157 #if YYDEBUG 158 extern int _nsyydebug; 159 #endif 160 161 /* Tokens. */ 162 #ifndef YYTOKENTYPE 163 # define YYTOKENTYPE 164 /* Put the tokens into the symbol table, so that GDB and other debuggers 165 know about them. */ 166 enum yytokentype { 167 NL = 258, 168 SUCCESS = 259, 169 UNAVAIL = 260, 170 NOTFOUND = 261, 171 TRYAGAIN = 262, 172 RETURN = 263, 173 CONTINUE = 264, 174 ERRORTOKEN = 265, 175 STRING = 266 176 }; 177 #endif 178 /* Tokens. */ 179 #define NL 258 180 #define SUCCESS 259 181 #define UNAVAIL 260 182 #define NOTFOUND 261 183 #define TRYAGAIN 262 184 #define RETURN 263 185 #define CONTINUE 264 186 #define ERRORTOKEN 265 187 #define STRING 266 188 189 190 191 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 192 typedef union YYSTYPE 193 { 194 /* Line 387 of yacc.c */ 195 #line 58 "freebsd/lib/libc/net/nsparser.y" 196 154 #line 58 "../../freebsd/lib/libc/net/nsparser.y" 155 #ifdef YYSTYPE 156 #undef YYSTYPE_IS_DECLARED 157 #define YYSTYPE_IS_DECLARED 1 158 #endif 159 #ifndef YYSTYPE_IS_DECLARED 160 #define YYSTYPE_IS_DECLARED 1 161 typedef union { 197 162 char *str; 198 163 int mapval; 199 200 201 /* Line 387 of yacc.c */202 #line 203 "_nsyy.tab.c"203 164 } YYSTYPE; 204 # define YYSTYPE_IS_TRIVIAL 1 205 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 206 # define YYSTYPE_IS_DECLARED 1 207 #endif 208 209 extern YYSTYPE _nsyylval; 210 165 #endif /* !YYSTYPE_IS_DECLARED */ 166 #line 167 "_nsyy.tab.c" 167 168 /* compatibility with bison */ 211 169 #ifdef YYPARSE_PARAM 212 #if defined __STDC__ || defined __cplusplus 213 int _nsyyparse (void *YYPARSE_PARAM); 170 /* compatibility with FreeBSD */ 171 # ifdef YYPARSE_PARAM_TYPE 172 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 173 # else 174 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 175 # endif 214 176 #else 215 int _nsyyparse (); 216 #endif 217 #else /* ! YYPARSE_PARAM */ 218 #if defined __STDC__ || defined __cplusplus 219 int _nsyyparse (void); 177 # define YYPARSE_DECL() yyparse(void) 178 #endif 179 180 /* Parameters sent to lex. */ 181 #ifdef YYLEX_PARAM 182 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 183 # define YYLEX yylex(YYLEX_PARAM) 220 184 #else 221 int _nsyyparse (); 222 #endif 223 #endif /* ! YYPARSE_PARAM */ 224 225 #endif /* !YY__NSYY_NSYY_TAB_H_INCLUDED */ 226 227 /* Copy the second part of user declarations. */ 228 229 /* Line 390 of yacc.c */ 230 #line 231 "_nsyy.tab.c" 231 232 #ifdef short 233 # undef short 234 #endif 235 236 #ifdef YYTYPE_UINT8 237 typedef YYTYPE_UINT8 yytype_uint8; 185 # define YYLEX_DECL() yylex(void) 186 # define YYLEX yylex() 187 #endif 188 189 /* Parameters sent to yyerror. */ 190 #ifndef YYERROR_DECL 191 #define YYERROR_DECL() yyerror(const char *s) 192 #endif 193 #ifndef YYERROR_CALL 194 #define YYERROR_CALL(msg) yyerror(msg) 195 #endif 196 197 extern int YYPARSE_DECL(); 198 199 #define NL 257 200 #define SUCCESS 258 201 #define UNAVAIL 259 202 #define NOTFOUND 260 203 #define TRYAGAIN 261 204 #define RETURN 262 205 #define CONTINUE 263 206 #define ERRORTOKEN 264 207 #define STRING 265 208 #define YYERRCODE 256 209 typedef short YYINT; 210 static const YYINT _nsyylhs[] = { -1, 211 0, 0, 3, 3, 4, 4, 4, 4, 5, 6, 212 6, 7, 9, 7, 8, 8, 10, 1, 1, 1, 213 1, 2, 2, 214 }; 215 static const YYINT _nsyylen[] = { 2, 216 0, 1, 1, 2, 1, 3, 4, 2, 1, 1, 217 2, 1, 0, 5, 1, 2, 3, 1, 1, 1, 218 1, 1, 1, 219 }; 220 static const YYINT _nsyydefred[] = { 0, 221 0, 5, 9, 0, 0, 3, 0, 8, 4, 0, 222 6, 0, 0, 10, 13, 7, 11, 0, 18, 19, 223 20, 21, 0, 0, 15, 0, 14, 16, 22, 23, 224 17, 225 }; 226 static const YYINT _nsyydgoto[] = { 4, 227 23, 31, 5, 6, 7, 13, 14, 24, 18, 25, 228 }; 229 static const YYINT _nsyysindex[] = { -255, 230 -249, 0, 0, 0, -255, 0, -49, 0, 0, -254, 231 0, -73, -253, 0, 0, 0, 0, -244, 0, 0, 232 0, 0, -42, -93, 0, -256, 0, 0, 0, 0, 233 0, 234 }; 235 static const YYINT _nsyyrindex[] = { 20, 236 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 237 0, -252, 0, 0, 0, 0, 0, 0, 0, 0, 238 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239 0, 240 }; 241 static const YYINT _nsyygindex[] = { 0, 242 0, 0, 0, 17, 0, 0, 10, 0, 0, 1, 243 }; 244 #define YYTABLESIZE 168 245 static const YYINT _nsyytable[] = { 27, 246 1, 2, 11, 16, 12, 29, 30, 8, 10, 3, 247 12, 12, 12, 19, 20, 21, 22, 15, 26, 1, 248 2, 9, 17, 0, 28, 0, 0, 0, 0, 0, 249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262 0, 0, 0, 0, 19, 20, 21, 22, 263 }; 264 static const YYINT _nsyycheck[] = { 93, 265 256, 257, 257, 257, 257, 262, 263, 257, 58, 265, 266 265, 265, 265, 258, 259, 260, 261, 91, 61, 0, 267 0, 5, 13, -1, 24, -1, -1, -1, -1, -1, 268 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 269 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 279 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 281 -1, -1, -1, -1, 258, 259, 260, 261, 282 }; 283 #define YYFINAL 4 284 #ifndef YYDEBUG 285 #define YYDEBUG 0 286 #endif 287 #define YYMAXTOKEN 265 288 #define YYUNDFTOKEN 278 289 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 290 #if YYDEBUG 291 static const char *const _nsyyname[] = { 292 293 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 294 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,"'='",0,0,0,0,0,0,0,0, 295 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0, 296 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 297 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 298 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 299 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"NL","SUCCESS", 300 "UNAVAIL","NOTFOUND","TRYAGAIN","RETURN","CONTINUE","ERRORTOKEN","STRING",0,0,0, 301 0,0,0,0,0,0,0,0,0,"illegal-symbol", 302 }; 303 static const char *const _nsyyrule[] = { 304 "$accept : File", 305 "File :", 306 "File : Lines", 307 "Lines : Entry", 308 "Lines : Lines Entry", 309 "Entry : NL", 310 "Entry : Database ':' NL", 311 "Entry : Database ':' Srclist NL", 312 "Entry : error NL", 313 "Database : STRING", 314 "Srclist : Item", 315 "Srclist : Srclist Item", 316 "Item : STRING", 317 "$$1 :", 318 "Item : STRING '[' $$1 Criteria ']'", 319 "Criteria : Criterion", 320 "Criteria : Criteria Criterion", 321 "Criterion : Status '=' Action", 322 "Status : SUCCESS", 323 "Status : UNAVAIL", 324 "Status : NOTFOUND", 325 "Status : TRYAGAIN", 326 "Action : RETURN", 327 "Action : CONTINUE", 328 329 }; 330 #endif 331 332 int yydebug; 333 int yynerrs; 334 335 int yyerrflag; 336 int yychar; 337 YYSTYPE yyval; 338 YYSTYPE yylval; 339 340 /* define the initial stack-sizes */ 341 #ifdef YYSTACKSIZE 342 #undef YYMAXDEPTH 343 #define YYMAXDEPTH YYSTACKSIZE 238 344 #else 239 typedef unsigned char yytype_uint8; 240 #endif 241 242 #ifdef YYTYPE_INT8 243 typedef YYTYPE_INT8 yytype_int8; 244 #elif (defined __STDC__ || defined __C99__FUNC__ \ 245 || defined __cplusplus || defined _MSC_VER) 246 typedef signed char yytype_int8; 345 #ifdef YYMAXDEPTH 346 #define YYSTACKSIZE YYMAXDEPTH 247 347 #else 248 typedef short int yytype_int8; 249 #endif 250 251 #ifdef YYTYPE_UINT16 252 typedef YYTYPE_UINT16 yytype_uint16; 253 #else 254 typedef unsigned short int yytype_uint16; 255 #endif 256 257 #ifdef YYTYPE_INT16 258 typedef YYTYPE_INT16 yytype_int16; 259 #else 260 typedef short int yytype_int16; 261 #endif 262 263 #ifndef YYSIZE_T 264 # ifdef __SIZE_TYPE__ 265 # define YYSIZE_T __SIZE_TYPE__ 266 # elif defined size_t 267 # define YYSIZE_T size_t 268 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 269 || defined __cplusplus || defined _MSC_VER) 270 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 271 # define YYSIZE_T size_t 272 # else 273 # define YYSIZE_T unsigned int 274 # endif 275 #endif 276 277 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 278 279 #ifndef YY_ 280 # if defined YYENABLE_NLS && YYENABLE_NLS 281 # if ENABLE_NLS 282 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 283 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 284 # endif 285 # endif 286 # ifndef YY_ 287 # define YY_(Msgid) Msgid 288 # endif 289 #endif 290 291 /* Suppress unused-variable warnings by "using" E. */ 292 #if ! defined lint || defined __GNUC__ 293 # define YYUSE(E) ((void) (E)) 294 #else 295 # define YYUSE(E) /* empty */ 296 #endif 297 298 /* Identity function, used to suppress warnings about constant conditions. */ 299 #ifndef lint 300 # define YYID(N) (N) 301 #else 302 #if (defined __STDC__ || defined __C99__FUNC__ \ 303 || defined __cplusplus || defined _MSC_VER) 304 static int 305 YYID (int yyi) 306 #else 307 static int 308 YYID (yyi) 309 int yyi; 310 #endif 311 { 312 return yyi; 313 } 314 #endif 315 316 #if ! defined yyoverflow || YYERROR_VERBOSE 317 318 /* The parser invokes alloca or malloc; define the necessary symbols. */ 319 320 # ifdef YYSTACK_USE_ALLOCA 321 # if YYSTACK_USE_ALLOCA 322 # ifdef __GNUC__ 323 # define YYSTACK_ALLOC __builtin_alloca 324 # elif defined __BUILTIN_VA_ARG_INCR 325 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 326 # elif defined _AIX 327 # define YYSTACK_ALLOC __alloca 328 # elif defined _MSC_VER 329 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 330 # define alloca _alloca 331 # else 332 # define YYSTACK_ALLOC alloca 333 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 334 || defined __cplusplus || defined _MSC_VER) 335 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 336 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 337 # ifndef EXIT_SUCCESS 338 # define EXIT_SUCCESS 0 339 # endif 340 # endif 341 # endif 342 # endif 343 # endif 344 345 # ifdef YYSTACK_ALLOC 346 /* Pacify GCC's `empty if-body' warning. */ 347 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 348 # ifndef YYSTACK_ALLOC_MAXIMUM 349 /* The OS might guarantee only one guard page at the bottom of the stack, 350 and a page size can be as small as 4096 bytes. So we cannot safely 351 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 352 to allow for a few compiler-allocated temporary stack slots. */ 353 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 354 # endif 355 # else 356 # define YYSTACK_ALLOC YYMALLOC 357 # define YYSTACK_FREE YYFREE 358 # ifndef YYSTACK_ALLOC_MAXIMUM 359 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 360 # endif 361 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 362 && ! ((defined YYMALLOC || defined malloc) \ 363 && (defined YYFREE || defined free))) 364 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 365 # ifndef EXIT_SUCCESS 366 # define EXIT_SUCCESS 0 367 # endif 368 # endif 369 # ifndef YYMALLOC 370 # define YYMALLOC malloc 371 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 372 || defined __cplusplus || defined _MSC_VER) 373 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 374 # endif 375 # endif 376 # ifndef YYFREE 377 # define YYFREE free 378 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 379 || defined __cplusplus || defined _MSC_VER) 380 void free (void *); /* INFRINGES ON USER NAME SPACE */ 381 # endif 382 # endif 383 # endif 384 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 385 386 387 #if (! defined yyoverflow \ 388 && (! defined __cplusplus \ 389 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 390 391 /* A type that is properly aligned for any stack member. */ 392 union yyalloc 393 { 394 yytype_int16 yyss_alloc; 395 YYSTYPE yyvs_alloc; 396 }; 397 398 /* The size of the maximum gap between one aligned stack and the next. */ 399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 400 401 /* The size of an array large to enough to hold all stacks, each with 402 N elements. */ 403 # define YYSTACK_BYTES(N) \ 404 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 405 + YYSTACK_GAP_MAXIMUM) 406 407 # define YYCOPY_NEEDED 1 408 409 /* Relocate STACK from its old location to the new one. The 410 local variables YYSIZE and YYSTACKSIZE give the old and new number of 411 elements in the stack, and YYPTR gives the new location of the 412 stack. Advance YYPTR to a properly aligned location for the next 413 stack. */ 414 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 415 do \ 416 { \ 417 YYSIZE_T yynewbytes; \ 418 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 419 Stack = &yyptr->Stack_alloc; \ 420 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 421 yyptr += yynewbytes / sizeof (*yyptr); \ 422 } \ 423 while (YYID (0)) 424 425 #endif 426 427 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 428 /* Copy COUNT objects from SRC to DST. The source and destination do 429 not overlap. */ 430 # ifndef YYCOPY 431 # if defined __GNUC__ && 1 < __GNUC__ 432 # define YYCOPY(Dst, Src, Count) \ 433 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 434 # else 435 # define YYCOPY(Dst, Src, Count) \ 436 do \ 437 { \ 438 YYSIZE_T yyi; \ 439 for (yyi = 0; yyi < (Count); yyi++) \ 440 (Dst)[yyi] = (Src)[yyi]; \ 441 } \ 442 while (YYID (0)) 443 # endif 444 # endif 445 #endif /* !YYCOPY_NEEDED */ 446 447 /* YYFINAL -- State number of the termination state. */ 448 #define YYFINAL 9 449 /* YYLAST -- Last index in YYTABLE. */ 450 #define YYLAST 30 451 452 /* YYNTOKENS -- Number of terminals. */ 453 #define YYNTOKENS 16 454 /* YYNNTS -- Number of nonterminals. */ 455 #define YYNNTS 12 456 /* YYNRULES -- Number of rules. */ 457 #define YYNRULES 24 458 /* YYNRULES -- Number of states. */ 459 #define YYNSTATES 33 460 461 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 462 #define YYUNDEFTOK 2 463 #define YYMAXUTOK 266 464 465 #define YYTRANSLATE(YYX) \ 466 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 467 468 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 469 static const yytype_uint8 yytranslate[] = 470 { 471 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 476 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 477 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, 478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 480 2, 13, 2, 14, 2, 2, 2, 2, 2, 2, 481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 496 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 497 5, 6, 7, 8, 9, 10, 11 498 }; 499 500 #if YYDEBUG 501 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 502 YYRHS. */ 503 static const yytype_uint8 yyprhs[] = 504 { 505 0, 0, 3, 4, 6, 8, 11, 13, 17, 22, 506 25, 27, 29, 32, 34, 35, 41, 43, 46, 50, 507 52, 54, 56, 58, 60 508 }; 509 510 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 511 static const yytype_int8 yyrhs[] = 512 { 513 17, 0, -1, -1, 18, -1, 19, -1, 18, 19, 514 -1, 3, -1, 20, 12, 3, -1, 20, 12, 21, 515 3, -1, 1, 3, -1, 11, -1, 22, -1, 21, 516 22, -1, 11, -1, -1, 11, 13, 23, 24, 14, 517 -1, 25, -1, 24, 25, -1, 26, 15, 27, -1, 518 4, -1, 5, -1, 6, -1, 7, -1, 8, -1, 519 9, -1 520 }; 521 522 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 523 static const yytype_uint8 yyrline[] = 524 { 525 0, 73, 73, 75, 79, 80, 84, 85, 89, 93, 526 100, 109, 110, 114, 119, 119, 126, 127, 131, 141, 527 142, 143, 144, 148, 149 528 }; 529 #endif 530 531 #if YYDEBUG || YYERROR_VERBOSE || 0 532 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 533 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 534 static const char *const yytname[] = 535 { 536 "$end", "error", "$undefined", "NL", "SUCCESS", "UNAVAIL", "NOTFOUND", 537 "TRYAGAIN", "RETURN", "CONTINUE", "ERRORTOKEN", "STRING", "':'", "'['", 538 "']'", "'='", "$accept", "File", "Lines", "Entry", "Database", "Srclist", 539 "Item", "$@1", "Criteria", "Criterion", "Status", "Action", YY_NULL 540 }; 541 #endif 542 543 # ifdef YYPRINT 544 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 545 token YYLEX-NUM. */ 546 static const yytype_uint16 yytoknum[] = 547 { 548 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 549 265, 266, 58, 91, 93, 61 550 }; 551 # endif 552 553 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 554 static const yytype_uint8 yyr1[] = 555 { 556 0, 16, 17, 17, 18, 18, 19, 19, 19, 19, 557 20, 21, 21, 22, 23, 22, 24, 24, 25, 26, 558 26, 26, 26, 27, 27 559 }; 560 561 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 562 static const yytype_uint8 yyr2[] = 563 { 564 0, 2, 0, 1, 1, 2, 1, 3, 4, 2, 565 1, 1, 2, 1, 0, 5, 1, 2, 3, 1, 566 1, 1, 1, 1, 1 567 }; 568 569 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 570 Performed when YYTABLE doesn't specify something else to do. Zero 571 means the default is an error. */ 572 static const yytype_uint8 yydefact[] = 573 { 574 0, 0, 6, 10, 0, 0, 4, 0, 9, 1, 575 5, 0, 7, 13, 0, 11, 14, 8, 12, 0, 576 19, 20, 21, 22, 0, 16, 0, 15, 17, 0, 577 23, 24, 18 578 }; 579 580 /* YYDEFGOTO[NTERM-NUM]. */ 581 static const yytype_int8 yydefgoto[] = 582 { 583 -1, 4, 5, 6, 7, 14, 15, 19, 24, 25, 584 26, 32 585 }; 586 587 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 588 STATE-NUM. */ 589 #define YYPACT_NINF -4 590 static const yytype_int8 yypact[] = 591 { 592 0, 5, -4, -4, 9, 4, -4, 1, -4, -4, 593 -4, -1, -4, 11, 3, -4, -4, -4, -4, 16, 594 -4, -4, -4, -4, 12, -4, -3, -4, -4, 19, 595 -4, -4, -4 596 }; 597 598 /* YYPGOTO[NTERM-NUM]. */ 599 static const yytype_int8 yypgoto[] = 600 { 601 -4, -4, -4, 20, -4, -4, 15, -4, -4, 6, 602 -4, -4 603 }; 604 605 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 606 positive, shift that token. If negative, reduce the rule which 607 number is the opposite. If YYTABLE_NINF, syntax error. */ 608 #define YYTABLE_NINF -4 609 static const yytype_int8 yytable[] = 610 { 611 -2, 1, 12, 2, -3, 1, 17, 2, 8, 9, 612 13, 3, 29, 11, 13, 3, 20, 21, 22, 23, 613 20, 21, 22, 23, 16, 10, 27, 30, 31, 18, 614 28 615 }; 616 617 #define yypact_value_is_default(Yystate) \ 618 (!!((Yystate) == (-4))) 619 620 #define yytable_value_is_error(Yytable_value) \ 621 YYID (0) 622 623 static const yytype_uint8 yycheck[] = 624 { 625 0, 1, 3, 3, 0, 1, 3, 3, 3, 0, 626 11, 11, 15, 12, 11, 11, 4, 5, 6, 7, 627 4, 5, 6, 7, 13, 5, 14, 8, 9, 14, 628 24 629 }; 630 631 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 632 symbol of state STATE-NUM. */ 633 static const yytype_uint8 yystos[] = 634 { 635 0, 1, 3, 11, 17, 18, 19, 20, 3, 0, 636 19, 12, 3, 11, 21, 22, 13, 3, 22, 23, 637 4, 5, 6, 7, 24, 25, 26, 14, 25, 15, 638 8, 9, 27 639 }; 640 641 #define yyerrok (yyerrstatus = 0) 642 #define yyclearin (yychar = YYEMPTY) 643 #define YYEMPTY (-2) 644 #define YYEOF 0 645 646 #define YYACCEPT goto yyacceptlab 647 #define YYABORT goto yyabortlab 648 #define YYERROR goto yyerrorlab 649 650 651 /* Like YYERROR except do call yyerror. This remains here temporarily 652 to ease the transition to the new meaning of YYERROR, for GCC. 653 Once GCC version 2 has supplanted version 1, this can go. However, 654 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 655 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 656 discussed. */ 657 658 #define YYFAIL goto yyerrlab 659 #if defined YYFAIL 660 /* This is here to suppress warnings from the GCC cpp's 661 -Wunused-macros. Normally we don't worry about that warning, but 662 some users do, and we want to make it easy for users to remove 663 YYFAIL uses, which will produce warnings from Bison 2.5. */ 664 #endif 665 666 #define YYRECOVERING() (!!yyerrstatus) 667 668 #define YYBACKUP(Token, Value) \ 669 do \ 670 if (yychar == YYEMPTY) \ 671 { \ 672 yychar = (Token); \ 673 yylval = (Value); \ 674 YYPOPSTACK (yylen); \ 675 yystate = *yyssp; \ 676 goto yybackup; \ 677 } \ 678 else \ 679 { \ 680 yyerror (YY_("syntax error: cannot back up")); \ 681 YYERROR; \ 682 } \ 683 while (YYID (0)) 684 685 /* Error token number */ 686 #define YYTERROR 1 687 #define YYERRCODE 256 688 689 690 /* This macro is provided for backward compatibility. */ 691 #ifndef YY_LOCATION_PRINT 692 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 693 #endif 694 695 696 /* YYLEX -- calling `yylex' with the right arguments. */ 697 #ifdef YYLEX_PARAM 698 # define YYLEX yylex (YYLEX_PARAM) 699 #else 700 # define YYLEX yylex () 701 #endif 702 703 /* Enable debugging if requested. */ 704 #if YYDEBUG 705 706 # ifndef YYFPRINTF 707 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 708 # define YYFPRINTF fprintf 709 # endif 710 711 # define YYDPRINTF(Args) \ 712 do { \ 713 if (yydebug) \ 714 YYFPRINTF Args; \ 715 } while (YYID (0)) 716 717 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 718 do { \ 719 if (yydebug) \ 720 { \ 721 YYFPRINTF (stderr, "%s ", Title); \ 722 yy_symbol_print (stderr, \ 723 Type, Value); \ 724 YYFPRINTF (stderr, "\n"); \ 725 } \ 726 } while (YYID (0)) 727 728 729 /*--------------------------------. 730 | Print this symbol on YYOUTPUT. | 731 `--------------------------------*/ 732 733 /*ARGSUSED*/ 734 #if (defined __STDC__ || defined __C99__FUNC__ \ 735 || defined __cplusplus || defined _MSC_VER) 736 static void 737 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 738 #else 739 static void 740 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 741 FILE *yyoutput; 742 int yytype; 743 YYSTYPE const * const yyvaluep; 744 #endif 745 { 746 FILE *yyo = yyoutput; 747 YYUSE (yyo); 748 if (!yyvaluep) 749 return; 750 # ifdef YYPRINT 751 if (yytype < YYNTOKENS) 752 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 753 # else 754 YYUSE (yyoutput); 755 # endif 756 switch (yytype) 757 { 758 default: 759 break; 760 } 761 } 762 763 764 /*--------------------------------. 765 | Print this symbol on YYOUTPUT. | 766 `--------------------------------*/ 767 768 #if (defined __STDC__ || defined __C99__FUNC__ \ 769 || defined __cplusplus || defined _MSC_VER) 770 static void 771 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 772 #else 773 static void 774 yy_symbol_print (yyoutput, yytype, yyvaluep) 775 FILE *yyoutput; 776 int yytype; 777 YYSTYPE const * const yyvaluep; 778 #endif 779 { 780 if (yytype < YYNTOKENS) 781 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 782 else 783 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 784 785 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 786 YYFPRINTF (yyoutput, ")"); 787 } 788 789 /*------------------------------------------------------------------. 790 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 791 | TOP (included). | 792 `------------------------------------------------------------------*/ 793 794 #if (defined __STDC__ || defined __C99__FUNC__ \ 795 || defined __cplusplus || defined _MSC_VER) 796 static void 797 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 798 #else 799 static void 800 yy_stack_print (yybottom, yytop) 801 yytype_int16 *yybottom; 802 yytype_int16 *yytop; 803 #endif 804 { 805 YYFPRINTF (stderr, "Stack now"); 806 for (; yybottom <= yytop; yybottom++) 807 { 808 int yybot = *yybottom; 809 YYFPRINTF (stderr, " %d", yybot); 810 } 811 YYFPRINTF (stderr, "\n"); 812 } 813 814 # define YY_STACK_PRINT(Bottom, Top) \ 815 do { \ 816 if (yydebug) \ 817 yy_stack_print ((Bottom), (Top)); \ 818 } while (YYID (0)) 819 820 821 /*------------------------------------------------. 822 | Report that the YYRULE is going to be reduced. | 823 `------------------------------------------------*/ 824 825 #if (defined __STDC__ || defined __C99__FUNC__ \ 826 || defined __cplusplus || defined _MSC_VER) 827 static void 828 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 829 #else 830 static void 831 yy_reduce_print (yyvsp, yyrule) 832 YYSTYPE *yyvsp; 833 int yyrule; 834 #endif 835 { 836 int yynrhs = yyr2[yyrule]; 837 int yyi; 838 unsigned long int yylno = yyrline[yyrule]; 839 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 840 yyrule - 1, yylno); 841 /* The symbols being reduced. */ 842 for (yyi = 0; yyi < yynrhs; yyi++) 843 { 844 YYFPRINTF (stderr, " $%d = ", yyi + 1); 845 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 846 &(yyvsp[(yyi + 1) - (yynrhs)]) 847 ); 848 YYFPRINTF (stderr, "\n"); 849 } 850 } 851 852 # define YY_REDUCE_PRINT(Rule) \ 853 do { \ 854 if (yydebug) \ 855 yy_reduce_print (yyvsp, Rule); \ 856 } while (YYID (0)) 857 858 /* Nonzero means print parse trace. It is left uninitialized so that 859 multiple parsers can coexist. */ 860 int yydebug; 861 #else /* !YYDEBUG */ 862 # define YYDPRINTF(Args) 863 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 864 # define YY_STACK_PRINT(Bottom, Top) 865 # define YY_REDUCE_PRINT(Rule) 866 #endif /* !YYDEBUG */ 867 868 869 /* YYINITDEPTH -- initial size of the parser's stacks. */ 870 #ifndef YYINITDEPTH 871 # define YYINITDEPTH 200 872 #endif 873 874 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 875 if the built-in stack extension method is used). 876 877 Do not make this value too large; the results are undefined if 878 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 879 evaluated with infinite-precision integer arithmetic. */ 880 881 #ifndef YYMAXDEPTH 882 # define YYMAXDEPTH 10000 883 #endif 884 885 886 #if YYERROR_VERBOSE 887 888 # ifndef yystrlen 889 # if defined __GLIBC__ && defined _STRING_H 890 # define yystrlen strlen 891 # else 892 /* Return the length of YYSTR. */ 893 #if (defined __STDC__ || defined __C99__FUNC__ \ 894 || defined __cplusplus || defined _MSC_VER) 895 static YYSIZE_T 896 yystrlen (const char *yystr) 897 #else 898 static YYSIZE_T 899 yystrlen (yystr) 900 const char *yystr; 901 #endif 902 { 903 YYSIZE_T yylen; 904 for (yylen = 0; yystr[yylen]; yylen++) 905 continue; 906 return yylen; 907 } 908 # endif 909 # endif 910 911 # ifndef yystpcpy 912 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 913 # define yystpcpy stpcpy 914 # else 915 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 916 YYDEST. */ 917 #if (defined __STDC__ || defined __C99__FUNC__ \ 918 || defined __cplusplus || defined _MSC_VER) 919 static char * 920 yystpcpy (char *yydest, const char *yysrc) 921 #else 922 static char * 923 yystpcpy (yydest, yysrc) 924 char *yydest; 925 const char *yysrc; 926 #endif 927 { 928 char *yyd = yydest; 929 const char *yys = yysrc; 930 931 while ((*yyd++ = *yys++) != '\0') 932 continue; 933 934 return yyd - 1; 935 } 936 # endif 937 # endif 938 939 # ifndef yytnamerr 940 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 941 quotes and backslashes, so that it's suitable for yyerror. The 942 heuristic is that double-quoting is unnecessary unless the string 943 contains an apostrophe, a comma, or backslash (other than 944 backslash-backslash). YYSTR is taken from yytname. If YYRES is 945 null, do not copy; instead, return the length of what the result 946 would have been. */ 947 static YYSIZE_T 948 yytnamerr (char *yyres, const char *yystr) 949 { 950 if (*yystr == '"') 951 { 952 YYSIZE_T yyn = 0; 953 char const *yyp = yystr; 954 955 for (;;) 956 switch (*++yyp) 957 { 958 case '\'': 959 case ',': 960 goto do_not_strip_quotes; 961 962 case '\\': 963 if (*++yyp != '\\') 964 goto do_not_strip_quotes; 965 /* Fall through. */ 966 default: 967 if (yyres) 968 yyres[yyn] = *yyp; 969 yyn++; 970 break; 971 972 case '"': 973 if (yyres) 974 yyres[yyn] = '\0'; 975 return yyn; 976 } 977 do_not_strip_quotes: ; 978 } 979 980 if (! yyres) 981 return yystrlen (yystr); 982 983 return yystpcpy (yyres, yystr) - yyres; 984 } 985 # endif 986 987 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 988 about the unexpected token YYTOKEN for the state stack whose top is 989 YYSSP. 990 991 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 992 not large enough to hold the message. In that case, also set 993 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 994 required number of bytes is too large to store. */ 995 static int 996 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 997 yytype_int16 *yyssp, int yytoken) 998 { 999 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); 1000 YYSIZE_T yysize = yysize0; 1001 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1002 /* Internationalized format string. */ 1003 const char *yyformat = YY_NULL; 1004 /* Arguments of yyformat. */ 1005 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1006 /* Number of reported tokens (one for the "unexpected", one per 1007 "expected"). */ 1008 int yycount = 0; 1009 1010 /* There are many possibilities here to consider: 1011 - Assume YYFAIL is not used. It's too flawed to consider. See 1012 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 1013 for details. YYERROR is fine as it does not invoke this 1014 function. 1015 - If this state is a consistent state with a default action, then 1016 the only way this function was invoked is if the default action 1017 is an error action. In that case, don't check for expected 1018 tokens because there are none. 1019 - The only way there can be no lookahead present (in yychar) is if 1020 this state is a consistent state with a default action. Thus, 1021 detecting the absence of a lookahead is sufficient to determine 1022 that there is no unexpected or expected token to report. In that 1023 case, just report a simple "syntax error". 1024 - Don't assume there isn't a lookahead just because this state is a 1025 consistent state with a default action. There might have been a 1026 previous inconsistent state, consistent state with a non-default 1027 action, or user semantic action that manipulated yychar. 1028 - Of course, the expected token list depends on states to have 1029 correct lookahead information, and it depends on the parser not 1030 to perform extra reductions after fetching a lookahead from the 1031 scanner and before detecting a syntax error. Thus, state merging 1032 (from LALR or IELR) and default reductions corrupt the expected 1033 token list. However, the list is correct for canonical LR with 1034 one exception: it will still contain any token that will not be 1035 accepted due to an error action in a later state. 1036 */ 1037 if (yytoken != YYEMPTY) 1038 { 1039 int yyn = yypact[*yyssp]; 1040 yyarg[yycount++] = yytname[yytoken]; 1041 if (!yypact_value_is_default (yyn)) 1042 { 1043 /* Start YYX at -YYN if negative to avoid negative indexes in 1044 YYCHECK. In other words, skip the first -YYN actions for 1045 this state because they are default actions. */ 1046 int yyxbegin = yyn < 0 ? -yyn : 0; 1047 /* Stay within bounds of both yycheck and yytname. */ 1048 int yychecklim = YYLAST - yyn + 1; 1049 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1050 int yyx; 1051 1052 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1053 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1054 && !yytable_value_is_error (yytable[yyx + yyn])) 1055 { 1056 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1057 { 1058 yycount = 1; 1059 yysize = yysize0; 1060 break; 1061 } 1062 yyarg[yycount++] = yytname[yyx]; 1063 { 1064 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); 1065 if (! (yysize <= yysize1 1066 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1067 return 2; 1068 yysize = yysize1; 1069 } 1070 } 1071 } 1072 } 1073 1074 switch (yycount) 1075 { 1076 # define YYCASE_(N, S) \ 1077 case N: \ 1078 yyformat = S; \ 1079 break 1080 YYCASE_(0, YY_("syntax error")); 1081 YYCASE_(1, YY_("syntax error, unexpected %s")); 1082 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1083 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1084 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1085 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1086 # undef YYCASE_ 1087 } 1088 1089 { 1090 YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1091 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1092 return 2; 1093 yysize = yysize1; 1094 } 1095 1096 if (*yymsg_alloc < yysize) 1097 { 1098 *yymsg_alloc = 2 * yysize; 1099 if (! (yysize <= *yymsg_alloc 1100 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1101 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1102 return 1; 1103 } 1104 1105 /* Avoid sprintf, as that infringes on the user's name space. 1106 Don't have undefined behavior even if the translation 1107 produced a string with the wrong number of "%s"s. */ 1108 { 1109 char *yyp = *yymsg; 1110 int yyi = 0; 1111 while ((*yyp = *yyformat) != '\0') 1112 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1113 { 1114 yyp += yytnamerr (yyp, yyarg[yyi++]); 1115 yyformat += 2; 1116 } 1117 else 1118 { 1119 yyp++; 1120 yyformat++; 1121 } 1122 } 1123 return 0; 1124 } 1125 #endif /* YYERROR_VERBOSE */ 1126 1127 /*-----------------------------------------------. 1128 | Release the memory associated to this symbol. | 1129 `-----------------------------------------------*/ 1130 1131 /*ARGSUSED*/ 1132 #if (defined __STDC__ || defined __C99__FUNC__ \ 1133 || defined __cplusplus || defined _MSC_VER) 1134 static void 1135 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1136 #else 1137 static void 1138 yydestruct (yymsg, yytype, yyvaluep) 1139 const char *yymsg; 1140 int yytype; 1141 YYSTYPE *yyvaluep; 1142 #endif 1143 { 1144 YYUSE (yyvaluep); 1145 1146 if (!yymsg) 1147 yymsg = "Deleting"; 1148 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1149 1150 switch (yytype) 1151 { 1152 1153 default: 1154 break; 1155 } 1156 } 1157 1158 1159 1160 1161 /* The lookahead symbol. */ 1162 int yychar; 1163 1164 1165 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1166 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1167 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 1168 #endif 1169 #ifndef YY_INITIAL_VALUE 1170 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 1171 #endif 1172 1173 /* The semantic value of the lookahead symbol. */ 1174 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); 1175 1176 /* Number of syntax errors so far. */ 1177 int yynerrs; 1178 1179 1180 /*----------. 1181 | yyparse. | 1182 `----------*/ 1183 1184 #ifdef YYPARSE_PARAM 1185 #if (defined __STDC__ || defined __C99__FUNC__ \ 1186 || defined __cplusplus || defined _MSC_VER) 1187 int 1188 yyparse (void *YYPARSE_PARAM) 1189 #else 1190 int 1191 yyparse (YYPARSE_PARAM) 1192 void *YYPARSE_PARAM; 1193 #endif 1194 #else /* ! YYPARSE_PARAM */ 1195 #if (defined __STDC__ || defined __C99__FUNC__ \ 1196 || defined __cplusplus || defined _MSC_VER) 1197 int 1198 yyparse (void) 1199 #else 1200 int 1201 yyparse () 1202 1203 #endif 1204 #endif 1205 { 1206 int yystate; 1207 /* Number of tokens to shift before error messages enabled. */ 1208 int yyerrstatus; 1209 1210 /* The stacks and their tools: 1211 `yyss': related to states. 1212 `yyvs': related to semantic values. 1213 1214 Refer to the stacks through separate pointers, to allow yyoverflow 1215 to reallocate them elsewhere. */ 1216 1217 /* The state stack. */ 1218 yytype_int16 yyssa[YYINITDEPTH]; 1219 yytype_int16 *yyss; 1220 yytype_int16 *yyssp; 1221 1222 /* The semantic value stack. */ 1223 YYSTYPE yyvsa[YYINITDEPTH]; 1224 YYSTYPE *yyvs; 1225 YYSTYPE *yyvsp; 1226 1227 YYSIZE_T yystacksize; 1228 1229 int yyn; 1230 int yyresult; 1231 /* Lookahead token as an internal (translated) token number. */ 1232 int yytoken = 0; 1233 /* The variables used to return semantic value and location from the 1234 action routines. */ 1235 YYSTYPE yyval; 1236 1237 #if YYERROR_VERBOSE 1238 /* Buffer for error messages, and its allocated size. */ 1239 char yymsgbuf[128]; 1240 char *yymsg = yymsgbuf; 1241 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1242 #endif 1243 1244 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1245 1246 /* The number of symbols on the RHS of the reduced rule. 1247 Keep to zero when no symbol should be popped. */ 1248 int yylen = 0; 1249 1250 yyssp = yyss = yyssa; 1251 yyvsp = yyvs = yyvsa; 1252 yystacksize = YYINITDEPTH; 1253 1254 YYDPRINTF ((stderr, "Starting parse\n")); 1255 1256 yystate = 0; 1257 yyerrstatus = 0; 1258 yynerrs = 0; 1259 yychar = YYEMPTY; /* Cause a token to be read. */ 1260 goto yysetstate; 1261 1262 /*------------------------------------------------------------. 1263 | yynewstate -- Push a new state, which is found in yystate. | 1264 `------------------------------------------------------------*/ 1265 yynewstate: 1266 /* In all cases, when you get here, the value and location stacks 1267 have just been pushed. So pushing a state here evens the stacks. */ 1268 yyssp++; 1269 1270 yysetstate: 1271 *yyssp = yystate; 1272 1273 if (yyss + yystacksize - 1 <= yyssp) 1274 { 1275 /* Get the current used size of the three stacks, in elements. */ 1276 YYSIZE_T yysize = yyssp - yyss + 1; 1277 1278 #ifdef yyoverflow 1279 { 1280 /* Give user a chance to reallocate the stack. Use copies of 1281 these so that the &'s don't force the real ones into 1282 memory. */ 1283 YYSTYPE *yyvs1 = yyvs; 1284 yytype_int16 *yyss1 = yyss; 1285 1286 /* Each stack pointer address is followed by the size of the 1287 data in use in that stack, in bytes. This used to be a 1288 conditional around just the two extra args, but that might 1289 be undefined if yyoverflow is a macro. */ 1290 yyoverflow (YY_("memory exhausted"), 1291 &yyss1, yysize * sizeof (*yyssp), 1292 &yyvs1, yysize * sizeof (*yyvsp), 1293 &yystacksize); 1294 1295 yyss = yyss1; 1296 yyvs = yyvs1; 1297 } 1298 #else /* no yyoverflow */ 1299 # ifndef YYSTACK_RELOCATE 1300 goto yyexhaustedlab; 1301 # else 1302 /* Extend the stack our own way. */ 1303 if (YYMAXDEPTH <= yystacksize) 1304 goto yyexhaustedlab; 1305 yystacksize *= 2; 1306 if (YYMAXDEPTH < yystacksize) 1307 yystacksize = YYMAXDEPTH; 1308 1309 { 1310 yytype_int16 *yyss1 = yyss; 1311 union yyalloc *yyptr = 1312 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1313 if (! yyptr) 1314 goto yyexhaustedlab; 1315 YYSTACK_RELOCATE (yyss_alloc, yyss); 1316 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1317 # undef YYSTACK_RELOCATE 1318 if (yyss1 != yyssa) 1319 YYSTACK_FREE (yyss1); 1320 } 1321 # endif 1322 #endif /* no yyoverflow */ 1323 1324 yyssp = yyss + yysize - 1; 1325 yyvsp = yyvs + yysize - 1; 1326 1327 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1328 (unsigned long int) yystacksize)); 1329 1330 if (yyss + yystacksize - 1 <= yyssp) 1331 YYABORT; 1332 } 1333 1334 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1335 1336 if (yystate == YYFINAL) 1337 YYACCEPT; 1338 1339 goto yybackup; 1340 1341 /*-----------. 1342 | yybackup. | 1343 `-----------*/ 1344 yybackup: 1345 1346 /* Do appropriate processing given the current state. Read a 1347 lookahead token if we need one and don't already have one. */ 1348 1349 /* First try to decide what to do without reference to lookahead token. */ 1350 yyn = yypact[yystate]; 1351 if (yypact_value_is_default (yyn)) 1352 goto yydefault; 1353 1354 /* Not known => get a lookahead token if don't already have one. */ 1355 1356 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1357 if (yychar == YYEMPTY) 1358 { 1359 YYDPRINTF ((stderr, "Reading a token: ")); 1360 yychar = YYLEX; 1361 } 1362 1363 if (yychar <= YYEOF) 1364 { 1365 yychar = yytoken = YYEOF; 1366 YYDPRINTF ((stderr, "Now at end of input.\n")); 1367 } 1368 else 1369 { 1370 yytoken = YYTRANSLATE (yychar); 1371 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1372 } 1373 1374 /* If the proper action on seeing token YYTOKEN is to reduce or to 1375 detect an error, take that action. */ 1376 yyn += yytoken; 1377 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1378 goto yydefault; 1379 yyn = yytable[yyn]; 1380 if (yyn <= 0) 1381 { 1382 if (yytable_value_is_error (yyn)) 1383 goto yyerrlab; 1384 yyn = -yyn; 1385 goto yyreduce; 1386 } 1387 1388 /* Count tokens shifted since error; after three, turn off error 1389 status. */ 1390 if (yyerrstatus) 1391 yyerrstatus--; 1392 1393 /* Shift the lookahead token. */ 1394 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1395 1396 /* Discard the shifted token. */ 1397 yychar = YYEMPTY; 1398 1399 yystate = yyn; 1400 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1401 *++yyvsp = yylval; 1402 YY_IGNORE_MAYBE_UNINITIALIZED_END 1403 1404 goto yynewstate; 1405 1406 1407 /*-----------------------------------------------------------. 1408 | yydefault -- do the default action for the current state. | 1409 `-----------------------------------------------------------*/ 1410 yydefault: 1411 yyn = yydefact[yystate]; 1412 if (yyn == 0) 1413 goto yyerrlab; 1414 goto yyreduce; 1415 1416 1417 /*-----------------------------. 1418 | yyreduce -- Do a reduction. | 1419 `-----------------------------*/ 1420 yyreduce: 1421 /* yyn is the number of a rule to reduce with. */ 1422 yylen = yyr2[yyn]; 1423 1424 /* If YYLEN is nonzero, implement the default value of the action: 1425 `$$ = $1'. 1426 1427 Otherwise, the following line sets YYVAL to garbage. 1428 This behavior is undocumented and Bison 1429 users should not rely upon it. Assigning to YYVAL 1430 unconditionally makes the parser a bit smaller, and it avoids a 1431 GCC warning that YYVAL may be used uninitialized. */ 1432 yyval = yyvsp[1-yylen]; 1433 1434 1435 YY_REDUCE_PRINT (yyn); 1436 switch (yyn) 1437 { 1438 case 7: 1439 /* Line 1792 of yacc.c */ 1440 #line 86 "freebsd/lib/libc/net/nsparser.y" 1441 { 1442 free((char*)curdbt.name); 1443 } 1444 break; 1445 1446 case 8: 1447 /* Line 1792 of yacc.c */ 1448 #line 90 "freebsd/lib/libc/net/nsparser.y" 1449 { 1450 _nsdbtput(&curdbt); 1451 } 1452 break; 1453 1454 case 9: 1455 /* Line 1792 of yacc.c */ 1456 #line 94 "freebsd/lib/libc/net/nsparser.y" 1457 { 1458 yyerrok; 1459 } 1460 break; 1461 1462 case 10: 1463 /* Line 1792 of yacc.c */ 1464 #line 101 "freebsd/lib/libc/net/nsparser.y" 1465 { 1466 curdbt.name = yylval.str; 1467 curdbt.srclist = NULL; 1468 curdbt.srclistsize = 0; 1469 } 1470 break; 1471 1472 case 13: 1473 /* Line 1792 of yacc.c */ 1474 #line 115 "freebsd/lib/libc/net/nsparser.y" 1475 { 1476 cursrc.flags = NS_TERMINATE; 1477 _nsaddsrctomap((yyvsp[(1) - (1)].str)); 1478 } 1479 break; 1480 1481 case 14: 1482 /* Line 1792 of yacc.c */ 1483 #line 119 "freebsd/lib/libc/net/nsparser.y" 1484 { cursrc.flags = NS_SUCCESS; } 1485 break; 1486 1487 case 15: 1488 /* Line 1792 of yacc.c */ 1489 #line 120 "freebsd/lib/libc/net/nsparser.y" 1490 { 1491 _nsaddsrctomap((yyvsp[(1) - (5)].str)); 1492 } 1493 break; 1494 1495 case 18: 1496 /* Line 1792 of yacc.c */ 1497 #line 132 "freebsd/lib/libc/net/nsparser.y" 1498 { 1499 if ((yyvsp[(3) - (3)].mapval)) /* if action == RETURN set RETURN bit */ 1500 cursrc.flags |= (yyvsp[(1) - (3)].mapval); 1501 else /* else unset it */ 1502 cursrc.flags &= ~(yyvsp[(1) - (3)].mapval); 1503 } 1504 break; 1505 1506 case 19: 1507 /* Line 1792 of yacc.c */ 1508 #line 141 "freebsd/lib/libc/net/nsparser.y" 1509 { (yyval.mapval) = NS_SUCCESS; } 1510 break; 1511 1512 case 20: 1513 /* Line 1792 of yacc.c */ 1514 #line 142 "freebsd/lib/libc/net/nsparser.y" 1515 { (yyval.mapval) = NS_UNAVAIL; } 1516 break; 1517 1518 case 21: 1519 /* Line 1792 of yacc.c */ 1520 #line 143 "freebsd/lib/libc/net/nsparser.y" 1521 { (yyval.mapval) = NS_NOTFOUND; } 1522 break; 1523 1524 case 22: 1525 /* Line 1792 of yacc.c */ 1526 #line 144 "freebsd/lib/libc/net/nsparser.y" 1527 { (yyval.mapval) = NS_TRYAGAIN; } 1528 break; 1529 1530 case 23: 1531 /* Line 1792 of yacc.c */ 1532 #line 148 "freebsd/lib/libc/net/nsparser.y" 1533 { (yyval.mapval) = NS_ACTION_RETURN; } 1534 break; 1535 1536 case 24: 1537 /* Line 1792 of yacc.c */ 1538 #line 149 "freebsd/lib/libc/net/nsparser.y" 1539 { (yyval.mapval) = NS_ACTION_CONTINUE; } 1540 break; 1541 1542 1543 /* Line 1792 of yacc.c */ 1544 #line 1545 "_nsyy.tab.c" 1545 default: break; 1546 } 1547 /* User semantic actions sometimes alter yychar, and that requires 1548 that yytoken be updated with the new translation. We take the 1549 approach of translating immediately before every use of yytoken. 1550 One alternative is translating here after every semantic action, 1551 but that translation would be missed if the semantic action invokes 1552 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1553 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1554 incorrect destructor might then be invoked immediately. In the 1555 case of YYERROR or YYBACKUP, subsequent parser actions might lead 1556 to an incorrect destructor call or verbose syntax error message 1557 before the lookahead is translated. */ 1558 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1559 1560 YYPOPSTACK (yylen); 1561 yylen = 0; 1562 YY_STACK_PRINT (yyss, yyssp); 1563 1564 *++yyvsp = yyval; 1565 1566 /* Now `shift' the result of the reduction. Determine what state 1567 that goes to, based on the state we popped back to and the rule 1568 number reduced by. */ 1569 1570 yyn = yyr1[yyn]; 1571 1572 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1573 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1574 yystate = yytable[yystate]; 1575 else 1576 yystate = yydefgoto[yyn - YYNTOKENS]; 1577 1578 goto yynewstate; 1579 1580 1581 /*------------------------------------. 1582 | yyerrlab -- here on detecting error | 1583 `------------------------------------*/ 1584 yyerrlab: 1585 /* Make sure we have latest lookahead translation. See comments at 1586 user semantic actions for why this is necessary. */ 1587 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1588 1589 /* If not already recovering from an error, report this error. */ 1590 if (!yyerrstatus) 1591 { 1592 ++yynerrs; 1593 #if ! YYERROR_VERBOSE 1594 yyerror (YY_("syntax error")); 1595 #else 1596 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1597 yyssp, yytoken) 1598 { 1599 char const *yymsgp = YY_("syntax error"); 1600 int yysyntax_error_status; 1601 yysyntax_error_status = YYSYNTAX_ERROR; 1602 if (yysyntax_error_status == 0) 1603 yymsgp = yymsg; 1604 else if (yysyntax_error_status == 1) 1605 { 1606 if (yymsg != yymsgbuf) 1607 YYSTACK_FREE (yymsg); 1608 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1609 if (!yymsg) 1610 { 1611 yymsg = yymsgbuf; 1612 yymsg_alloc = sizeof yymsgbuf; 1613 yysyntax_error_status = 2; 1614 } 1615 else 1616 { 1617 yysyntax_error_status = YYSYNTAX_ERROR; 1618 yymsgp = yymsg; 1619 } 1620 } 1621 yyerror (yymsgp); 1622 if (yysyntax_error_status == 2) 1623 goto yyexhaustedlab; 1624 } 1625 # undef YYSYNTAX_ERROR 1626 #endif 1627 } 1628 1629 1630 1631 if (yyerrstatus == 3) 1632 { 1633 /* If just tried and failed to reuse lookahead token after an 1634 error, discard it. */ 1635 1636 if (yychar <= YYEOF) 1637 { 1638 /* Return failure if at end of input. */ 1639 if (yychar == YYEOF) 1640 YYABORT; 1641 } 1642 else 1643 { 1644 yydestruct ("Error: discarding", 1645 yytoken, &yylval); 1646 yychar = YYEMPTY; 1647 } 1648 } 1649 1650 /* Else will try to reuse lookahead token after shifting the error 1651 token. */ 1652 goto yyerrlab1; 1653 1654 1655 /*---------------------------------------------------. 1656 | yyerrorlab -- error raised explicitly by YYERROR. | 1657 `---------------------------------------------------*/ 1658 yyerrorlab: 1659 1660 /* Pacify compilers like GCC when the user code never invokes 1661 YYERROR and the label yyerrorlab therefore never appears in user 1662 code. */ 1663 if (/*CONSTCOND*/ 0) 1664 goto yyerrorlab; 1665 1666 /* Do not reclaim the symbols of the rule which action triggered 1667 this YYERROR. */ 1668 YYPOPSTACK (yylen); 1669 yylen = 0; 1670 YY_STACK_PRINT (yyss, yyssp); 1671 yystate = *yyssp; 1672 goto yyerrlab1; 1673 1674 1675 /*-------------------------------------------------------------. 1676 | yyerrlab1 -- common code for both syntax error and YYERROR. | 1677 `-------------------------------------------------------------*/ 1678 yyerrlab1: 1679 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1680 1681 for (;;) 1682 { 1683 yyn = yypact[yystate]; 1684 if (!yypact_value_is_default (yyn)) 1685 { 1686 yyn += YYTERROR; 1687 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1688 { 1689 yyn = yytable[yyn]; 1690 if (0 < yyn) 1691 break; 1692 } 1693 } 1694 1695 /* Pop the current state because it cannot handle the error token. */ 1696 if (yyssp == yyss) 1697 YYABORT; 1698 1699 1700 yydestruct ("Error: popping", 1701 yystos[yystate], yyvsp); 1702 YYPOPSTACK (1); 1703 yystate = *yyssp; 1704 YY_STACK_PRINT (yyss, yyssp); 1705 } 1706 1707 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1708 *++yyvsp = yylval; 1709 YY_IGNORE_MAYBE_UNINITIALIZED_END 1710 1711 1712 /* Shift the error token. */ 1713 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1714 1715 yystate = yyn; 1716 goto yynewstate; 1717 1718 1719 /*-------------------------------------. 1720 | yyacceptlab -- YYACCEPT comes here. | 1721 `-------------------------------------*/ 1722 yyacceptlab: 1723 yyresult = 0; 1724 goto yyreturn; 1725 1726 /*-----------------------------------. 1727 | yyabortlab -- YYABORT comes here. | 1728 `-----------------------------------*/ 1729 yyabortlab: 1730 yyresult = 1; 1731 goto yyreturn; 1732 1733 #if !defined yyoverflow || YYERROR_VERBOSE 1734 /*-------------------------------------------------. 1735 | yyexhaustedlab -- memory exhaustion comes here. | 1736 `-------------------------------------------------*/ 1737 yyexhaustedlab: 1738 yyerror (YY_("memory exhausted")); 1739 yyresult = 2; 1740 /* Fall through. */ 1741 #endif 1742 1743 yyreturn: 1744 if (yychar != YYEMPTY) 1745 { 1746 /* Make sure we have latest lookahead translation. See comments at 1747 user semantic actions for why this is necessary. */ 1748 yytoken = YYTRANSLATE (yychar); 1749 yydestruct ("Cleanup: discarding lookahead", 1750 yytoken, &yylval); 1751 } 1752 /* Do not reclaim the symbols of the rule which action triggered 1753 this YYABORT or YYACCEPT. */ 1754 YYPOPSTACK (yylen); 1755 YY_STACK_PRINT (yyss, yyssp); 1756 while (yyssp != yyss) 1757 { 1758 yydestruct ("Cleanup: popping", 1759 yystos[*yyssp], yyvsp); 1760 YYPOPSTACK (1); 1761 } 1762 #ifndef yyoverflow 1763 if (yyss != yyssa) 1764 YYSTACK_FREE (yyss); 1765 #endif 1766 #if YYERROR_VERBOSE 1767 if (yymsg != yymsgbuf) 1768 YYSTACK_FREE (yymsg); 1769 #endif 1770 /* Make sure YYID is used. */ 1771 return YYID (yyresult); 1772 } 1773 1774 1775 /* Line 2055 of yacc.c */ 1776 #line 152 "freebsd/lib/libc/net/nsparser.y" 1777 348 #define YYSTACKSIZE 10000 349 #define YYMAXDEPTH 10000 350 #endif 351 #endif 352 353 #define YYINITSTACKSIZE 200 354 355 typedef struct { 356 unsigned stacksize; 357 YYINT *s_base; 358 YYINT *s_mark; 359 YYINT *s_last; 360 YYSTYPE *l_base; 361 YYSTYPE *l_mark; 362 } YYSTACKDATA; 363 /* variables for the parser stack */ 364 static YYSTACKDATA yystack; 365 #line 153 "../../freebsd/lib/libc/net/nsparser.y" 1778 366 1779 367 static void … … 1809 397 _nsdbtaddsrc(&curdbt, &cursrc); 1810 398 } 399 #line 400 "_nsyy.tab.c" 400 401 #if YYDEBUG 402 #include <stdio.h> /* needed for printf */ 403 #endif 404 405 #include <stdlib.h> /* needed for malloc, etc */ 406 #include <string.h> /* needed for memset */ 407 408 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 409 static int yygrowstack(YYSTACKDATA *data) 410 { 411 int i; 412 unsigned newsize; 413 YYINT *newss; 414 YYSTYPE *newvs; 415 416 if ((newsize = data->stacksize) == 0) 417 newsize = YYINITSTACKSIZE; 418 else if (newsize >= YYMAXDEPTH) 419 return YYENOMEM; 420 else if ((newsize *= 2) > YYMAXDEPTH) 421 newsize = YYMAXDEPTH; 422 423 i = (int) (data->s_mark - data->s_base); 424 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 425 if (newss == 0) 426 return YYENOMEM; 427 428 data->s_base = newss; 429 data->s_mark = newss + i; 430 431 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 432 if (newvs == 0) 433 return YYENOMEM; 434 435 data->l_base = newvs; 436 data->l_mark = newvs + i; 437 438 data->stacksize = newsize; 439 data->s_last = data->s_base + newsize - 1; 440 return 0; 441 } 442 443 #if YYPURE || defined(YY_NO_LEAKS) 444 static void yyfreestack(YYSTACKDATA *data) 445 { 446 free(data->s_base); 447 free(data->l_base); 448 memset(data, 0, sizeof(*data)); 449 } 450 #else 451 #define yyfreestack(data) /* nothing */ 452 #endif 453 454 #define YYABORT goto yyabort 455 #define YYREJECT goto yyabort 456 #define YYACCEPT goto yyaccept 457 #define YYERROR goto yyerrlab 458 459 int 460 YYPARSE_DECL() 461 { 462 int yym, yyn, yystate; 463 #if YYDEBUG 464 const char *yys; 465 466 if ((yys = getenv("YYDEBUG")) != 0) 467 { 468 yyn = *yys; 469 if (yyn >= '0' && yyn <= '9') 470 yydebug = yyn - '0'; 471 } 472 #endif 473 474 yynerrs = 0; 475 yyerrflag = 0; 476 yychar = YYEMPTY; 477 yystate = 0; 478 479 #if YYPURE 480 memset(&yystack, 0, sizeof(yystack)); 481 #endif 482 483 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 484 yystack.s_mark = yystack.s_base; 485 yystack.l_mark = yystack.l_base; 486 yystate = 0; 487 *yystack.s_mark = 0; 488 489 yyloop: 490 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 491 if (yychar < 0) 492 { 493 if ((yychar = YYLEX) < 0) yychar = YYEOF; 494 #if YYDEBUG 495 if (yydebug) 496 { 497 yys = yyname[YYTRANSLATE(yychar)]; 498 printf("%sdebug: state %d, reading %d (%s)\n", 499 YYPREFIX, yystate, yychar, yys); 500 } 501 #endif 502 } 503 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && 504 yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 505 { 506 #if YYDEBUG 507 if (yydebug) 508 printf("%sdebug: state %d, shifting to state %d\n", 509 YYPREFIX, yystate, yytable[yyn]); 510 #endif 511 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 512 { 513 goto yyoverflow; 514 } 515 yystate = yytable[yyn]; 516 *++yystack.s_mark = yytable[yyn]; 517 *++yystack.l_mark = yylval; 518 yychar = YYEMPTY; 519 if (yyerrflag > 0) --yyerrflag; 520 goto yyloop; 521 } 522 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && 523 yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 524 { 525 yyn = yytable[yyn]; 526 goto yyreduce; 527 } 528 if (yyerrflag) goto yyinrecovery; 529 530 YYERROR_CALL("syntax error"); 531 532 goto yyerrlab; 533 534 yyerrlab: 535 ++yynerrs; 536 537 yyinrecovery: 538 if (yyerrflag < 3) 539 { 540 yyerrflag = 3; 541 for (;;) 542 { 543 if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && 544 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) 545 { 546 #if YYDEBUG 547 if (yydebug) 548 printf("%sdebug: state %d, error recovery shifting\ 549 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 550 #endif 551 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 552 { 553 goto yyoverflow; 554 } 555 yystate = yytable[yyn]; 556 *++yystack.s_mark = yytable[yyn]; 557 *++yystack.l_mark = yylval; 558 goto yyloop; 559 } 560 else 561 { 562 #if YYDEBUG 563 if (yydebug) 564 printf("%sdebug: error recovery discarding state %d\n", 565 YYPREFIX, *yystack.s_mark); 566 #endif 567 if (yystack.s_mark <= yystack.s_base) goto yyabort; 568 --yystack.s_mark; 569 --yystack.l_mark; 570 } 571 } 572 } 573 else 574 { 575 if (yychar == YYEOF) goto yyabort; 576 #if YYDEBUG 577 if (yydebug) 578 { 579 yys = yyname[YYTRANSLATE(yychar)]; 580 printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 581 YYPREFIX, yystate, yychar, yys); 582 } 583 #endif 584 yychar = YYEMPTY; 585 goto yyloop; 586 } 587 588 yyreduce: 589 #if YYDEBUG 590 if (yydebug) 591 printf("%sdebug: state %d, reducing by rule %d (%s)\n", 592 YYPREFIX, yystate, yyn, yyrule[yyn]); 593 #endif 594 yym = yylen[yyn]; 595 if (yym) 596 yyval = yystack.l_mark[1-yym]; 597 else 598 memset(&yyval, 0, sizeof yyval); 599 switch (yyn) 600 { 601 case 6: 602 #line 86 "../../freebsd/lib/libc/net/nsparser.y" 603 { 604 free((char*)curdbt.name); 605 } 606 break; 607 case 7: 608 #line 90 "../../freebsd/lib/libc/net/nsparser.y" 609 { 610 _nsdbtput(&curdbt); 611 } 612 break; 613 case 8: 614 #line 94 "../../freebsd/lib/libc/net/nsparser.y" 615 { 616 yyerrok; 617 } 618 break; 619 case 9: 620 #line 101 "../../freebsd/lib/libc/net/nsparser.y" 621 { 622 curdbt.name = yylval.str; 623 curdbt.srclist = NULL; 624 curdbt.srclistsize = 0; 625 } 626 break; 627 case 12: 628 #line 115 "../../freebsd/lib/libc/net/nsparser.y" 629 { 630 cursrc.flags = NS_TERMINATE; 631 _nsaddsrctomap(yystack.l_mark[0].str); 632 } 633 break; 634 case 13: 635 #line 119 "../../freebsd/lib/libc/net/nsparser.y" 636 { cursrc.flags = NS_SUCCESS; } 637 break; 638 case 14: 639 #line 120 "../../freebsd/lib/libc/net/nsparser.y" 640 { 641 _nsaddsrctomap(yystack.l_mark[-4].str); 642 } 643 break; 644 case 17: 645 #line 132 "../../freebsd/lib/libc/net/nsparser.y" 646 { 647 if (yystack.l_mark[0].mapval) /* if action == RETURN set RETURN bit */ 648 cursrc.flags |= yystack.l_mark[-2].mapval; 649 else /* else unset it */ 650 cursrc.flags &= ~yystack.l_mark[-2].mapval; 651 } 652 break; 653 case 18: 654 #line 141 "../../freebsd/lib/libc/net/nsparser.y" 655 { yyval.mapval = NS_SUCCESS; } 656 break; 657 case 19: 658 #line 142 "../../freebsd/lib/libc/net/nsparser.y" 659 { yyval.mapval = NS_UNAVAIL; } 660 break; 661 case 20: 662 #line 143 "../../freebsd/lib/libc/net/nsparser.y" 663 { yyval.mapval = NS_NOTFOUND; } 664 break; 665 case 21: 666 #line 144 "../../freebsd/lib/libc/net/nsparser.y" 667 { yyval.mapval = NS_TRYAGAIN; } 668 break; 669 case 22: 670 #line 148 "../../freebsd/lib/libc/net/nsparser.y" 671 { yyval.mapval = NS_ACTION_RETURN; } 672 break; 673 case 23: 674 #line 149 "../../freebsd/lib/libc/net/nsparser.y" 675 { yyval.mapval = NS_ACTION_CONTINUE; } 676 break; 677 #line 678 "_nsyy.tab.c" 678 } 679 yystack.s_mark -= yym; 680 yystate = *yystack.s_mark; 681 yystack.l_mark -= yym; 682 yym = yylhs[yyn]; 683 if (yystate == 0 && yym == 0) 684 { 685 #if YYDEBUG 686 if (yydebug) 687 printf("%sdebug: after reduction, shifting from state 0 to\ 688 state %d\n", YYPREFIX, YYFINAL); 689 #endif 690 yystate = YYFINAL; 691 *++yystack.s_mark = YYFINAL; 692 *++yystack.l_mark = yyval; 693 if (yychar < 0) 694 { 695 if ((yychar = YYLEX) < 0) yychar = YYEOF; 696 #if YYDEBUG 697 if (yydebug) 698 { 699 yys = yyname[YYTRANSLATE(yychar)]; 700 printf("%sdebug: state %d, reading %d (%s)\n", 701 YYPREFIX, YYFINAL, yychar, yys); 702 } 703 #endif 704 } 705 if (yychar == YYEOF) goto yyaccept; 706 goto yyloop; 707 } 708 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && 709 yyn <= YYTABLESIZE && yycheck[yyn] == yystate) 710 yystate = yytable[yyn]; 711 else 712 yystate = yydgoto[yym]; 713 #if YYDEBUG 714 if (yydebug) 715 printf("%sdebug: after reduction, shifting from state %d \ 716 to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 717 #endif 718 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 719 { 720 goto yyoverflow; 721 } 722 *++yystack.s_mark = (YYINT) yystate; 723 *++yystack.l_mark = yyval; 724 goto yyloop; 725 726 yyoverflow: 727 YYERROR_CALL("yacc stack overflow"); 728 729 yyabort: 730 yyfreestack(&yystack); 731 return (1); 732 733 yyaccept: 734 yyfreestack(&yystack); 735 return (0); 736 } -
freebsd/lib/libipsec/policy_parse.c
r11ec988 re35a65e 1 /* A Bison parser, made by GNU Bison 2.7. */ 2 3 /* Bison implementation for Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19 20 /* As a special exception, you may create a larger work that contains 21 part or all of the Bison parser skeleton and distribute that work 22 under terms of your choice, so long as that work isn't itself a 23 parser generator using the skeleton or a modified version thereof 24 as a parser skeleton. Alternatively, if you modify or redistribute 25 the parser skeleton itself, you may (at your option) remove this 26 special exception, which will cause the skeleton and the resulting 27 Bison output files to be licensed under the GNU General Public 28 License without this special exception. 29 30 This special exception was added by the Free Software Foundation in 31 version 2.2 of Bison. */ 32 33 /* C LALR(1) parser skeleton written by Richard Stallman, by 34 simplifying the original so-called "semantic" parser. */ 35 36 /* All symbols defined below should begin with yy or YY, to avoid 37 infringing on user name space. This should be done even for local 38 variables, as they might otherwise be expanded by user macros. 39 There are some unavoidable exceptions within include files to 40 define necessary library symbols; they are noted "INFRINGES ON 41 USER NAME SPACE" below. */ 42 43 /* Identify Bison output. */ 44 #define YYBISON 1 45 46 /* Bison version. */ 47 #define YYBISON_VERSION "2.7" 48 49 /* Skeleton name. */ 50 #define YYSKELETON_NAME "yacc.c" 51 52 /* Pure parsers. */ 1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 9 #define YYEMPTY (-1) 10 #define yyclearin (yychar = YYEMPTY) 11 #define yyerrok (yyerrflag = 0) 12 #define YYRECOVERING() (yyerrflag != 0) 13 #define YYENOMEM (-2) 14 #define YYEOF 0 15 16 #ifndef yyparse 17 #define yyparse __libipsecyyparse 18 #endif /* yyparse */ 19 20 #ifndef yylex 21 #define yylex __libipsecyylex 22 #endif /* yylex */ 23 24 #ifndef yyerror 25 #define yyerror __libipsecyyerror 26 #endif /* yyerror */ 27 28 #ifndef yychar 29 #define yychar __libipsecyychar 30 #endif /* yychar */ 31 32 #ifndef yyval 33 #define yyval __libipsecyyval 34 #endif /* yyval */ 35 36 #ifndef yylval 37 #define yylval __libipsecyylval 38 #endif /* yylval */ 39 40 #ifndef yydebug 41 #define yydebug __libipsecyydebug 42 #endif /* yydebug */ 43 44 #ifndef yynerrs 45 #define yynerrs __libipsecyynerrs 46 #endif /* yynerrs */ 47 48 #ifndef yyerrflag 49 #define yyerrflag __libipsecyyerrflag 50 #endif /* yyerrflag */ 51 52 #ifndef yylhs 53 #define yylhs __libipsecyylhs 54 #endif /* yylhs */ 55 56 #ifndef yylen 57 #define yylen __libipsecyylen 58 #endif /* yylen */ 59 60 #ifndef yydefred 61 #define yydefred __libipsecyydefred 62 #endif /* yydefred */ 63 64 #ifndef yydgoto 65 #define yydgoto __libipsecyydgoto 66 #endif /* yydgoto */ 67 68 #ifndef yysindex 69 #define yysindex __libipsecyysindex 70 #endif /* yysindex */ 71 72 #ifndef yyrindex 73 #define yyrindex __libipsecyyrindex 74 #endif /* yyrindex */ 75 76 #ifndef yygindex 77 #define yygindex __libipsecyygindex 78 #endif /* yygindex */ 79 80 #ifndef yytable 81 #define yytable __libipsecyytable 82 #endif /* yytable */ 83 84 #ifndef yycheck 85 #define yycheck __libipsecyycheck 86 #endif /* yycheck */ 87 88 #ifndef yyname 89 #define yyname __libipsecyyname 90 #endif /* yyname */ 91 92 #ifndef yyrule 93 #define yyrule __libipsecyyrule 94 #endif /* yyrule */ 95 #define YYPREFIX "__libipsecyy" 96 53 97 #define YYPURE 0 54 98 55 /* Push parsers. */ 56 #define YYPUSH 0 57 58 /* Pull parsers. */ 59 #define YYPULL 1 60 61 62 /* Substitute the variable and function names. */ 63 #define yyparse __libipsecyyparse 64 #define yylex __libipsecyylex 65 #define yyerror __libipsecyyerror 66 #define yylval __libipsecyylval 67 #define yychar __libipsecyychar 68 #define yydebug __libipsecyydebug 69 #define yynerrs __libipsecyynerrs 70 71 /* Copy the first part of user declarations. */ 72 /* Line 371 of yacc.c */ 73 #line 51 "freebsd/lib/libipsec/policy_parse.y" 74 99 #line 52 "../../freebsd/lib/libipsec/policy_parse.y" 75 100 #include <sys/cdefs.h> 76 101 __FBSDID("$FreeBSD$"); … … 117 142 extern char *__libipsecyytext; /*XXX*/ 118 143 119 120 /* Line 371 of yacc.c */ 121 #line 122 "__libipsecyy.tab.c" 122 123 # ifndef YY_NULL 124 # if defined __cplusplus && 201103L <= __cplusplus 125 # define YY_NULL nullptr 126 # else 127 # define YY_NULL 0 128 # endif 129 # endif 130 131 /* Enabling verbose error messages. */ 132 #ifdef YYERROR_VERBOSE 133 # undef YYERROR_VERBOSE 134 # define YYERROR_VERBOSE 1 135 #else 136 # define YYERROR_VERBOSE 0 137 #endif 138 139 /* In a future release of Bison, this section will be replaced 140 by #include "__libipsecyy.tab.h". */ 141 #ifndef YY__LIBIPSECYY_LIBIPSECYY_TAB_H_INCLUDED 142 # define YY__LIBIPSECYY_LIBIPSECYY_TAB_H_INCLUDED 143 /* Enabling traces. */ 144 #ifndef YYDEBUG 145 # define YYDEBUG 0 146 #endif 147 #if YYDEBUG 148 extern int __libipsecyydebug; 149 #endif 150 151 /* Tokens. */ 152 #ifndef YYTOKENTYPE 153 # define YYTOKENTYPE 154 /* Put the tokens into the symbol table, so that GDB and other debuggers 155 know about them. */ 156 enum yytokentype { 157 DIR = 258, 158 ACTION = 259, 159 PROTOCOL = 260, 160 MODE = 261, 161 LEVEL = 262, 162 LEVEL_SPECIFY = 263, 163 IPADDRESS = 264, 164 ME = 265, 165 ANY = 266, 166 SLASH = 267, 167 HYPHEN = 268 168 }; 169 #endif 170 /* Tokens. */ 171 #define DIR 258 172 #define ACTION 259 173 #define PROTOCOL 260 174 #define MODE 261 175 #define LEVEL 262 176 #define LEVEL_SPECIFY 263 177 #define IPADDRESS 264 178 #define ME 265 179 #define ANY 266 180 #define SLASH 267 181 #define HYPHEN 268 182 183 184 185 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 186 typedef union YYSTYPE 187 { 188 /* Line 387 of yacc.c */ 189 #line 98 "freebsd/lib/libipsec/policy_parse.y" 190 144 #line 98 "../../freebsd/lib/libipsec/policy_parse.y" 145 #ifdef YYSTYPE 146 #undef YYSTYPE_IS_DECLARED 147 #define YYSTYPE_IS_DECLARED 1 148 #endif 149 #ifndef YYSTYPE_IS_DECLARED 150 #define YYSTYPE_IS_DECLARED 1 151 typedef union { 191 152 u_int num; 192 153 struct _val { … … 194 155 char *buf; 195 156 } val; 196 197 198 /* Line 387 of yacc.c */199 #line 200 "__libipsecyy.tab.c"200 157 } YYSTYPE; 201 # define YYSTYPE_IS_TRIVIAL 1 202 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 203 # define YYSTYPE_IS_DECLARED 1 204 #endif 205 206 extern YYSTYPE __libipsecyylval; 207 158 #endif /* !YYSTYPE_IS_DECLARED */ 159 #line 160 "__libipsecyy.tab.c" 160 161 /* compatibility with bison */ 208 162 #ifdef YYPARSE_PARAM 209 #if defined __STDC__ || defined __cplusplus 210 int __libipsecyyparse (void *YYPARSE_PARAM); 163 /* compatibility with FreeBSD */ 164 # ifdef YYPARSE_PARAM_TYPE 165 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 166 # else 167 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 168 # endif 211 169 #else 212 int __libipsecyyparse (); 213 #endif 214 #else /* ! YYPARSE_PARAM */ 215 #if defined __STDC__ || defined __cplusplus 216 int __libipsecyyparse (void); 170 # define YYPARSE_DECL() yyparse(void) 171 #endif 172 173 /* Parameters sent to lex. */ 174 #ifdef YYLEX_PARAM 175 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 176 # define YYLEX yylex(YYLEX_PARAM) 217 177 #else 218 int __libipsecyyparse (); 219 #endif 220 #endif /* ! YYPARSE_PARAM */ 221 222 #endif /* !YY__LIBIPSECYY_LIBIPSECYY_TAB_H_INCLUDED */ 223 224 /* Copy the second part of user declarations. */ 225 226 /* Line 390 of yacc.c */ 227 #line 228 "__libipsecyy.tab.c" 228 229 #ifdef short 230 # undef short 231 #endif 232 233 #ifdef YYTYPE_UINT8 234 typedef YYTYPE_UINT8 yytype_uint8; 178 # define YYLEX_DECL() yylex(void) 179 # define YYLEX yylex() 180 #endif 181 182 /* Parameters sent to yyerror. */ 183 #ifndef YYERROR_DECL 184 #define YYERROR_DECL() yyerror(const char *s) 185 #endif 186 #ifndef YYERROR_CALL 187 #define YYERROR_CALL(msg) yyerror(msg) 188 #endif 189 190 extern int YYPARSE_DECL(); 191 192 #define DIR 257 193 #define ACTION 258 194 #define PROTOCOL 259 195 #define MODE 260 196 #define LEVEL 261 197 #define LEVEL_SPECIFY 262 198 #define IPADDRESS 263 199 #define ME 264 200 #define ANY 265 201 #define SLASH 266 202 #define HYPHEN 267 203 #define YYERRCODE 256 204 typedef short YYINT; 205 static const YYINT __libipsecyylhs[] = { -1, 206 2, 0, 0, 1, 1, 3, 3, 3, 3, 3, 207 3, 3, 3, 4, 5, 7, 7, 8, 6, 6, 208 6, 209 }; 210 static const YYINT __libipsecyylen[] = { 2, 211 0, 4, 1, 0, 2, 7, 6, 5, 4, 6, 212 3, 2, 1, 1, 1, 1, 1, 0, 4, 3, 213 3, 214 }; 215 static const YYINT __libipsecyydefred[] = { 0, 216 0, 0, 1, 4, 0, 14, 5, 0, 0, 15, 217 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 218 16, 17, 10, 0, 0, 20, 21, 6, 19, 219 }; 220 static const YYINT __libipsecyydgoto[] = { 2, 221 5, 4, 7, 8, 11, 17, 23, 18, 222 }; 223 static const YYINT __libipsecyysindex[] = { -257, 224 -245, 0, 0, 0, -244, 0, 0, -252, -243, 0, 225 -248, -256, 0, -251, -247, -250, -242, -246, -240, -241, 226 0, 0, 0, -250, -237, 0, 0, 0, 0, 227 }; 228 static const YYINT __libipsecyyrindex[] = { 0, 229 19, 0, 0, 0, 22, 0, 0, 1, 2, 0, 230 3, 4, 0, 0, 0, 0, 5, 0, 0, 0, 231 0, 0, 0, 6, 0, 0, 0, 0, 0, 232 }; 233 static const YYINT __libipsecyygindex[] = { 0, 234 0, 0, 0, 0, 0, 0, 7, 0, 235 }; 236 #define YYTABLESIZE 265 237 static const YYINT __libipsecyytable[] = { 1, 238 13, 12, 11, 9, 8, 7, 13, 14, 15, 16, 239 21, 22, 3, 9, 6, 19, 10, 12, 3, 20, 240 25, 2, 27, 24, 26, 29, 0, 0, 0, 0, 241 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 262 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 263 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 264 12, 11, 9, 8, 7, 265 }; 266 static const YYINT __libipsecyycheck[] = { 257, 267 0, 0, 0, 0, 0, 0, 263, 264, 265, 266, 268 261, 262, 258, 266, 259, 267, 260, 266, 0, 267, 269 267, 0, 264, 266, 265, 263, -1, -1, -1, -1, 270 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 279 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 282 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 287 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 288 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 289 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 290 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 292 -1, -1, -1, -1, -1, -1, -1, -1, -1, 259, 293 259, 259, 259, 259, 259, 294 }; 295 #define YYFINAL 2 296 #ifndef YYDEBUG 297 #define YYDEBUG 0 298 #endif 299 #define YYMAXTOKEN 267 300 #define YYUNDFTOKEN 278 301 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 302 #if YYDEBUG 303 static const char *const __libipsecyyname[] = { 304 305 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 306 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 307 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 308 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 309 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 310 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 311 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"DIR","ACTION","PROTOCOL","MODE", 312 "LEVEL","LEVEL_SPECIFY","IPADDRESS","ME","ANY","SLASH","HYPHEN",0,0,0,0,0,0,0,0, 313 0,0,"illegal-symbol", 314 }; 315 static const char *const __libipsecyyrule[] = { 316 "$accept : policy_spec", 317 "$$1 :", 318 "policy_spec : DIR ACTION $$1 rules", 319 "policy_spec : DIR", 320 "rules :", 321 "rules : rules rule", 322 "rule : protocol SLASH mode SLASH addresses SLASH level", 323 "rule : protocol SLASH mode SLASH addresses SLASH", 324 "rule : protocol SLASH mode SLASH addresses", 325 "rule : protocol SLASH mode SLASH", 326 "rule : protocol SLASH mode SLASH SLASH level", 327 "rule : protocol SLASH mode", 328 "rule : protocol SLASH", 329 "rule : protocol", 330 "protocol : PROTOCOL", 331 "mode : MODE", 332 "level : LEVEL", 333 "level : LEVEL_SPECIFY", 334 "$$2 :", 335 "addresses : IPADDRESS $$2 HYPHEN IPADDRESS", 336 "addresses : ME HYPHEN ANY", 337 "addresses : ANY HYPHEN ME", 338 339 }; 340 #endif 341 342 int yydebug; 343 int yynerrs; 344 345 int yyerrflag; 346 int yychar; 347 YYSTYPE yyval; 348 YYSTYPE yylval; 349 350 /* define the initial stack-sizes */ 351 #ifdef YYSTACKSIZE 352 #undef YYMAXDEPTH 353 #define YYMAXDEPTH YYSTACKSIZE 235 354 #else 236 typedef unsigned char yytype_uint8; 237 #endif 238 239 #ifdef YYTYPE_INT8 240 typedef YYTYPE_INT8 yytype_int8; 241 #elif (defined __STDC__ || defined __C99__FUNC__ \ 242 || defined __cplusplus || defined _MSC_VER) 243 typedef signed char yytype_int8; 355 #ifdef YYMAXDEPTH 356 #define YYSTACKSIZE YYMAXDEPTH 244 357 #else 245 typedef short int yytype_int8; 246 #endif 247 248 #ifdef YYTYPE_UINT16 249 typedef YYTYPE_UINT16 yytype_uint16; 250 #else 251 typedef unsigned short int yytype_uint16; 252 #endif 253 254 #ifdef YYTYPE_INT16 255 typedef YYTYPE_INT16 yytype_int16; 256 #else 257 typedef short int yytype_int16; 258 #endif 259 260 #ifndef YYSIZE_T 261 # ifdef __SIZE_TYPE__ 262 # define YYSIZE_T __SIZE_TYPE__ 263 # elif defined size_t 264 # define YYSIZE_T size_t 265 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 266 || defined __cplusplus || defined _MSC_VER) 267 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 268 # define YYSIZE_T size_t 269 # else 270 # define YYSIZE_T unsigned int 271 # endif 272 #endif 273 274 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 275 276 #ifndef YY_ 277 # if defined YYENABLE_NLS && YYENABLE_NLS 278 # if ENABLE_NLS 279 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 280 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 281 # endif 282 # endif 283 # ifndef YY_ 284 # define YY_(Msgid) Msgid 285 # endif 286 #endif 287 288 /* Suppress unused-variable warnings by "using" E. */ 289 #if ! defined lint || defined __GNUC__ 290 # define YYUSE(E) ((void) (E)) 291 #else 292 # define YYUSE(E) /* empty */ 293 #endif 294 295 /* Identity function, used to suppress warnings about constant conditions. */ 296 #ifndef lint 297 # define YYID(N) (N) 298 #else 299 #if (defined __STDC__ || defined __C99__FUNC__ \ 300 || defined __cplusplus || defined _MSC_VER) 301 static int 302 YYID (int yyi) 303 #else 304 static int 305 YYID (yyi) 306 int yyi; 307 #endif 308 { 309 return yyi; 310 } 311 #endif 312 313 #if ! defined yyoverflow || YYERROR_VERBOSE 314 315 /* The parser invokes alloca or malloc; define the necessary symbols. */ 316 317 # ifdef YYSTACK_USE_ALLOCA 318 # if YYSTACK_USE_ALLOCA 319 # ifdef __GNUC__ 320 # define YYSTACK_ALLOC __builtin_alloca 321 # elif defined __BUILTIN_VA_ARG_INCR 322 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 323 # elif defined _AIX 324 # define YYSTACK_ALLOC __alloca 325 # elif defined _MSC_VER 326 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 327 # define alloca _alloca 328 # else 329 # define YYSTACK_ALLOC alloca 330 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 331 || defined __cplusplus || defined _MSC_VER) 332 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 333 /* Use EXIT_SUCCESS as a witness for stdlib.h. */ 334 # ifndef EXIT_SUCCESS 335 # define EXIT_SUCCESS 0 336 # endif 337 # endif 338 # endif 339 # endif 340 # endif 341 342 # ifdef YYSTACK_ALLOC 343 /* Pacify GCC's `empty if-body' warning. */ 344 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 345 # ifndef YYSTACK_ALLOC_MAXIMUM 346 /* The OS might guarantee only one guard page at the bottom of the stack, 347 and a page size can be as small as 4096 bytes. So we cannot safely 348 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 349 to allow for a few compiler-allocated temporary stack slots. */ 350 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 351 # endif 352 # else 353 # define YYSTACK_ALLOC YYMALLOC 354 # define YYSTACK_FREE YYFREE 355 # ifndef YYSTACK_ALLOC_MAXIMUM 356 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 357 # endif 358 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 359 && ! ((defined YYMALLOC || defined malloc) \ 360 && (defined YYFREE || defined free))) 361 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 362 # ifndef EXIT_SUCCESS 363 # define EXIT_SUCCESS 0 364 # endif 365 # endif 366 # ifndef YYMALLOC 367 # define YYMALLOC malloc 368 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 369 || defined __cplusplus || defined _MSC_VER) 370 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 371 # endif 372 # endif 373 # ifndef YYFREE 374 # define YYFREE free 375 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 376 || defined __cplusplus || defined _MSC_VER) 377 void free (void *); /* INFRINGES ON USER NAME SPACE */ 378 # endif 379 # endif 380 # endif 381 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 382 383 384 #if (! defined yyoverflow \ 385 && (! defined __cplusplus \ 386 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 387 388 /* A type that is properly aligned for any stack member. */ 389 union yyalloc 390 { 391 yytype_int16 yyss_alloc; 392 YYSTYPE yyvs_alloc; 393 }; 394 395 /* The size of the maximum gap between one aligned stack and the next. */ 396 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 397 398 /* The size of an array large to enough to hold all stacks, each with 399 N elements. */ 400 # define YYSTACK_BYTES(N) \ 401 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 402 + YYSTACK_GAP_MAXIMUM) 403 404 # define YYCOPY_NEEDED 1 405 406 /* Relocate STACK from its old location to the new one. The 407 local variables YYSIZE and YYSTACKSIZE give the old and new number of 408 elements in the stack, and YYPTR gives the new location of the 409 stack. Advance YYPTR to a properly aligned location for the next 410 stack. */ 411 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 412 do \ 413 { \ 414 YYSIZE_T yynewbytes; \ 415 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 416 Stack = &yyptr->Stack_alloc; \ 417 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 418 yyptr += yynewbytes / sizeof (*yyptr); \ 419 } \ 420 while (YYID (0)) 421 422 #endif 423 424 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 425 /* Copy COUNT objects from SRC to DST. The source and destination do 426 not overlap. */ 427 # ifndef YYCOPY 428 # if defined __GNUC__ && 1 < __GNUC__ 429 # define YYCOPY(Dst, Src, Count) \ 430 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 431 # else 432 # define YYCOPY(Dst, Src, Count) \ 433 do \ 434 { \ 435 YYSIZE_T yyi; \ 436 for (yyi = 0; yyi < (Count); yyi++) \ 437 (Dst)[yyi] = (Src)[yyi]; \ 438 } \ 439 while (YYID (0)) 440 # endif 441 # endif 442 #endif /* !YYCOPY_NEEDED */ 443 444 /* YYFINAL -- State number of the termination state. */ 445 #define YYFINAL 4 446 /* YYLAST -- Last index in YYTABLE. */ 447 #define YYLAST 24 448 449 /* YYNTOKENS -- Number of terminals. */ 450 #define YYNTOKENS 14 451 /* YYNNTS -- Number of nonterminals. */ 452 #define YYNNTS 10 453 /* YYNRULES -- Number of rules. */ 454 #define YYNRULES 22 455 /* YYNRULES -- Number of states. */ 456 #define YYNSTATES 31 457 458 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 459 #define YYUNDEFTOK 2 460 #define YYMAXUTOK 268 461 462 #define YYTRANSLATE(YYX) \ 463 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 464 465 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 466 static const yytype_uint8 yytranslate[] = 467 { 468 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 493 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 494 5, 6, 7, 8, 9, 10, 11, 12, 13 495 }; 496 497 #if YYDEBUG 498 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 499 YYRHS. */ 500 static const yytype_uint8 yyprhs[] = 501 { 502 0, 0, 3, 4, 9, 11, 12, 15, 23, 30, 503 36, 41, 48, 52, 55, 57, 59, 61, 63, 65, 504 66, 71, 75 505 }; 506 507 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 508 static const yytype_int8 yyrhs[] = 509 { 510 15, 0, -1, -1, 3, 4, 16, 17, -1, 3, 511 -1, -1, 17, 18, -1, 19, 12, 20, 12, 22, 512 12, 21, -1, 19, 12, 20, 12, 22, 12, -1, 513 19, 12, 20, 12, 22, -1, 19, 12, 20, 12, 514 -1, 19, 12, 20, 12, 12, 21, -1, 19, 12, 515 20, -1, 19, 12, -1, 19, -1, 5, -1, 6, 516 -1, 7, -1, 8, -1, -1, 9, 23, 13, 9, 517 -1, 10, 13, 11, -1, 11, 13, 10, -1 518 }; 519 520 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 521 static const yytype_uint8 yyrline[] = 522 { 523 0, 116, 116, 115, 124, 134, 136, 148, 149, 150, 524 151, 152, 153, 154, 158, 165, 169, 173, 177, 184, 525 184, 195, 201 526 }; 527 #endif 528 529 #if YYDEBUG || YYERROR_VERBOSE || 0 530 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 531 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 532 static const char *const yytname[] = 533 { 534 "$end", "error", "$undefined", "DIR", "ACTION", "PROTOCOL", "MODE", 535 "LEVEL", "LEVEL_SPECIFY", "IPADDRESS", "ME", "ANY", "SLASH", "HYPHEN", 536 "$accept", "policy_spec", "$@1", "rules", "rule", "protocol", "mode", 537 "level", "addresses", "$@2", YY_NULL 538 }; 539 #endif 540 541 # ifdef YYPRINT 542 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 543 token YYLEX-NUM. */ 544 static const yytype_uint16 yytoknum[] = 545 { 546 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 547 265, 266, 267, 268 548 }; 549 # endif 550 551 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 552 static const yytype_uint8 yyr1[] = 553 { 554 0, 14, 16, 15, 15, 17, 17, 18, 18, 18, 555 18, 18, 18, 18, 18, 19, 20, 21, 21, 23, 556 22, 22, 22 557 }; 558 559 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 560 static const yytype_uint8 yyr2[] = 561 { 562 0, 2, 0, 4, 1, 0, 2, 7, 6, 5, 563 4, 6, 3, 2, 1, 1, 1, 1, 1, 0, 564 4, 3, 3 565 }; 566 567 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 568 Performed when YYTABLE doesn't specify something else to do. Zero 569 means the default is an error. */ 570 static const yytype_uint8 yydefact[] = 571 { 572 0, 4, 0, 2, 1, 5, 3, 15, 6, 14, 573 13, 16, 12, 10, 19, 0, 0, 0, 9, 0, 574 0, 0, 17, 18, 11, 8, 0, 21, 22, 7, 575 20 576 }; 577 578 /* YYDEFGOTO[NTERM-NUM]. */ 579 static const yytype_int8 yydefgoto[] = 580 { 581 -1, 2, 5, 6, 8, 9, 12, 24, 18, 19 582 }; 583 584 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 585 STATE-NUM. */ 586 #define YYPACT_NINF -12 587 static const yytype_int8 yypact[] = 588 { 589 3, 4, 7, -12, -12, -12, 5, -12, -12, -1, 590 6, -12, 1, -9, -12, -4, 2, -3, 8, 9, 591 10, 13, -12, -12, -12, -3, 15, -12, -12, -12, 592 -12 593 }; 594 595 /* YYPGOTO[NTERM-NUM]. */ 596 static const yytype_int8 yypgoto[] = 597 { 598 -12, -12, -12, -12, -12, -12, -12, -11, -12, -12 599 }; 600 601 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 602 positive, shift that token. If negative, reduce the rule which 603 number is the opposite. If YYTABLE_NINF, syntax error. */ 604 #define YYTABLE_NINF -1 605 static const yytype_uint8 yytable[] = 606 { 607 14, 15, 16, 17, 22, 23, 1, 4, 3, 20, 608 7, 10, 11, 13, 29, 21, 0, 0, 0, 0, 609 25, 27, 26, 28, 30 610 }; 611 612 #define yypact_value_is_default(Yystate) \ 613 (!!((Yystate) == (-12))) 614 615 #define yytable_value_is_error(Yytable_value) \ 616 YYID (0) 617 618 static const yytype_int8 yycheck[] = 619 { 620 9, 10, 11, 12, 7, 8, 3, 0, 4, 13, 621 5, 12, 6, 12, 25, 13, -1, -1, -1, -1, 622 12, 11, 13, 10, 9 623 }; 624 625 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 626 symbol of state STATE-NUM. */ 627 static const yytype_uint8 yystos[] = 628 { 629 0, 3, 15, 4, 0, 16, 17, 5, 18, 19, 630 12, 6, 20, 12, 9, 10, 11, 12, 22, 23, 631 13, 13, 7, 8, 21, 12, 13, 11, 10, 21, 632 9 633 }; 634 635 #define yyerrok (yyerrstatus = 0) 636 #define yyclearin (yychar = YYEMPTY) 637 #define YYEMPTY (-2) 638 #define YYEOF 0 639 640 #define YYACCEPT goto yyacceptlab 641 #define YYABORT goto yyabortlab 642 #define YYERROR goto yyerrorlab 643 644 645 /* Like YYERROR except do call yyerror. This remains here temporarily 646 to ease the transition to the new meaning of YYERROR, for GCC. 647 Once GCC version 2 has supplanted version 1, this can go. However, 648 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 649 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 650 discussed. */ 651 652 #define YYFAIL goto yyerrlab 653 #if defined YYFAIL 654 /* This is here to suppress warnings from the GCC cpp's 655 -Wunused-macros. Normally we don't worry about that warning, but 656 some users do, and we want to make it easy for users to remove 657 YYFAIL uses, which will produce warnings from Bison 2.5. */ 658 #endif 659 660 #define YYRECOVERING() (!!yyerrstatus) 661 662 #define YYBACKUP(Token, Value) \ 663 do \ 664 if (yychar == YYEMPTY) \ 665 { \ 666 yychar = (Token); \ 667 yylval = (Value); \ 668 YYPOPSTACK (yylen); \ 669 yystate = *yyssp; \ 670 goto yybackup; \ 671 } \ 672 else \ 673 { \ 674 yyerror (YY_("syntax error: cannot back up")); \ 675 YYERROR; \ 676 } \ 677 while (YYID (0)) 678 679 /* Error token number */ 680 #define YYTERROR 1 681 #define YYERRCODE 256 682 683 684 /* This macro is provided for backward compatibility. */ 685 #ifndef YY_LOCATION_PRINT 686 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 687 #endif 688 689 690 /* YYLEX -- calling `yylex' with the right arguments. */ 691 #ifdef YYLEX_PARAM 692 # define YYLEX yylex (YYLEX_PARAM) 693 #else 694 # define YYLEX yylex () 695 #endif 696 697 /* Enable debugging if requested. */ 698 #if YYDEBUG 699 700 # ifndef YYFPRINTF 701 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 702 # define YYFPRINTF fprintf 703 # endif 704 705 # define YYDPRINTF(Args) \ 706 do { \ 707 if (yydebug) \ 708 YYFPRINTF Args; \ 709 } while (YYID (0)) 710 711 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 712 do { \ 713 if (yydebug) \ 714 { \ 715 YYFPRINTF (stderr, "%s ", Title); \ 716 yy_symbol_print (stderr, \ 717 Type, Value); \ 718 YYFPRINTF (stderr, "\n"); \ 719 } \ 720 } while (YYID (0)) 721 722 723 /*--------------------------------. 724 | Print this symbol on YYOUTPUT. | 725 `--------------------------------*/ 726 727 /*ARGSUSED*/ 728 #if (defined __STDC__ || defined __C99__FUNC__ \ 729 || defined __cplusplus || defined _MSC_VER) 730 static void 731 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 732 #else 733 static void 734 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 735 FILE *yyoutput; 736 int yytype; 737 YYSTYPE const * const yyvaluep; 738 #endif 739 { 740 FILE *yyo = yyoutput; 741 YYUSE (yyo); 742 if (!yyvaluep) 743 return; 744 # ifdef YYPRINT 745 if (yytype < YYNTOKENS) 746 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 747 # else 748 YYUSE (yyoutput); 749 # endif 750 switch (yytype) 751 { 752 default: 753 break; 754 } 755 } 756 757 758 /*--------------------------------. 759 | Print this symbol on YYOUTPUT. | 760 `--------------------------------*/ 761 762 #if (defined __STDC__ || defined __C99__FUNC__ \ 763 || defined __cplusplus || defined _MSC_VER) 764 static void 765 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 766 #else 767 static void 768 yy_symbol_print (yyoutput, yytype, yyvaluep) 769 FILE *yyoutput; 770 int yytype; 771 YYSTYPE const * const yyvaluep; 772 #endif 773 { 774 if (yytype < YYNTOKENS) 775 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 776 else 777 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 778 779 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 780 YYFPRINTF (yyoutput, ")"); 781 } 782 783 /*------------------------------------------------------------------. 784 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 785 | TOP (included). | 786 `------------------------------------------------------------------*/ 787 788 #if (defined __STDC__ || defined __C99__FUNC__ \ 789 || defined __cplusplus || defined _MSC_VER) 790 static void 791 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 792 #else 793 static void 794 yy_stack_print (yybottom, yytop) 795 yytype_int16 *yybottom; 796 yytype_int16 *yytop; 797 #endif 798 { 799 YYFPRINTF (stderr, "Stack now"); 800 for (; yybottom <= yytop; yybottom++) 801 { 802 int yybot = *yybottom; 803 YYFPRINTF (stderr, " %d", yybot); 804 } 805 YYFPRINTF (stderr, "\n"); 806 } 807 808 # define YY_STACK_PRINT(Bottom, Top) \ 809 do { \ 810 if (yydebug) \ 811 yy_stack_print ((Bottom), (Top)); \ 812 } while (YYID (0)) 813 814 815 /*------------------------------------------------. 816 | Report that the YYRULE is going to be reduced. | 817 `------------------------------------------------*/ 818 819 #if (defined __STDC__ || defined __C99__FUNC__ \ 820 || defined __cplusplus || defined _MSC_VER) 821 static void 822 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 823 #else 824 static void 825 yy_reduce_print (yyvsp, yyrule) 826 YYSTYPE *yyvsp; 827 int yyrule; 828 #endif 829 { 830 int yynrhs = yyr2[yyrule]; 831 int yyi; 832 unsigned long int yylno = yyrline[yyrule]; 833 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 834 yyrule - 1, yylno); 835 /* The symbols being reduced. */ 836 for (yyi = 0; yyi < yynrhs; yyi++) 837 { 838 YYFPRINTF (stderr, " $%d = ", yyi + 1); 839 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 840 &(yyvsp[(yyi + 1) - (yynrhs)]) 841 ); 842 YYFPRINTF (stderr, "\n"); 843 } 844 } 845 846 # define YY_REDUCE_PRINT(Rule) \ 847 do { \ 848 if (yydebug) \ 849 yy_reduce_print (yyvsp, Rule); \ 850 } while (YYID (0)) 851 852 /* Nonzero means print parse trace. It is left uninitialized so that 853 multiple parsers can coexist. */ 854 int yydebug; 855 #else /* !YYDEBUG */ 856 # define YYDPRINTF(Args) 857 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 858 # define YY_STACK_PRINT(Bottom, Top) 859 # define YY_REDUCE_PRINT(Rule) 860 #endif /* !YYDEBUG */ 861 862 863 /* YYINITDEPTH -- initial size of the parser's stacks. */ 864 #ifndef YYINITDEPTH 865 # define YYINITDEPTH 200 866 #endif 867 868 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 869 if the built-in stack extension method is used). 870 871 Do not make this value too large; the results are undefined if 872 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 873 evaluated with infinite-precision integer arithmetic. */ 874 875 #ifndef YYMAXDEPTH 876 # define YYMAXDEPTH 10000 877 #endif 878 879 880 #if YYERROR_VERBOSE 881 882 # ifndef yystrlen 883 # if defined __GLIBC__ && defined _STRING_H 884 # define yystrlen strlen 885 # else 886 /* Return the length of YYSTR. */ 887 #if (defined __STDC__ || defined __C99__FUNC__ \ 888 || defined __cplusplus || defined _MSC_VER) 889 static YYSIZE_T 890 yystrlen (const char *yystr) 891 #else 892 static YYSIZE_T 893 yystrlen (yystr) 894 const char *yystr; 895 #endif 896 { 897 YYSIZE_T yylen; 898 for (yylen = 0; yystr[yylen]; yylen++) 899 continue; 900 return yylen; 901 } 902 # endif 903 # endif 904 905 # ifndef yystpcpy 906 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 907 # define yystpcpy stpcpy 908 # else 909 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 910 YYDEST. */ 911 #if (defined __STDC__ || defined __C99__FUNC__ \ 912 || defined __cplusplus || defined _MSC_VER) 913 static char * 914 yystpcpy (char *yydest, const char *yysrc) 915 #else 916 static char * 917 yystpcpy (yydest, yysrc) 918 char *yydest; 919 const char *yysrc; 920 #endif 921 { 922 char *yyd = yydest; 923 const char *yys = yysrc; 924 925 while ((*yyd++ = *yys++) != '\0') 926 continue; 927 928 return yyd - 1; 929 } 930 # endif 931 # endif 932 933 # ifndef yytnamerr 934 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 935 quotes and backslashes, so that it's suitable for yyerror. The 936 heuristic is that double-quoting is unnecessary unless the string 937 contains an apostrophe, a comma, or backslash (other than 938 backslash-backslash). YYSTR is taken from yytname. If YYRES is 939 null, do not copy; instead, return the length of what the result 940 would have been. */ 941 static YYSIZE_T 942 yytnamerr (char *yyres, const char *yystr) 943 { 944 if (*yystr == '"') 945 { 946 YYSIZE_T yyn = 0; 947 char const *yyp = yystr; 948 949 for (;;) 950 switch (*++yyp) 951 { 952 case '\'': 953 case ',': 954 goto do_not_strip_quotes; 955 956 case '\\': 957 if (*++yyp != '\\') 958 goto do_not_strip_quotes; 959 /* Fall through. */ 960 default: 961 if (yyres) 962 yyres[yyn] = *yyp; 963 yyn++; 964 break; 965 966 case '"': 967 if (yyres) 968 yyres[yyn] = '\0'; 969 return yyn; 970 } 971 do_not_strip_quotes: ; 972 } 973 974 if (! yyres) 975 return yystrlen (yystr); 976 977 return yystpcpy (yyres, yystr) - yyres; 978 } 979 # endif 980 981 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 982 about the unexpected token YYTOKEN for the state stack whose top is 983 YYSSP. 984 985 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 986 not large enough to hold the message. In that case, also set 987 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 988 required number of bytes is too large to store. */ 989 static int 990 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 991 yytype_int16 *yyssp, int yytoken) 992 { 993 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); 994 YYSIZE_T yysize = yysize0; 995 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 996 /* Internationalized format string. */ 997 const char *yyformat = YY_NULL; 998 /* Arguments of yyformat. */ 999 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1000 /* Number of reported tokens (one for the "unexpected", one per 1001 "expected"). */ 1002 int yycount = 0; 1003 1004 /* There are many possibilities here to consider: 1005 - Assume YYFAIL is not used. It's too flawed to consider. See 1006 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 1007 for details. YYERROR is fine as it does not invoke this 1008 function. 1009 - If this state is a consistent state with a default action, then 1010 the only way this function was invoked is if the default action 1011 is an error action. In that case, don't check for expected 1012 tokens because there are none. 1013 - The only way there can be no lookahead present (in yychar) is if 1014 this state is a consistent state with a default action. Thus, 1015 detecting the absence of a lookahead is sufficient to determine 1016 that there is no unexpected or expected token to report. In that 1017 case, just report a simple "syntax error". 1018 - Don't assume there isn't a lookahead just because this state is a 1019 consistent state with a default action. There might have been a 1020 previous inconsistent state, consistent state with a non-default 1021 action, or user semantic action that manipulated yychar. 1022 - Of course, the expected token list depends on states to have 1023 correct lookahead information, and it depends on the parser not 1024 to perform extra reductions after fetching a lookahead from the 1025 scanner and before detecting a syntax error. Thus, state merging 1026 (from LALR or IELR) and default reductions corrupt the expected 1027 token list. However, the list is correct for canonical LR with 1028 one exception: it will still contain any token that will not be 1029 accepted due to an error action in a later state. 1030 */ 1031 if (yytoken != YYEMPTY) 1032 { 1033 int yyn = yypact[*yyssp]; 1034 yyarg[yycount++] = yytname[yytoken]; 1035 if (!yypact_value_is_default (yyn)) 1036 { 1037 /* Start YYX at -YYN if negative to avoid negative indexes in 1038 YYCHECK. In other words, skip the first -YYN actions for 1039 this state because they are default actions. */ 1040 int yyxbegin = yyn < 0 ? -yyn : 0; 1041 /* Stay within bounds of both yycheck and yytname. */ 1042 int yychecklim = YYLAST - yyn + 1; 1043 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1044 int yyx; 1045 1046 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1047 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1048 && !yytable_value_is_error (yytable[yyx + yyn])) 1049 { 1050 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1051 { 1052 yycount = 1; 1053 yysize = yysize0; 1054 break; 1055 } 1056 yyarg[yycount++] = yytname[yyx]; 1057 { 1058 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); 1059 if (! (yysize <= yysize1 1060 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1061 return 2; 1062 yysize = yysize1; 1063 } 1064 } 1065 } 1066 } 1067 1068 switch (yycount) 1069 { 1070 # define YYCASE_(N, S) \ 1071 case N: \ 1072 yyformat = S; \ 1073 break 1074 YYCASE_(0, YY_("syntax error")); 1075 YYCASE_(1, YY_("syntax error, unexpected %s")); 1076 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1077 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1078 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1079 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1080 # undef YYCASE_ 1081 } 1082 1083 { 1084 YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 1085 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1086 return 2; 1087 yysize = yysize1; 1088 } 1089 1090 if (*yymsg_alloc < yysize) 1091 { 1092 *yymsg_alloc = 2 * yysize; 1093 if (! (yysize <= *yymsg_alloc 1094 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1095 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1096 return 1; 1097 } 1098 1099 /* Avoid sprintf, as that infringes on the user's name space. 1100 Don't have undefined behavior even if the translation 1101 produced a string with the wrong number of "%s"s. */ 1102 { 1103 char *yyp = *yymsg; 1104 int yyi = 0; 1105 while ((*yyp = *yyformat) != '\0') 1106 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1107 { 1108 yyp += yytnamerr (yyp, yyarg[yyi++]); 1109 yyformat += 2; 1110 } 1111 else 1112 { 1113 yyp++; 1114 yyformat++; 1115 } 1116 } 1117 return 0; 1118 } 1119 #endif /* YYERROR_VERBOSE */ 1120 1121 /*-----------------------------------------------. 1122 | Release the memory associated to this symbol. | 1123 `-----------------------------------------------*/ 1124 1125 /*ARGSUSED*/ 1126 #if (defined __STDC__ || defined __C99__FUNC__ \ 1127 || defined __cplusplus || defined _MSC_VER) 1128 static void 1129 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1130 #else 1131 static void 1132 yydestruct (yymsg, yytype, yyvaluep) 1133 const char *yymsg; 1134 int yytype; 1135 YYSTYPE *yyvaluep; 1136 #endif 1137 { 1138 YYUSE (yyvaluep); 1139 1140 if (!yymsg) 1141 yymsg = "Deleting"; 1142 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1143 1144 switch (yytype) 1145 { 1146 1147 default: 1148 break; 1149 } 1150 } 1151 1152 1153 1154 1155 /* The lookahead symbol. */ 1156 int yychar; 1157 1158 1159 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1160 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1161 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 1162 #endif 1163 #ifndef YY_INITIAL_VALUE 1164 # define YY_INITIAL_VALUE(Value) /* Nothing. */ 1165 #endif 1166 1167 /* The semantic value of the lookahead symbol. */ 1168 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); 1169 1170 /* Number of syntax errors so far. */ 1171 int yynerrs; 1172 1173 1174 /*----------. 1175 | yyparse. | 1176 `----------*/ 1177 1178 #ifdef YYPARSE_PARAM 1179 #if (defined __STDC__ || defined __C99__FUNC__ \ 1180 || defined __cplusplus || defined _MSC_VER) 1181 int 1182 yyparse (void *YYPARSE_PARAM) 1183 #else 1184 int 1185 yyparse (YYPARSE_PARAM) 1186 void *YYPARSE_PARAM; 1187 #endif 1188 #else /* ! YYPARSE_PARAM */ 1189 #if (defined __STDC__ || defined __C99__FUNC__ \ 1190 || defined __cplusplus || defined _MSC_VER) 1191 int 1192 yyparse (void) 1193 #else 1194 int 1195 yyparse () 1196 1197 #endif 1198 #endif 1199 { 1200 int yystate; 1201 /* Number of tokens to shift before error messages enabled. */ 1202 int yyerrstatus; 1203 1204 /* The stacks and their tools: 1205 `yyss': related to states. 1206 `yyvs': related to semantic values. 1207 1208 Refer to the stacks through separate pointers, to allow yyoverflow 1209 to reallocate them elsewhere. */ 1210 1211 /* The state stack. */ 1212 yytype_int16 yyssa[YYINITDEPTH]; 1213 yytype_int16 *yyss; 1214 yytype_int16 *yyssp; 1215 1216 /* The semantic value stack. */ 1217 YYSTYPE yyvsa[YYINITDEPTH]; 1218 YYSTYPE *yyvs; 1219 YYSTYPE *yyvsp; 1220 1221 YYSIZE_T yystacksize; 1222 1223 int yyn; 1224 int yyresult; 1225 /* Lookahead token as an internal (translated) token number. */ 1226 int yytoken = 0; 1227 /* The variables used to return semantic value and location from the 1228 action routines. */ 1229 YYSTYPE yyval; 1230 1231 #if YYERROR_VERBOSE 1232 /* Buffer for error messages, and its allocated size. */ 1233 char yymsgbuf[128]; 1234 char *yymsg = yymsgbuf; 1235 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1236 #endif 1237 1238 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1239 1240 /* The number of symbols on the RHS of the reduced rule. 1241 Keep to zero when no symbol should be popped. */ 1242 int yylen = 0; 1243 1244 yyssp = yyss = yyssa; 1245 yyvsp = yyvs = yyvsa; 1246 yystacksize = YYINITDEPTH; 1247 1248 YYDPRINTF ((stderr, "Starting parse\n")); 1249 1250 yystate = 0; 1251 yyerrstatus = 0; 1252 yynerrs = 0; 1253 yychar = YYEMPTY; /* Cause a token to be read. */ 1254 goto yysetstate; 1255 1256 /*------------------------------------------------------------. 1257 | yynewstate -- Push a new state, which is found in yystate. | 1258 `------------------------------------------------------------*/ 1259 yynewstate: 1260 /* In all cases, when you get here, the value and location stacks 1261 have just been pushed. So pushing a state here evens the stacks. */ 1262 yyssp++; 1263 1264 yysetstate: 1265 *yyssp = yystate; 1266 1267 if (yyss + yystacksize - 1 <= yyssp) 1268 { 1269 /* Get the current used size of the three stacks, in elements. */ 1270 YYSIZE_T yysize = yyssp - yyss + 1; 1271 1272 #ifdef yyoverflow 1273 { 1274 /* Give user a chance to reallocate the stack. Use copies of 1275 these so that the &'s don't force the real ones into 1276 memory. */ 1277 YYSTYPE *yyvs1 = yyvs; 1278 yytype_int16 *yyss1 = yyss; 1279 1280 /* Each stack pointer address is followed by the size of the 1281 data in use in that stack, in bytes. This used to be a 1282 conditional around just the two extra args, but that might 1283 be undefined if yyoverflow is a macro. */ 1284 yyoverflow (YY_("memory exhausted"), 1285 &yyss1, yysize * sizeof (*yyssp), 1286 &yyvs1, yysize * sizeof (*yyvsp), 1287 &yystacksize); 1288 1289 yyss = yyss1; 1290 yyvs = yyvs1; 1291 } 1292 #else /* no yyoverflow */ 1293 # ifndef YYSTACK_RELOCATE 1294 goto yyexhaustedlab; 1295 # else 1296 /* Extend the stack our own way. */ 1297 if (YYMAXDEPTH <= yystacksize) 1298 goto yyexhaustedlab; 1299 yystacksize *= 2; 1300 if (YYMAXDEPTH < yystacksize) 1301 yystacksize = YYMAXDEPTH; 1302 1303 { 1304 yytype_int16 *yyss1 = yyss; 1305 union yyalloc *yyptr = 1306 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1307 if (! yyptr) 1308 goto yyexhaustedlab; 1309 YYSTACK_RELOCATE (yyss_alloc, yyss); 1310 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1311 # undef YYSTACK_RELOCATE 1312 if (yyss1 != yyssa) 1313 YYSTACK_FREE (yyss1); 1314 } 1315 # endif 1316 #endif /* no yyoverflow */ 1317 1318 yyssp = yyss + yysize - 1; 1319 yyvsp = yyvs + yysize - 1; 1320 1321 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1322 (unsigned long int) yystacksize)); 1323 1324 if (yyss + yystacksize - 1 <= yyssp) 1325 YYABORT; 1326 } 1327 1328 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1329 1330 if (yystate == YYFINAL) 1331 YYACCEPT; 1332 1333 goto yybackup; 1334 1335 /*-----------. 1336 | yybackup. | 1337 `-----------*/ 1338 yybackup: 1339 1340 /* Do appropriate processing given the current state. Read a 1341 lookahead token if we need one and don't already have one. */ 1342 1343 /* First try to decide what to do without reference to lookahead token. */ 1344 yyn = yypact[yystate]; 1345 if (yypact_value_is_default (yyn)) 1346 goto yydefault; 1347 1348 /* Not known => get a lookahead token if don't already have one. */ 1349 1350 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1351 if (yychar == YYEMPTY) 1352 { 1353 YYDPRINTF ((stderr, "Reading a token: ")); 1354 yychar = YYLEX; 1355 } 1356 1357 if (yychar <= YYEOF) 1358 { 1359 yychar = yytoken = YYEOF; 1360 YYDPRINTF ((stderr, "Now at end of input.\n")); 1361 } 1362 else 1363 { 1364 yytoken = YYTRANSLATE (yychar); 1365 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1366 } 1367 1368 /* If the proper action on seeing token YYTOKEN is to reduce or to 1369 detect an error, take that action. */ 1370 yyn += yytoken; 1371 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1372 goto yydefault; 1373 yyn = yytable[yyn]; 1374 if (yyn <= 0) 1375 { 1376 if (yytable_value_is_error (yyn)) 1377 goto yyerrlab; 1378 yyn = -yyn; 1379 goto yyreduce; 1380 } 1381 1382 /* Count tokens shifted since error; after three, turn off error 1383 status. */ 1384 if (yyerrstatus) 1385 yyerrstatus--; 1386 1387 /* Shift the lookahead token. */ 1388 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1389 1390 /* Discard the shifted token. */ 1391 yychar = YYEMPTY; 1392 1393 yystate = yyn; 1394 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1395 *++yyvsp = yylval; 1396 YY_IGNORE_MAYBE_UNINITIALIZED_END 1397 1398 goto yynewstate; 1399 1400 1401 /*-----------------------------------------------------------. 1402 | yydefault -- do the default action for the current state. | 1403 `-----------------------------------------------------------*/ 1404 yydefault: 1405 yyn = yydefact[yystate]; 1406 if (yyn == 0) 1407 goto yyerrlab; 1408 goto yyreduce; 1409 1410 1411 /*-----------------------------. 1412 | yyreduce -- Do a reduction. | 1413 `-----------------------------*/ 1414 yyreduce: 1415 /* yyn is the number of a rule to reduce with. */ 1416 yylen = yyr2[yyn]; 1417 1418 /* If YYLEN is nonzero, implement the default value of the action: 1419 `$$ = $1'. 1420 1421 Otherwise, the following line sets YYVAL to garbage. 1422 This behavior is undocumented and Bison 1423 users should not rely upon it. Assigning to YYVAL 1424 unconditionally makes the parser a bit smaller, and it avoids a 1425 GCC warning that YYVAL may be used uninitialized. */ 1426 yyval = yyvsp[1-yylen]; 1427 1428 1429 YY_REDUCE_PRINT (yyn); 1430 switch (yyn) 1431 { 1432 case 2: 1433 /* Line 1792 of yacc.c */ 1434 #line 116 "freebsd/lib/libipsec/policy_parse.y" 1435 { 1436 p_dir = (yyvsp[(1) - (2)].num); 1437 p_type = (yyvsp[(2) - (2)].num); 1438 1439 if (init_x_policy()) 1440 return -1; 1441 } 1442 break; 1443 1444 case 4: 1445 /* Line 1792 of yacc.c */ 1446 #line 125 "freebsd/lib/libipsec/policy_parse.y" 1447 { 1448 p_dir = (yyvsp[(1) - (1)].num); 1449 p_type = 0; /* ignored it by kernel */ 1450 1451 if (init_x_policy()) 1452 return -1; 1453 } 1454 break; 1455 1456 case 6: 1457 /* Line 1792 of yacc.c */ 1458 #line 136 "freebsd/lib/libipsec/policy_parse.y" 1459 { 1460 if (rule_check() < 0) 1461 return -1; 1462 1463 if (set_x_request(p_src, p_dst) < 0) 1464 return -1; 1465 1466 policy_parse_request_init(); 1467 } 1468 break; 1469 1470 case 13: 1471 /* Line 1792 of yacc.c */ 1472 #line 154 "freebsd/lib/libipsec/policy_parse.y" 1473 { 1474 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1475 return -1; 1476 } 1477 break; 1478 1479 case 14: 1480 /* Line 1792 of yacc.c */ 1481 #line 158 "freebsd/lib/libipsec/policy_parse.y" 1482 { 1483 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 1484 return -1; 1485 } 1486 break; 1487 1488 case 15: 1489 /* Line 1792 of yacc.c */ 1490 #line 165 "freebsd/lib/libipsec/policy_parse.y" 1491 { p_protocol = (yyvsp[(1) - (1)].num); } 1492 break; 1493 1494 case 16: 1495 /* Line 1792 of yacc.c */ 1496 #line 169 "freebsd/lib/libipsec/policy_parse.y" 1497 { p_mode = (yyvsp[(1) - (1)].num); } 1498 break; 1499 1500 case 17: 1501 /* Line 1792 of yacc.c */ 1502 #line 173 "freebsd/lib/libipsec/policy_parse.y" 1503 { 1504 p_level = (yyvsp[(1) - (1)].num); 1505 p_reqid = 0; 1506 } 1507 break; 1508 1509 case 18: 1510 /* Line 1792 of yacc.c */ 1511 #line 177 "freebsd/lib/libipsec/policy_parse.y" 1512 { 1513 p_level = IPSEC_LEVEL_UNIQUE; 1514 p_reqid = atol((yyvsp[(1) - (1)].val).buf); /* atol() is good. */ 1515 } 1516 break; 1517 1518 case 19: 1519 /* Line 1792 of yacc.c */ 1520 #line 184 "freebsd/lib/libipsec/policy_parse.y" 1521 { 1522 p_src = parse_sockaddr(&(yyvsp[(1) - (1)].val)); 1523 if (p_src == NULL) 1524 return -1; 1525 } 1526 break; 1527 1528 case 20: 1529 /* Line 1792 of yacc.c */ 1530 #line 190 "freebsd/lib/libipsec/policy_parse.y" 1531 { 1532 p_dst = parse_sockaddr(&(yyvsp[(4) - (4)].val)); 1533 if (p_dst == NULL) 1534 return -1; 1535 } 1536 break; 1537 1538 case 21: 1539 /* Line 1792 of yacc.c */ 1540 #line 195 "freebsd/lib/libipsec/policy_parse.y" 1541 { 1542 if (p_dir != IPSEC_DIR_OUTBOUND) { 1543 __ipsec_errcode = EIPSEC_INVAL_DIR; 1544 return -1; 1545 } 1546 } 1547 break; 1548 1549 case 22: 1550 /* Line 1792 of yacc.c */ 1551 #line 201 "freebsd/lib/libipsec/policy_parse.y" 1552 { 1553 if (p_dir != IPSEC_DIR_INBOUND) { 1554 __ipsec_errcode = EIPSEC_INVAL_DIR; 1555 return -1; 1556 } 1557 } 1558 break; 1559 1560 1561 /* Line 1792 of yacc.c */ 1562 #line 1563 "__libipsecyy.tab.c" 1563 default: break; 1564 } 1565 /* User semantic actions sometimes alter yychar, and that requires 1566 that yytoken be updated with the new translation. We take the 1567 approach of translating immediately before every use of yytoken. 1568 One alternative is translating here after every semantic action, 1569 but that translation would be missed if the semantic action invokes 1570 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1571 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1572 incorrect destructor might then be invoked immediately. In the 1573 case of YYERROR or YYBACKUP, subsequent parser actions might lead 1574 to an incorrect destructor call or verbose syntax error message 1575 before the lookahead is translated. */ 1576 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1577 1578 YYPOPSTACK (yylen); 1579 yylen = 0; 1580 YY_STACK_PRINT (yyss, yyssp); 1581 1582 *++yyvsp = yyval; 1583 1584 /* Now `shift' the result of the reduction. Determine what state 1585 that goes to, based on the state we popped back to and the rule 1586 number reduced by. */ 1587 1588 yyn = yyr1[yyn]; 1589 1590 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1591 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1592 yystate = yytable[yystate]; 1593 else 1594 yystate = yydefgoto[yyn - YYNTOKENS]; 1595 1596 goto yynewstate; 1597 1598 1599 /*------------------------------------. 1600 | yyerrlab -- here on detecting error | 1601 `------------------------------------*/ 1602 yyerrlab: 1603 /* Make sure we have latest lookahead translation. See comments at 1604 user semantic actions for why this is necessary. */ 1605 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1606 1607 /* If not already recovering from an error, report this error. */ 1608 if (!yyerrstatus) 1609 { 1610 ++yynerrs; 1611 #if ! YYERROR_VERBOSE 1612 yyerror (YY_("syntax error")); 1613 #else 1614 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1615 yyssp, yytoken) 1616 { 1617 char const *yymsgp = YY_("syntax error"); 1618 int yysyntax_error_status; 1619 yysyntax_error_status = YYSYNTAX_ERROR; 1620 if (yysyntax_error_status == 0) 1621 yymsgp = yymsg; 1622 else if (yysyntax_error_status == 1) 1623 { 1624 if (yymsg != yymsgbuf) 1625 YYSTACK_FREE (yymsg); 1626 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1627 if (!yymsg) 1628 { 1629 yymsg = yymsgbuf; 1630 yymsg_alloc = sizeof yymsgbuf; 1631 yysyntax_error_status = 2; 1632 } 1633 else 1634 { 1635 yysyntax_error_status = YYSYNTAX_ERROR; 1636 yymsgp = yymsg; 1637 } 1638 } 1639 yyerror (yymsgp); 1640 if (yysyntax_error_status == 2) 1641 goto yyexhaustedlab; 1642 } 1643 # undef YYSYNTAX_ERROR 1644 #endif 1645 } 1646 1647 1648 1649 if (yyerrstatus == 3) 1650 { 1651 /* If just tried and failed to reuse lookahead token after an 1652 error, discard it. */ 1653 1654 if (yychar <= YYEOF) 1655 { 1656 /* Return failure if at end of input. */ 1657 if (yychar == YYEOF) 1658 YYABORT; 1659 } 1660 else 1661 { 1662 yydestruct ("Error: discarding", 1663 yytoken, &yylval); 1664 yychar = YYEMPTY; 1665 } 1666 } 1667 1668 /* Else will try to reuse lookahead token after shifting the error 1669 token. */ 1670 goto yyerrlab1; 1671 1672 1673 /*---------------------------------------------------. 1674 | yyerrorlab -- error raised explicitly by YYERROR. | 1675 `---------------------------------------------------*/ 1676 yyerrorlab: 1677 1678 /* Pacify compilers like GCC when the user code never invokes 1679 YYERROR and the label yyerrorlab therefore never appears in user 1680 code. */ 1681 if (/*CONSTCOND*/ 0) 1682 goto yyerrorlab; 1683 1684 /* Do not reclaim the symbols of the rule which action triggered 1685 this YYERROR. */ 1686 YYPOPSTACK (yylen); 1687 yylen = 0; 1688 YY_STACK_PRINT (yyss, yyssp); 1689 yystate = *yyssp; 1690 goto yyerrlab1; 1691 1692 1693 /*-------------------------------------------------------------. 1694 | yyerrlab1 -- common code for both syntax error and YYERROR. | 1695 `-------------------------------------------------------------*/ 1696 yyerrlab1: 1697 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1698 1699 for (;;) 1700 { 1701 yyn = yypact[yystate]; 1702 if (!yypact_value_is_default (yyn)) 1703 { 1704 yyn += YYTERROR; 1705 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1706 { 1707 yyn = yytable[yyn]; 1708 if (0 < yyn) 1709 break; 1710 } 1711 } 1712 1713 /* Pop the current state because it cannot handle the error token. */ 1714 if (yyssp == yyss) 1715 YYABORT; 1716 1717 1718 yydestruct ("Error: popping", 1719 yystos[yystate], yyvsp); 1720 YYPOPSTACK (1); 1721 yystate = *yyssp; 1722 YY_STACK_PRINT (yyss, yyssp); 1723 } 1724 1725 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 1726 *++yyvsp = yylval; 1727 YY_IGNORE_MAYBE_UNINITIALIZED_END 1728 1729 1730 /* Shift the error token. */ 1731 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1732 1733 yystate = yyn; 1734 goto yynewstate; 1735 1736 1737 /*-------------------------------------. 1738 | yyacceptlab -- YYACCEPT comes here. | 1739 `-------------------------------------*/ 1740 yyacceptlab: 1741 yyresult = 0; 1742 goto yyreturn; 1743 1744 /*-----------------------------------. 1745 | yyabortlab -- YYABORT comes here. | 1746 `-----------------------------------*/ 1747 yyabortlab: 1748 yyresult = 1; 1749 goto yyreturn; 1750 1751 #if !defined yyoverflow || YYERROR_VERBOSE 1752 /*-------------------------------------------------. 1753 | yyexhaustedlab -- memory exhaustion comes here. | 1754 `-------------------------------------------------*/ 1755 yyexhaustedlab: 1756 yyerror (YY_("memory exhausted")); 1757 yyresult = 2; 1758 /* Fall through. */ 1759 #endif 1760 1761 yyreturn: 1762 if (yychar != YYEMPTY) 1763 { 1764 /* Make sure we have latest lookahead translation. See comments at 1765 user semantic actions for why this is necessary. */ 1766 yytoken = YYTRANSLATE (yychar); 1767 yydestruct ("Cleanup: discarding lookahead", 1768 yytoken, &yylval); 1769 } 1770 /* Do not reclaim the symbols of the rule which action triggered 1771 this YYABORT or YYACCEPT. */ 1772 YYPOPSTACK (yylen); 1773 YY_STACK_PRINT (yyss, yyssp); 1774 while (yyssp != yyss) 1775 { 1776 yydestruct ("Cleanup: popping", 1777 yystos[*yyssp], yyvsp); 1778 YYPOPSTACK (1); 1779 } 1780 #ifndef yyoverflow 1781 if (yyss != yyssa) 1782 YYSTACK_FREE (yyss); 1783 #endif 1784 #if YYERROR_VERBOSE 1785 if (yymsg != yymsgbuf) 1786 YYSTACK_FREE (yymsg); 1787 #endif 1788 /* Make sure YYID is used. */ 1789 return YYID (yyresult); 1790 } 1791 1792 1793 /* Line 2055 of yacc.c */ 1794 #line 212 "freebsd/lib/libipsec/policy_parse.y" 1795 358 #define YYSTACKSIZE 10000 359 #define YYMAXDEPTH 10000 360 #endif 361 #endif 362 363 #define YYINITSTACKSIZE 200 364 365 typedef struct { 366 unsigned stacksize; 367 YYINT *s_base; 368 YYINT *s_mark; 369 YYINT *s_last; 370 YYSTYPE *l_base; 371 YYSTYPE *l_mark; 372 } YYSTACKDATA; 373 /* variables for the parser stack */ 374 static YYSTACKDATA yystack; 375 #line 213 "../../freebsd/lib/libipsec/policy_parse.y" 1796 376 1797 377 void … … 2021 601 } 2022 602 603 #line 604 "__libipsecyy.tab.c" 604 605 #if YYDEBUG 606 #include <stdio.h> /* needed for printf */ 607 #endif 608 609 #include <stdlib.h> /* needed for malloc, etc */ 610 #include <string.h> /* needed for memset */ 611 612 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 613 static int yygrowstack(YYSTACKDATA *data) 614 { 615 int i; 616 unsigned newsize; 617 YYINT *newss; 618 YYSTYPE *newvs; 619 620 if ((newsize = data->stacksize) == 0) 621 newsize = YYINITSTACKSIZE; 622 else if (newsize >= YYMAXDEPTH) 623 return YYENOMEM; 624 else if ((newsize *= 2) > YYMAXDEPTH) 625 newsize = YYMAXDEPTH; 626 627 i = (int) (data->s_mark - data->s_base); 628 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 629 if (newss == 0) 630 return YYENOMEM; 631 632 data->s_base = newss; 633 data->s_mark = newss + i; 634 635 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 636 if (newvs == 0) 637 return YYENOMEM; 638 639 data->l_base = newvs; 640 data->l_mark = newvs + i; 641 642 data->stacksize = newsize; 643 data->s_last = data->s_base + newsize - 1; 644 return 0; 645 } 646 647 #if YYPURE || defined(YY_NO_LEAKS) 648 static void yyfreestack(YYSTACKDATA *data) 649 { 650 free(data->s_base); 651 free(data->l_base); 652 memset(data, 0, sizeof(*data)); 653 } 654 #else 655 #define yyfreestack(data) /* nothing */ 656 #endif 657 658 #define YYABORT goto yyabort 659 #define YYREJECT goto yyabort 660 #define YYACCEPT goto yyaccept 661 #define YYERROR goto yyerrlab 662 663 int 664 YYPARSE_DECL() 665 { 666 int yym, yyn, yystate; 667 #if YYDEBUG 668 const char *yys; 669 670 if ((yys = getenv("YYDEBUG")) != 0) 671 { 672 yyn = *yys; 673 if (yyn >= '0' && yyn <= '9') 674 yydebug = yyn - '0'; 675 } 676 #endif 677 678 yynerrs = 0; 679 yyerrflag = 0; 680 yychar = YYEMPTY; 681 yystate = 0; 682 683 #if YYPURE 684 memset(&yystack, 0, sizeof(yystack)); 685 #endif 686 687 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 688 yystack.s_mark = yystack.s_base; 689 yystack.l_mark = yystack.l_base; 690 yystate = 0; 691 *yystack.s_mark = 0; 692 693 yyloop: 694 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 695 if (yychar < 0) 696 { 697 if ((yychar = YYLEX) < 0) yychar = YYEOF; 698 #if YYDEBUG 699 if (yydebug) 700 { 701 yys = yyname[YYTRANSLATE(yychar)]; 702 printf("%sdebug: state %d, reading %d (%s)\n", 703 YYPREFIX, yystate, yychar, yys); 704 } 705 #endif 706 } 707 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && 708 yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 709 { 710 #if YYDEBUG 711 if (yydebug) 712 printf("%sdebug: state %d, shifting to state %d\n", 713 YYPREFIX, yystate, yytable[yyn]); 714 #endif 715 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 716 { 717 goto yyoverflow; 718 } 719 yystate = yytable[yyn]; 720 *++yystack.s_mark = yytable[yyn]; 721 *++yystack.l_mark = yylval; 722 yychar = YYEMPTY; 723 if (yyerrflag > 0) --yyerrflag; 724 goto yyloop; 725 } 726 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && 727 yyn <= YYTABLESIZE && yycheck[yyn] == yychar) 728 { 729 yyn = yytable[yyn]; 730 goto yyreduce; 731 } 732 if (yyerrflag) goto yyinrecovery; 733 734 YYERROR_CALL("syntax error"); 735 736 goto yyerrlab; 737 738 yyerrlab: 739 ++yynerrs; 740 741 yyinrecovery: 742 if (yyerrflag < 3) 743 { 744 yyerrflag = 3; 745 for (;;) 746 { 747 if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && 748 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) 749 { 750 #if YYDEBUG 751 if (yydebug) 752 printf("%sdebug: state %d, error recovery shifting\ 753 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); 754 #endif 755 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 756 { 757 goto yyoverflow; 758 } 759 yystate = yytable[yyn]; 760 *++yystack.s_mark = yytable[yyn]; 761 *++yystack.l_mark = yylval; 762 goto yyloop; 763 } 764 else 765 { 766 #if YYDEBUG 767 if (yydebug) 768 printf("%sdebug: error recovery discarding state %d\n", 769 YYPREFIX, *yystack.s_mark); 770 #endif 771 if (yystack.s_mark <= yystack.s_base) goto yyabort; 772 --yystack.s_mark; 773 --yystack.l_mark; 774 } 775 } 776 } 777 else 778 { 779 if (yychar == YYEOF) goto yyabort; 780 #if YYDEBUG 781 if (yydebug) 782 { 783 yys = yyname[YYTRANSLATE(yychar)]; 784 printf("%sdebug: state %d, error recovery discards token %d (%s)\n", 785 YYPREFIX, yystate, yychar, yys); 786 } 787 #endif 788 yychar = YYEMPTY; 789 goto yyloop; 790 } 791 792 yyreduce: 793 #if YYDEBUG 794 if (yydebug) 795 printf("%sdebug: state %d, reducing by rule %d (%s)\n", 796 YYPREFIX, yystate, yyn, yyrule[yyn]); 797 #endif 798 yym = yylen[yyn]; 799 if (yym) 800 yyval = yystack.l_mark[1-yym]; 801 else 802 memset(&yyval, 0, sizeof yyval); 803 switch (yyn) 804 { 805 case 1: 806 #line 116 "../../freebsd/lib/libipsec/policy_parse.y" 807 { 808 p_dir = yystack.l_mark[-1].num; 809 p_type = yystack.l_mark[0].num; 810 811 if (init_x_policy()) 812 return -1; 813 } 814 break; 815 case 3: 816 #line 125 "../../freebsd/lib/libipsec/policy_parse.y" 817 { 818 p_dir = yystack.l_mark[0].num; 819 p_type = 0; /* ignored it by kernel */ 820 821 if (init_x_policy()) 822 return -1; 823 } 824 break; 825 case 5: 826 #line 136 "../../freebsd/lib/libipsec/policy_parse.y" 827 { 828 if (rule_check() < 0) 829 return -1; 830 831 if (set_x_request(p_src, p_dst) < 0) 832 return -1; 833 834 policy_parse_request_init(); 835 } 836 break; 837 case 12: 838 #line 154 "../../freebsd/lib/libipsec/policy_parse.y" 839 { 840 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 841 return -1; 842 } 843 break; 844 case 13: 845 #line 158 "../../freebsd/lib/libipsec/policy_parse.y" 846 { 847 __ipsec_errcode = EIPSEC_FEW_ARGUMENTS; 848 return -1; 849 } 850 break; 851 case 14: 852 #line 165 "../../freebsd/lib/libipsec/policy_parse.y" 853 { p_protocol = yystack.l_mark[0].num; } 854 break; 855 case 15: 856 #line 169 "../../freebsd/lib/libipsec/policy_parse.y" 857 { p_mode = yystack.l_mark[0].num; } 858 break; 859 case 16: 860 #line 173 "../../freebsd/lib/libipsec/policy_parse.y" 861 { 862 p_level = yystack.l_mark[0].num; 863 p_reqid = 0; 864 } 865 break; 866 case 17: 867 #line 177 "../../freebsd/lib/libipsec/policy_parse.y" 868 { 869 p_level = IPSEC_LEVEL_UNIQUE; 870 p_reqid = atol(yystack.l_mark[0].val.buf); /* atol() is good. */ 871 } 872 break; 873 case 18: 874 #line 184 "../../freebsd/lib/libipsec/policy_parse.y" 875 { 876 p_src = parse_sockaddr(&yystack.l_mark[0].val); 877 if (p_src == NULL) 878 return -1; 879 } 880 break; 881 case 19: 882 #line 190 "../../freebsd/lib/libipsec/policy_parse.y" 883 { 884 p_dst = parse_sockaddr(&yystack.l_mark[0].val); 885 if (p_dst == NULL) 886 return -1; 887 } 888 break; 889 case 20: 890 #line 195 "../../freebsd/lib/libipsec/policy_parse.y" 891 { 892 if (p_dir != IPSEC_DIR_OUTBOUND) { 893 __ipsec_errcode = EIPSEC_INVAL_DIR; 894 return -1; 895 } 896 } 897 break; 898 case 21: 899 #line 201 "../../freebsd/lib/libipsec/policy_parse.y" 900 { 901 if (p_dir != IPSEC_DIR_INBOUND) { 902 __ipsec_errcode = EIPSEC_INVAL_DIR; 903 return -1; 904 } 905 } 906 break; 907 #line 908 "__libipsecyy.tab.c" 908 } 909 yystack.s_mark -= yym; 910 yystate = *yystack.s_mark; 911 yystack.l_mark -= yym; 912 yym = yylhs[yyn]; 913 if (yystate == 0 && yym == 0) 914 { 915 #if YYDEBUG 916 if (yydebug) 917 printf("%sdebug: after reduction, shifting from state 0 to\ 918 state %d\n", YYPREFIX, YYFINAL); 919 #endif 920 yystate = YYFINAL; 921 *++yystack.s_mark = YYFINAL; 922 *++yystack.l_mark = yyval; 923 if (yychar < 0) 924 { 925 if ((yychar = YYLEX) < 0) yychar = YYEOF; 926 #if YYDEBUG 927 if (yydebug) 928 { 929 yys = yyname[YYTRANSLATE(yychar)]; 930 printf("%sdebug: state %d, reading %d (%s)\n", 931 YYPREFIX, YYFINAL, yychar, yys); 932 } 933 #endif 934 } 935 if (yychar == YYEOF) goto yyaccept; 936 goto yyloop; 937 } 938 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && 939 yyn <= YYTABLESIZE && yycheck[yyn] == yystate) 940 yystate = yytable[yyn]; 941 else 942 yystate = yydgoto[yym]; 943 #if YYDEBUG 944 if (yydebug) 945 printf("%sdebug: after reduction, shifting from state %d \ 946 to state %d\n", YYPREFIX, *yystack.s_mark, yystate); 947 #endif 948 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 949 { 950 goto yyoverflow; 951 } 952 *++yystack.s_mark = (YYINT) yystate; 953 *++yystack.l_mark = yyval; 954 goto yyloop; 955 956 yyoverflow: 957 YYERROR_CALL("yacc stack overflow"); 958 959 yyabort: 960 yyfreestack(&yystack); 961 return (1); 962 963 yyaccept: 964 yyfreestack(&yystack); 965 return (0); 966 } -
freebsd/lib/libipsec/policy_token.c
r11ec988 re35a65e 35 35 /* First, we deal with platform-specific or compiler-specific issues. */ 36 36 37 #if defined(__FreeBSD__) 38 #ifndef __STDC_LIMIT_MACROS 39 #define __STDC_LIMIT_MACROS 40 #endif 41 #include <sys/cdefs.h> 42 #include <stdint.h> 43 #else 44 #define __dead2 45 #endif 46 37 47 /* begin standard C headers. */ 38 48 #include <stdio.h> … … 50 60 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 51 61 52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 62 #if defined(__FreeBSD__) || \ 63 (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) 53 64 54 65 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, … … 186 197 #define EOB_ACT_LAST_MATCH 2 187 198 188 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires 189 * access to the local variable yy_act. Since yyless() is a macro, it would break 190 * existing scanners that call yyless() from OUTSIDE __libipsecyylex. 191 * One obvious solution it to make yy_act a global. I tried that, and saw 192 * a 5% performance hit in a non-__libipsecyylineno scanner, because yy_act is 193 * normally declared as a register variable-- so it is not worth it. 194 */ 195 #define YY_LESS_LINENO(n) \ 196 do { \ 197 int yyl;\ 198 for ( yyl = n; yyl < __libipsecyyleng; ++yyl )\ 199 if ( __libipsecyytext[yyl] == '\n' )\ 200 --__libipsecyylineno;\ 201 }while(0) 199 #define YY_LESS_LINENO(n) 202 200 203 201 /* Return all but the first "n" matched characters back to the input stream. */ … … 296 294 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 297 295 : NULL) 296 #define yy_current_buffer YY_CURRENT_BUFFER 298 297 299 298 /* Same as previous macro, but useful when we know that the buffer stack is not … … 374 373 typedef int yy_state_type; 375 374 376 #define YY_FLEX_LEX_COMPAT377 375 extern int __libipsecyylineno; 378 376 379 377 int __libipsecyylineno = 1; 380 378 381 extern char __libipsecyytext[]; 379 extern char *__libipsecyytext; 380 #define yytext_ptr __libipsecyytext 382 381 383 382 static yy_state_type yy_get_previous_state (void ); 384 383 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 385 384 static int yy_get_next_buffer (void ); 386 static void yy_fatal_error (yyconst char msg[] ) ;385 static void yy_fatal_error (yyconst char msg[] ) __dead2; 387 386 388 387 /* Done after the current pattern has been matched and before the … … 394 393 (yy_hold_char) = *yy_cp; \ 395 394 *yy_cp = '\0'; \ 396 if ( __libipsecyyleng + (yy_more_offset) >= YYLMAX ) \397 YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \398 yy_flex_strncpy( &__libipsecyytext[(yy_more_offset)], (yytext_ptr), __libipsecyyleng + 1 ); \399 __libipsecyyleng += (yy_more_offset); \400 (yy_prev_more_offset) = (yy_more_offset); \401 (yy_more_offset) = 0; \402 395 (yy_c_buf_p) = yy_cp; 403 396 … … 411 404 flex_int32_t yy_nxt; 412 405 }; 413 static yyconst flex_int16_t yy_acc list[131] =406 static yyconst flex_int16_t yy_accept[99] = 414 407 { 0, 415 27, 26, 24, 26, 25, 26, 23, 26, 22, 26, 416 21, 26, 22, 26, 22, 26, 22, 26, 22, 26, 417 22, 26, 22, 26, 22, 26, 22, 26, 22, 26, 418 22, 26, 22, 26, 24, 22, 9, 22, 22, 22, 419 22, 22, 22, 22, 1, 22, 22, 14, 22, 22, 420 22, 22, 22, 22, 22, 22, 22, 22, 15, 22, 421 22, 22, 22, 22, 8, 22, 22, 22, 22, 2, 422 22, 22, 11, 22, 22, 22, 22, 17, 22, 22, 423 22, 22, 22, 22, 22, 4, 22, 22, 22, 22, 424 22, 22, 22, 22, 22, 22, 5, 22, 22, 22, 425 426 22, 22, 6, 22, 22, 22, 22, 10, 22, 22, 427 22, 13, 22, 20, 22, 16, 22, 3, 22, 7, 428 22, 18, 22, 22, 22, 22, 19, 22, 12, 22 429 } ; 430 431 static yyconst flex_int16_t yy_accept[100] = 432 { 0, 433 1, 1, 1, 2, 3, 5, 7, 9, 11, 13, 434 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 435 35, 36, 36, 37, 39, 40, 41, 42, 43, 44, 436 45, 47, 48, 50, 51, 52, 53, 54, 55, 56, 437 57, 58, 59, 61, 62, 63, 64, 65, 67, 68, 438 69, 70, 72, 73, 75, 76, 77, 78, 80, 81, 439 82, 83, 84, 85, 86, 88, 89, 90, 91, 92, 440 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 441 105, 106, 107, 108, 110, 111, 112, 114, 116, 118, 442 120, 122, 124, 125, 126, 127, 129, 131, 131 408 0, 0, 27, 26, 24, 25, 23, 22, 21, 22, 409 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 410 24, 0, 22, 9, 22, 22, 22, 22, 22, 22, 411 1, 22, 14, 22, 22, 22, 22, 22, 22, 22, 412 22, 22, 15, 22, 22, 22, 22, 8, 22, 22, 413 22, 2, 22, 11, 22, 22, 22, 17, 22, 22, 414 22, 22, 22, 22, 4, 22, 22, 22, 22, 22, 415 22, 22, 22, 22, 5, 22, 22, 22, 22, 6, 416 22, 22, 22, 10, 22, 22, 13, 20, 16, 3, 417 7, 18, 22, 22, 22, 19, 12, 0 443 418 444 419 } ; … … 571 546 } ; 572 547 573 /* Table of booleans, true if rule could match eol. */ 574 static yyconst flex_int32_t yy_rule_can_match_eol[27] = 575 { 0, 576 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 577 0, 0, 0, 0, 0, 1, 0, }; 548 static yy_state_type yy_last_accepting_state; 549 static char *yy_last_accepting_cpos; 578 550 579 551 extern int __libipsecyy_flex_debug; 580 552 int __libipsecyy_flex_debug = 0; 581 553 582 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; 583 static char *yy_full_match; 584 static int yy_lp; 585 #define REJECT \ 586 { \ 587 *yy_cp = (yy_hold_char); /* undo effects of setting up __libipsecyytext */ \ 588 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ 589 ++(yy_lp); \ 590 goto find_rule; \ 591 } 592 593 static int yy_more_offset = 0; 594 static int yy_prev_more_offset = 0; 595 #define yymore() ((yy_more_offset) = yy_flex_strlen( __libipsecyytext )) 596 #define YY_NEED_STRLEN 554 /* The intent behind this definition is that it'll catch 555 * any uses of REJECT which flex missed. 556 */ 557 #define REJECT reject_used_but_not_detected 558 #define yymore() yymore_used_but_not_detected 597 559 #define YY_MORE_ADJ 0 598 #define YY_RESTORE_YY_MORE_OFFSET \ 599 { \ 600 (yy_more_offset) = (yy_prev_more_offset); \ 601 __libipsecyyleng -= (yy_more_offset); \ 602 } 603 #ifndef YYLMAX 604 #define YYLMAX 8192 605 #endif 606 607 char __libipsecyytext[YYLMAX]; 608 char *yytext_ptr; 609 #line 1 "freebsd/lib/libipsec/policy_token.l" 560 #define YY_RESTORE_YY_MORE_OFFSET 561 char *__libipsecyytext; 562 #line 1 "../../freebsd/lib/libipsec/policy_token.l" 610 563 /* $FreeBSD$ */ 611 564 /* $KAME: policy_token.l,v 1.13 2003/05/09 05:19:55 sakane Exp $ */ … … 638 591 * SUCH DAMAGE. 639 592 */ 640 #line 34 " freebsd/lib/libipsec/policy_token.l"593 #line 34 "../../freebsd/lib/libipsec/policy_token.l" 641 594 #include <sys/types.h> 642 595 #include <sys/param.h> … … 654 607 #include <errno.h> 655 608 656 #ifdef __rtems__657 /* XXX - Jennifer doesn't know where to get this from */658 static YY_BUFFER_STATE yy_current_buffer;659 #endif /* __rtems__ */660 609 #include "y.tab.h" 661 610 #define yylval __libipsecyylval /* XXX */ … … 664 613 #define YY_NO_INPUT 1 665 614 /* common section */ 666 #line 6 67"<stdout>"615 #line 616 "<stdout>" 667 616 668 617 #define INITIAL 0 … … 840 789 YY_DECL 841 790 { 842 registeryy_state_type yy_current_state;843 registerchar *yy_cp, *yy_bp;844 registerint yy_act;791 yy_state_type yy_current_state; 792 char *yy_cp, *yy_bp; 793 int yy_act; 845 794 846 #line 91 "freebsd/lib/libipsec/policy_token.l"847 848 849 #line 850"<stdout>"795 #line 87 "../../freebsd/lib/libipsec/policy_token.l" 796 797 798 #line 799 "<stdout>" 850 799 851 800 if ( !(yy_init) ) … … 856 805 YY_USER_INIT; 857 806 #endif 858 859 /* Create the reject buffer large enough to save one state per allowed character. */860 if ( ! (yy_state_buf) )861 (yy_state_buf) = (yy_state_type *)__libipsecyyalloc(YY_STATE_BUF_SIZE );862 if ( ! (yy_state_buf) )863 YY_FATAL_ERROR( "out of dynamic memory in __libipsecyylex()" );864 807 865 808 if ( ! (yy_start) ) … … 894 837 895 838 yy_current_state = (yy_start); 896 897 (yy_state_ptr) = (yy_state_buf);898 *(yy_state_ptr)++ = yy_current_state;899 900 839 yy_match: 901 840 do 902 841 { 903 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 842 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; 843 if ( yy_accept[yy_current_state] ) 844 { 845 (yy_last_accepting_state) = yy_current_state; 846 (yy_last_accepting_cpos) = yy_cp; 847 } 904 848 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 905 849 { … … 909 853 } 910 854 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 911 *(yy_state_ptr)++ = yy_current_state;912 855 ++yy_cp; 913 856 } … … 915 858 916 859 yy_find_action: 917 yy_current_state = *--(yy_state_ptr); 918 (yy_lp) = yy_accept[yy_current_state]; 919 find_rule: /* we branch to this label when backing up */ 920 for ( ; ; ) /* until we find what rule we matched */ 921 { 922 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) 923 { 924 yy_act = yy_acclist[(yy_lp)]; 925 { 926 (yy_full_match) = yy_cp; 927 break; 928 } 929 } 930 --yy_cp; 931 yy_current_state = *--(yy_state_ptr); 932 (yy_lp) = yy_accept[yy_current_state]; 860 yy_act = yy_accept[yy_current_state]; 861 if ( yy_act == 0 ) 862 { /* have to back up */ 863 yy_cp = (yy_last_accepting_cpos); 864 yy_current_state = (yy_last_accepting_state); 865 yy_act = yy_accept[yy_current_state]; 933 866 } 934 867 935 868 YY_DO_BEFORE_ACTION; 936 937 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )938 {939 int yyl;940 for ( yyl = (yy_prev_more_offset); yyl < __libipsecyyleng; ++yyl )941 if ( __libipsecyytext[yyl] == '\n' )942 943 __libipsecyylineno++;944 ;945 }946 869 947 870 do_action: /* This label is used only to access EOF actions. */ … … 949 872 switch ( yy_act ) 950 873 { /* beginning of action switch */ 874 case 0: /* must back up */ 875 /* undo the effects of YY_DO_BEFORE_ACTION */ 876 *yy_cp = (yy_hold_char); 877 yy_cp = (yy_last_accepting_cpos); 878 yy_current_state = (yy_last_accepting_state); 879 goto yy_find_action; 880 951 881 case 1: 952 882 YY_RULE_SETUP 953 #line 93 "freebsd/lib/libipsec/policy_token.l"883 #line 89 "../../freebsd/lib/libipsec/policy_token.l" 954 884 { yylval.num = IPSEC_DIR_INBOUND; return(DIR); } 955 885 YY_BREAK 956 886 case 2: 957 887 YY_RULE_SETUP 958 #line 9 4 "freebsd/lib/libipsec/policy_token.l"888 #line 90 "../../freebsd/lib/libipsec/policy_token.l" 959 889 { yylval.num = IPSEC_DIR_OUTBOUND; return(DIR); } 960 890 YY_BREAK 961 891 case 3: 962 892 YY_RULE_SETUP 963 #line 9 6 "freebsd/lib/libipsec/policy_token.l"893 #line 92 "../../freebsd/lib/libipsec/policy_token.l" 964 894 { yylval.num = IPSEC_POLICY_DISCARD; return(ACTION); } 965 895 YY_BREAK 966 896 case 4: 967 897 YY_RULE_SETUP 968 #line 9 7 "freebsd/lib/libipsec/policy_token.l"898 #line 93 "../../freebsd/lib/libipsec/policy_token.l" 969 899 { yylval.num = IPSEC_POLICY_NONE; return(ACTION); } 970 900 YY_BREAK 971 901 case 5: 972 902 YY_RULE_SETUP 973 #line 9 8 "freebsd/lib/libipsec/policy_token.l"903 #line 94 "../../freebsd/lib/libipsec/policy_token.l" 974 904 { yylval.num = IPSEC_POLICY_IPSEC; return(ACTION); } 975 905 YY_BREAK 976 906 case 6: 977 907 YY_RULE_SETUP 978 #line 9 9 "freebsd/lib/libipsec/policy_token.l"908 #line 95 "../../freebsd/lib/libipsec/policy_token.l" 979 909 { yylval.num = IPSEC_POLICY_BYPASS; return(ACTION); } 980 910 YY_BREAK 981 911 case 7: 982 912 YY_RULE_SETUP 983 #line 100 "freebsd/lib/libipsec/policy_token.l"913 #line 96 "../../freebsd/lib/libipsec/policy_token.l" 984 914 { yylval.num = IPSEC_POLICY_ENTRUST; return(ACTION); } 985 915 YY_BREAK 986 916 case 8: 987 917 YY_RULE_SETUP 988 #line 102 "freebsd/lib/libipsec/policy_token.l"918 #line 98 "../../freebsd/lib/libipsec/policy_token.l" 989 919 { yylval.num = IPPROTO_ESP; return(PROTOCOL); } 990 920 YY_BREAK 991 921 case 9: 992 922 YY_RULE_SETUP 993 #line 103 "freebsd/lib/libipsec/policy_token.l"923 #line 99 "../../freebsd/lib/libipsec/policy_token.l" 994 924 { yylval.num = IPPROTO_AH; return(PROTOCOL); } 995 925 YY_BREAK 996 926 case 10: 997 927 YY_RULE_SETUP 998 #line 10 4 "freebsd/lib/libipsec/policy_token.l"928 #line 100 "../../freebsd/lib/libipsec/policy_token.l" 999 929 { yylval.num = IPPROTO_IPCOMP; return(PROTOCOL); } 1000 930 YY_BREAK 1001 931 case 11: 1002 932 YY_RULE_SETUP 1003 #line 10 5 "freebsd/lib/libipsec/policy_token.l"933 #line 101 "../../freebsd/lib/libipsec/policy_token.l" 1004 934 { yylval.num = IPPROTO_TCP; return(PROTOCOL); } 1005 935 YY_BREAK 1006 936 case 12: 1007 937 YY_RULE_SETUP 1008 #line 10 7 "freebsd/lib/libipsec/policy_token.l"938 #line 103 "../../freebsd/lib/libipsec/policy_token.l" 1009 939 { yylval.num = IPSEC_MODE_TRANSPORT; return(MODE); } 1010 940 YY_BREAK 1011 941 case 13: 1012 942 YY_RULE_SETUP 1013 #line 10 8 "freebsd/lib/libipsec/policy_token.l"943 #line 104 "../../freebsd/lib/libipsec/policy_token.l" 1014 944 { yylval.num = IPSEC_MODE_TUNNEL; return(MODE); } 1015 945 YY_BREAK 1016 946 case 14: 1017 947 YY_RULE_SETUP 1018 #line 1 10 "freebsd/lib/libipsec/policy_token.l"948 #line 106 "../../freebsd/lib/libipsec/policy_token.l" 1019 949 { return(ME); } 1020 950 YY_BREAK 1021 951 case 15: 1022 952 YY_RULE_SETUP 1023 #line 1 11 "freebsd/lib/libipsec/policy_token.l"953 #line 107 "../../freebsd/lib/libipsec/policy_token.l" 1024 954 { return(ANY); } 1025 955 YY_BREAK 1026 956 case 16: 1027 957 YY_RULE_SETUP 1028 #line 1 13 "freebsd/lib/libipsec/policy_token.l"958 #line 109 "../../freebsd/lib/libipsec/policy_token.l" 1029 959 { yylval.num = IPSEC_LEVEL_DEFAULT; return(LEVEL); } 1030 960 YY_BREAK 1031 961 case 17: 1032 962 YY_RULE_SETUP 1033 #line 11 4 "freebsd/lib/libipsec/policy_token.l"963 #line 110 "../../freebsd/lib/libipsec/policy_token.l" 1034 964 { yylval.num = IPSEC_LEVEL_USE; return(LEVEL); } 1035 965 YY_BREAK 1036 966 case 18: 1037 967 YY_RULE_SETUP 1038 #line 11 5 "freebsd/lib/libipsec/policy_token.l"968 #line 111 "../../freebsd/lib/libipsec/policy_token.l" 1039 969 { yylval.num = IPSEC_LEVEL_REQUIRE; return(LEVEL); } 1040 970 YY_BREAK 1041 971 case 19: 1042 972 YY_RULE_SETUP 1043 #line 11 6 "freebsd/lib/libipsec/policy_token.l"973 #line 112 "../../freebsd/lib/libipsec/policy_token.l" 1044 974 { 1045 975 yylval.val.len = strlen(__libipsecyytext + 7); … … 1050 980 case 20: 1051 981 YY_RULE_SETUP 1052 #line 1 21 "freebsd/lib/libipsec/policy_token.l"982 #line 117 "../../freebsd/lib/libipsec/policy_token.l" 1053 983 { yylval.num = IPSEC_LEVEL_UNIQUE; return(LEVEL); } 1054 984 YY_BREAK 1055 985 case 21: 1056 986 YY_RULE_SETUP 1057 #line 1 22 "freebsd/lib/libipsec/policy_token.l"987 #line 118 "../../freebsd/lib/libipsec/policy_token.l" 1058 988 { return(SLASH); } 1059 989 YY_BREAK 1060 990 case 22: 1061 991 YY_RULE_SETUP 1062 #line 12 4 "freebsd/lib/libipsec/policy_token.l"992 #line 120 "../../freebsd/lib/libipsec/policy_token.l" 1063 993 { 1064 994 yylval.val.len = strlen(__libipsecyytext); … … 1069 999 case 23: 1070 1000 YY_RULE_SETUP 1071 #line 1 30 "freebsd/lib/libipsec/policy_token.l"1001 #line 126 "../../freebsd/lib/libipsec/policy_token.l" 1072 1002 { return(HYPHEN); } 1073 1003 YY_BREAK 1074 1004 case 24: 1075 1005 YY_RULE_SETUP 1076 #line 1 32 "freebsd/lib/libipsec/policy_token.l"1006 #line 128 "../../freebsd/lib/libipsec/policy_token.l" 1077 1007 { ; } 1078 1008 YY_BREAK … … 1080 1010 /* rule 25 can match eol */ 1081 1011 YY_RULE_SETUP 1082 #line 1 33 "freebsd/lib/libipsec/policy_token.l"1012 #line 129 "../../freebsd/lib/libipsec/policy_token.l" 1083 1013 { ; } 1084 1014 YY_BREAK 1085 1015 case 26: 1086 1016 YY_RULE_SETUP 1087 #line 13 5 "freebsd/lib/libipsec/policy_token.l"1017 #line 131 "../../freebsd/lib/libipsec/policy_token.l" 1088 1018 ECHO; 1089 1019 YY_BREAK 1090 #line 10 91 "<stdout>"1091 1092 1020 #line 1021 "<stdout>" 1021 case YY_STATE_EOF(INITIAL): 1022 yyterminate(); 1093 1023 1094 1024 case YY_END_OF_BUFFER: … … 1230 1160 static int yy_get_next_buffer (void) 1231 1161 { 1232 registerchar *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;1233 registerchar *source = (yytext_ptr);1234 registerint number_to_move, i;1162 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 1163 char *source = (yytext_ptr); 1164 int number_to_move, i; 1235 1165 int ret_val; 1236 1166 … … 1280 1210 { /* Not enough room in the buffer - grow it. */ 1281 1211 1282 YY_FATAL_ERROR( 1283 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 1212 /* just a shorter name for the current buffer */ 1213 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 1214 1215 int yy_c_buf_p_offset = 1216 (int) ((yy_c_buf_p) - b->yy_ch_buf); 1217 1218 if ( b->yy_is_our_buffer ) 1219 { 1220 yy_size_t new_size = b->yy_buf_size * 2; 1221 1222 if ( new_size <= 0 ) 1223 b->yy_buf_size += b->yy_buf_size / 8; 1224 else 1225 b->yy_buf_size *= 2; 1226 1227 b->yy_ch_buf = (char *) 1228 /* Include room in for 2 EOB chars. */ 1229 __libipsecyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 1230 } 1231 else 1232 /* Can't grow it, we don't own it. */ 1233 b->yy_ch_buf = 0; 1234 1235 if ( ! b->yy_ch_buf ) 1236 YY_FATAL_ERROR( 1237 "fatal error - scanner input buffer overflow" ); 1238 1239 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 1240 1241 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 1242 number_to_move - 1; 1284 1243 1285 1244 } … … 1335 1294 static yy_state_type yy_get_previous_state (void) 1336 1295 { 1337 registeryy_state_type yy_current_state;1338 registerchar *yy_cp;1296 yy_state_type yy_current_state; 1297 char *yy_cp; 1339 1298 1340 1299 yy_current_state = (yy_start); 1341 1300 1342 (yy_state_ptr) = (yy_state_buf);1343 *(yy_state_ptr)++ = yy_current_state;1344 1345 1301 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 1346 1302 { 1347 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1303 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1304 if ( yy_accept[yy_current_state] ) 1305 { 1306 (yy_last_accepting_state) = yy_current_state; 1307 (yy_last_accepting_cpos) = yy_cp; 1308 } 1348 1309 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1349 1310 { … … 1353 1314 } 1354 1315 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1355 *(yy_state_ptr)++ = yy_current_state;1356 1316 } 1357 1317 … … 1366 1326 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 1367 1327 { 1368 register int yy_is_jam; 1369 1370 register YY_CHAR yy_c = 1; 1328 int yy_is_jam; 1329 char *yy_cp = (yy_c_buf_p); 1330 1331 YY_CHAR yy_c = 1; 1332 if ( yy_accept[yy_current_state] ) 1333 { 1334 (yy_last_accepting_state) = yy_current_state; 1335 (yy_last_accepting_cpos) = yy_cp; 1336 } 1371 1337 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1372 1338 { … … 1377 1343 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1378 1344 yy_is_jam = (yy_current_state == 98); 1379 if ( ! yy_is_jam )1380 *(yy_state_ptr)++ = yy_current_state;1381 1345 1382 1346 return yy_is_jam ? 0 : yy_current_state; … … 1452 1416 *(yy_c_buf_p) = '\0'; /* preserve __libipsecyytext */ 1453 1417 (yy_hold_char) = *++(yy_c_buf_p); 1454 1455 if ( c == '\n' )1456 1457 __libipsecyylineno++;1458 ;1459 1418 1460 1419 return c; … … 1786 1745 char *buf; 1787 1746 yy_size_t n; 1788 int i;1747 yy_size_t i; 1789 1748