1/* A Bison parser, made by GNU Bison 2.1. */ 2 3/* Skeleton parser for Yacc-like parsing with Bison, 4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301, USA. */ 20 21/* As a special exception, when this file is copied by Bison into a 22 Bison output file, you may use that output file without restriction. 23 This special exception was added by the Free Software Foundation 24 in version 1.24 of Bison. */ 25 26/* Written by Richard Stallman by simplifying the original so called 27 ``semantic'' parser. */ 28 29/* All symbols defined below should begin with yy or YY, to avoid 30 infringing on user name space. This should be done even for local 31 variables, as they might otherwise be expanded by user macros. 32 There are some unavoidable exceptions within include files to 33 define necessary library symbols; they are noted "INFRINGES ON 34 USER NAME SPACE" below. */ 35 36/* Identify Bison output. */ 37#define YYBISON 1 38 39/* Bison version. */ 40#define YYBISON_VERSION "2.1" 41 42/* Skeleton name. */ 43#define YYSKELETON_NAME "yacc.c" 44 45/* Pure parsers. */ 46#define YYPURE 0 47 48/* Using locations. */ 49#define YYLSP_NEEDED 0 50 51/* Substitute the variable and function names. */ 52#define yyparse pcap_parse 53#define yylex pcap_lex 54#define yyerror pcap_error 55#define yylval pcap_lval 56#define yychar pcap_char 57#define yydebug pcap_debug 58#define yynerrs pcap_nerrs 59 60 61/* Tokens. */ 62#ifndef YYTOKENTYPE 63# define YYTOKENTYPE 64 /* Put the tokens into the symbol table, so that GDB and other debuggers 65 know about them. */ 66 enum yytokentype { 67 DST = 258, 68 SRC = 259, 69 HOST = 260, 70 GATEWAY = 261, 71 NET = 262, 72 NETMASK = 263, 73 PORT = 264, 74 PORTRANGE = 265, 75 LESS = 266, 76 GREATER = 267, 77 PROTO = 268, 78 PROTOCHAIN = 269, 79 CBYTE = 270, 80 ARP = 271, 81 RARP = 272, 82 IP = 273, 83 SCTP = 274, 84 TCP = 275, 85 UDP = 276, 86 ICMP = 277, 87 IGMP = 278, 88 IGRP = 279, 89 PIM = 280, 90 VRRP = 281, 91 ATALK = 282, 92 AARP = 283, 93 DECNET = 284, 94 LAT = 285, 95 SCA = 286, 96 MOPRC = 287, 97 MOPDL = 288, 98 TK_BROADCAST = 289, 99 TK_MULTICAST = 290, 100 NUM = 291, 101 INBOUND = 292, 102 OUTBOUND = 293, 103 PF_IFNAME = 294, 104 PF_RSET = 295, 105 PF_RNR = 296, 106 PF_SRNR = 297, 107 PF_REASON = 298, 108 PF_ACTION = 299, 109 LINK = 300, 110 GEQ = 301, 111 LEQ = 302, 112 NEQ = 303, 113 ID = 304, 114 EID = 305, 115 HID = 306, 116 HID6 = 307, 117 AID = 308, 118 LSH = 309, 119 RSH = 310, 120 LEN = 311, 121 IPV6 = 312, 122 ICMPV6 = 313, 123 AH = 314, 124 ESP = 315, 125 VLAN = 316, 126 MPLS = 317, 127 PPPOED = 318, 128 PPPOES = 319, 129 ISO = 320, 130 ESIS = 321, 131 CLNP = 322, 132 ISIS = 323, 133 L1 = 324, 134 L2 = 325, 135 IIH = 326, 136 LSP = 327, 137 SNP = 328, 138 CSNP = 329, 139 PSNP = 330, 140 STP = 331, 141 IPX = 332, 142 NETBEUI = 333, 143 LANE = 334, 144 LLC = 335, 145 METAC = 336, 146 BCC = 337, 147 SC = 338, 148 ILMIC = 339, 149 OAMF4EC = 340, 150 OAMF4SC = 341, 151 OAM = 342, 152 OAMF4 = 343, 153 CONNECTMSG = 344, 154 METACONNECT = 345, 155 VPI = 346, 156 VCI = 347, 157 RADIO = 348, 158 FISU = 349, 159 LSSU = 350, 160 MSU = 351, 161 SIO = 352, 162 OPC = 353, 163 DPC = 354, 164 SLS = 355, 165 AND = 356, 166 OR = 357, 167 UMINUS = 358 168 }; 169#endif 170/* Tokens. */ 171#define DST 258 172#define SRC 259 173#define HOST 260 174#define GATEWAY 261 175#define NET 262 176#define NETMASK 263 177#define PORT 264 178#define PORTRANGE 265 179#define LESS 266 180#define GREATER 267 181#define PROTO 268 182#define PROTOCHAIN 269 183#define CBYTE 270 184#define ARP 271 185#define RARP 272 186#define IP 273 187#define SCTP 274 188#define TCP 275 189#define UDP 276 190#define ICMP 277 191#define IGMP 278 192#define IGRP 279 193#define PIM 280 194#define VRRP 281 195#define ATALK 282 196#define AARP 283 197#define DECNET 284 198#define LAT 285 199#define SCA 286 200#define MOPRC 287 201#define MOPDL 288 202#define TK_BROADCAST 289 203#define TK_MULTICAST 290 204#define NUM 291 205#define INBOUND 292 206#define OUTBOUND 293 207#define PF_IFNAME 294 208#define PF_RSET 295 209#define PF_RNR 296 210#define PF_SRNR 297 211#define PF_REASON 298 212#define PF_ACTION 299 213#define LINK 300 214#define GEQ 301 215#define LEQ 302 216#define NEQ 303 217#define ID 304 218#define EID 305 219#define HID 306 220#define HID6 307 221#define AID 308 222#define LSH 309 223#define RSH 310 224#define LEN 311 225#define IPV6 312 226#define ICMPV6 313 227#define AH 314 228#define ESP 315 229#define VLAN 316 230#define MPLS 317 231#define PPPOED 318 232#define PPPOES 319 233#define ISO 320 234#define ESIS 321 235#define CLNP 322 236#define ISIS 323 237#define L1 324 238#define L2 325 239#define IIH 326 240#define LSP 327 241#define SNP 328 242#define CSNP 329 243#define PSNP 330 244#define STP 331 245#define IPX 332 246#define NETBEUI 333 247#define LANE 334 248#define LLC 335 249#define METAC 336 250#define BCC 337 251#define SC 338 252#define ILMIC 339 253#define OAMF4EC 340 254#define OAMF4SC 341 255#define OAM 342 256#define OAMF4 343 257#define CONNECTMSG 344 258#define METACONNECT 345 259#define VPI 346 260#define VCI 347 261#define RADIO 348 262#define FISU 349 263#define LSSU 350 264#define MSU 351 265#define SIO 352 266#define OPC 353 267#define DPC 354 268#define SLS 355 269#define AND 356 270#define OR 357 271#define UMINUS 358 272 273 274 275 276/* Copy the first part of user declarations. */ 277#line 1 "grammar.y" 278 279/* 280 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 281 * The Regents of the University of California. All rights reserved. 282 * 283 * Redistribution and use in source and binary forms, with or without 284 * modification, are permitted provided that: (1) source code distributions 285 * retain the above copyright notice and this paragraph in its entirety, (2) 286 * distributions including binary code include the above copyright notice and 287 * this paragraph in its entirety in the documentation or other materials 288 * provided with the distribution, and (3) all advertising materials mentioning 289 * features or use of this software display the following acknowledgement: 290 * ``This product includes software developed by the University of California, 291 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 292 * the University nor the names of its contributors may be used to endorse 293 * or promote products derived from this software without specific prior 294 * written permission. 295 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 296 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 297 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 298 * 299 */ 300#ifndef lint 301static const char rcsid[] _U_ = 302 "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.86.2.9 2007/09/12 19:17:25 guy Exp $ (LBL)"; 303#endif 304 305#ifdef HAVE_CONFIG_H 306#include "config.h" 307#endif 308 309#ifdef WIN32 310#include <pcap-stdinc.h> 311#else /* WIN32 */ 312#include <sys/types.h> 313#include <sys/socket.h> 314#endif /* WIN32 */ 315 316#include <stdlib.h> 317 318#ifndef WIN32 319#if __STDC__ 320struct mbuf; 321struct rtentry; 322#endif 323 324#include <netinet/in.h> 325#endif /* WIN32 */ 326 327#include <stdio.h> 328 329#include "pcap-int.h" 330 331#include "gencode.h" 332#ifdef HAVE_NET_PFVAR_H 333#include <net/if.h> 334#include <net/pfvar.h> 335#include <net/if_pflog.h> 336#endif 337#include <pcap-namedb.h> 338 339#ifdef HAVE_OS_PROTO_H 340#include "os-proto.h" 341#endif 342 343#define QSET(q, p, d, a) (q).proto = (p),\ 344 (q).dir = (d),\ 345 (q).addr = (a) 346 347int n_errors = 0; 348 349static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; 350 351static void 352yyerror(const char *msg) 353{ 354 ++n_errors; 355 bpf_error("%s", msg); 356 /* NOTREACHED */ 357} 358 359#ifndef YYBISON 360int yyparse(void); 361 362int 363pcap_parse() 364{ 365 return (yyparse()); 366} 367#endif 368 369#ifdef HAVE_NET_PFVAR_H 370static int 371pfreason_to_num(const char *reason) 372{ 373 const char *reasons[] = PFRES_NAMES; 374 int i; 375 376 for (i = 0; reasons[i]; i++) { 377 if (pcap_strcasecmp(reason, reasons[i]) == 0) 378 return (i); 379 } 380 bpf_error("unknown PF reason"); 381 /*NOTREACHED*/ 382} 383 384static int 385pfaction_to_num(const char *action) 386{ 387 if (pcap_strcasecmp(action, "pass") == 0 || 388 pcap_strcasecmp(action, "accept") == 0) 389 return (PF_PASS); 390 else if (pcap_strcasecmp(action, "drop") == 0 || 391 pcap_strcasecmp(action, "block") == 0) 392 return (PF_DROP); 393 else { 394 bpf_error("unknown PF action"); 395 /*NOTREACHED*/ 396 } 397} 398#else /* !HAVE_NET_PFVAR_H */ 399static int 400pfreason_to_num(const char *reason) 401{ 402 bpf_error("libpcap was compiled on a machine without pf support"); 403 /*NOTREACHED*/ 404} 405 406static int 407pfaction_to_num(const char *action) 408{ 409 bpf_error("libpcap was compiled on a machine without pf support"); 410 /*NOTREACHED*/ 411} 412#endif /* HAVE_NET_PFVAR_H */ 413 414 415/* Enabling traces. */ 416#ifndef YYDEBUG 417# define YYDEBUG 0 418#endif 419 420/* Enabling verbose error messages. */ 421#ifdef YYERROR_VERBOSE 422# undef YYERROR_VERBOSE 423# define YYERROR_VERBOSE 1 424#else 425# define YYERROR_VERBOSE 0 426#endif 427 428/* Enabling the token table. */ 429#ifndef YYTOKEN_TABLE 430# define YYTOKEN_TABLE 0 431#endif 432 433#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 434#line 138 "grammar.y" 435typedef union YYSTYPE { 436 int i; 437 bpf_u_int32 h; 438 u_char *e; 439 char *s; 440 struct stmt *stmt; 441 struct arth *a; 442 struct { 443 struct qual q; 444 int atmfieldtype; 445 int mtp3fieldtype; 446 struct block *b; 447 } blk; 448 struct block *rblk; 449} YYSTYPE; 450/* Line 196 of yacc.c. */ 451#line 452 "y.tab.c" 452# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 453# define YYSTYPE_IS_DECLARED 1 454# define YYSTYPE_IS_TRIVIAL 1 455#endif 456 457 458 459/* Copy the second part of user declarations. */ 460 461 462/* Line 219 of yacc.c. */ 463#line 464 "y.tab.c" 464 465#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 466# define YYSIZE_T __SIZE_TYPE__ 467#endif 468#if ! defined (YYSIZE_T) && defined (size_t) 469# define YYSIZE_T size_t 470#endif 471#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) 472# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 473# define YYSIZE_T size_t 474#endif 475#if ! defined (YYSIZE_T) 476# define YYSIZE_T unsigned int 477#endif 478 479#ifndef YY_ 480# if YYENABLE_NLS 481# if ENABLE_NLS 482# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 483# define YY_(msgid) dgettext ("bison-runtime", msgid) 484# endif 485# endif 486# ifndef YY_ 487# define YY_(msgid) msgid 488# endif 489#endif 490 491#if ! defined (yyoverflow) || YYERROR_VERBOSE 492 493/* The parser invokes alloca or malloc; define the necessary symbols. */ 494 495# ifdef YYSTACK_USE_ALLOCA 496# if YYSTACK_USE_ALLOCA 497# ifdef __GNUC__ 498# define YYSTACK_ALLOC __builtin_alloca 499# else 500# define YYSTACK_ALLOC alloca 501# if defined (__STDC__) || defined (__cplusplus) 502# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 503# define YYINCLUDED_STDLIB_H 504# endif 505# endif 506# endif 507# endif 508 509# ifdef YYSTACK_ALLOC 510 /* Pacify GCC's `empty if-body' warning. */ 511# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 512# ifndef YYSTACK_ALLOC_MAXIMUM 513 /* The OS might guarantee only one guard page at the bottom of the stack, 514 and a page size can be as small as 4096 bytes. So we cannot safely 515 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 516 to allow for a few compiler-allocated temporary stack slots. */ 517# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ 518# endif 519# else 520# define YYSTACK_ALLOC YYMALLOC 521# define YYSTACK_FREE YYFREE 522# ifndef YYSTACK_ALLOC_MAXIMUM 523# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) 524# endif 525# ifdef __cplusplus 526extern "C" { 527# endif 528# ifndef YYMALLOC 529# define YYMALLOC malloc 530# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ 531 && (defined (__STDC__) || defined (__cplusplus))) 532void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 533# endif 534# endif 535# ifndef YYFREE 536# define YYFREE free 537# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ 538 && (defined (__STDC__) || defined (__cplusplus))) 539void free (void *); /* INFRINGES ON USER NAME SPACE */ 540# endif 541# endif 542# ifdef __cplusplus 543} 544# endif 545# endif 546#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 547 548 549#if (! defined (yyoverflow) \ 550 && (! defined (__cplusplus) \ 551 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) 552 553/* A type that is properly aligned for any stack member. */ 554union yyalloc 555{ 556 short int yyss; 557 YYSTYPE yyvs; 558 }; 559 560/* The size of the maximum gap between one aligned stack and the next. */ 561# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 562 563/* The size of an array large to enough to hold all stacks, each with 564 N elements. */ 565# define YYSTACK_BYTES(N) \ 566 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ 567 + YYSTACK_GAP_MAXIMUM) 568 569/* Copy COUNT objects from FROM to TO. The source and destination do 570 not overlap. */ 571# ifndef YYCOPY 572# if defined (__GNUC__) && 1 < __GNUC__ 573# define YYCOPY(To, From, Count) \ 574 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 575# else 576# define YYCOPY(To, From, Count) \ 577 do \ 578 { \ 579 YYSIZE_T yyi; \ 580 for (yyi = 0; yyi < (Count); yyi++) \ 581 (To)[yyi] = (From)[yyi]; \ 582 } \ 583 while (0) 584# endif 585# endif 586 587/* Relocate STACK from its old location to the new one. The 588 local variables YYSIZE and YYSTACKSIZE give the old and new number of 589 elements in the stack, and YYPTR gives the new location of the 590 stack. Advance YYPTR to a properly aligned location for the next 591 stack. */ 592# define YYSTACK_RELOCATE(Stack) \ 593 do \ 594 { \ 595 YYSIZE_T yynewbytes; \ 596 YYCOPY (&yyptr->Stack, Stack, yysize); \ 597 Stack = &yyptr->Stack; \ 598 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 599 yyptr += yynewbytes / sizeof (*yyptr); \ 600 } \ 601 while (0) 602 603#endif 604 605#if defined (__STDC__) || defined (__cplusplus) 606 typedef signed char yysigned_char; 607#else 608 typedef short int yysigned_char; 609#endif 610 611/* YYFINAL -- State number of the termination state. */ 612#define YYFINAL 3 613/* YYLAST -- Last index in YYTABLE. */ 614#define YYLAST 605 615 616/* YYNTOKENS -- Number of terminals. */ 617#define YYNTOKENS 119 618/* YYNNTS -- Number of nonterminals. */ 619#define YYNNTS 41 620/* YYNRULES -- Number of rules. */ 621#define YYNRULES 186 622/* YYNRULES -- Number of states. */ 623#define YYNSTATES 254 624 625/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 626#define YYUNDEFTOK 2 627#define YYMAXUTOK 358 628 629#define YYTRANSLATE(YYX) \ 630 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 631 632/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 633static const unsigned char yytranslate[] = 634{ 635 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 638 2, 2, 2, 103, 2, 2, 2, 2, 105, 2, 639 112, 111, 108, 106, 2, 107, 2, 109, 2, 2, 640 2, 2, 2, 2, 2, 2, 2, 2, 118, 2, 641 115, 114, 113, 2, 2, 2, 2, 2, 2, 2, 642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 644 2, 116, 2, 117, 2, 2, 2, 2, 2, 2, 645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 647 2, 2, 2, 2, 104, 2, 2, 2, 2, 2, 648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 660 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 661 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 662 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 663 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 664 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 665 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 666 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 667 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 668 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 669 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 670 95, 96, 97, 98, 99, 100, 101, 102, 110 671}; 672 673#if YYDEBUG 674/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 675 YYRHS. */ 676static const unsigned short int yyprhs[] = 677{ 678 0, 0, 3, 6, 8, 9, 11, 15, 19, 23, 679 27, 29, 31, 33, 35, 39, 41, 45, 49, 51, 680 55, 57, 59, 61, 64, 66, 68, 70, 74, 78, 681 80, 82, 84, 87, 91, 94, 97, 100, 103, 106, 682 109, 113, 115, 119, 123, 125, 127, 129, 132, 134, 683 137, 139, 140, 142, 144, 148, 152, 156, 160, 162, 684 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 685 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 686 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 687 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 688 244, 246, 249, 252, 255, 258, 263, 265, 267, 270, 689 272, 275, 277, 279, 281, 283, 286, 289, 292, 295, 690 298, 301, 303, 305, 307, 309, 311, 313, 315, 317, 691 319, 321, 323, 328, 335, 339, 343, 347, 351, 355, 692 359, 363, 367, 370, 374, 376, 378, 380, 382, 384, 693 386, 388, 392, 394, 396, 398, 400, 402, 404, 406, 694 408, 410, 412, 414, 416, 418, 420, 422, 425, 428, 695 432, 434, 436, 440, 442, 444, 446, 448, 450, 452, 696 454, 456, 459, 462, 466, 468, 470 697}; 698 699/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 700static const short int yyrhs[] = 701{ 702 120, 0, -1, 121, 122, -1, 121, -1, -1, 131, 703 -1, 122, 123, 131, -1, 122, 123, 125, -1, 122, 704 124, 131, -1, 122, 124, 125, -1, 101, -1, 102, 705 -1, 126, -1, 148, -1, 128, 129, 111, -1, 49, 706 -1, 51, 109, 36, -1, 51, 8, 51, -1, 51, 707 -1, 52, 109, 36, -1, 52, -1, 50, -1, 53, 708 -1, 127, 125, -1, 103, -1, 112, -1, 126, -1, 709 130, 123, 125, -1, 130, 124, 125, -1, 148, -1, 710 129, -1, 133, -1, 127, 131, -1, 134, 135, 136, 711 -1, 134, 135, -1, 134, 136, -1, 134, 13, -1, 712 134, 14, -1, 134, 137, -1, 132, 125, -1, 128, 713 122, 111, -1, 138, -1, 145, 143, 145, -1, 145, 714 144, 145, -1, 139, -1, 149, -1, 150, -1, 151, 715 152, -1, 155, -1, 156, 157, -1, 138, -1, -1, 716 4, -1, 3, -1, 4, 102, 3, -1, 3, 102, 717 4, -1, 4, 101, 3, -1, 3, 101, 4, -1, 718 5, -1, 7, -1, 9, -1, 10, -1, 6, -1, 719 45, -1, 18, -1, 16, -1, 17, -1, 19, -1, 720 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, 721 25, -1, 26, -1, 27, -1, 28, -1, 29, -1, 722 30, -1, 31, -1, 33, -1, 32, -1, 57, -1, 723 58, -1, 59, -1, 60, -1, 65, -1, 66, -1, 724 68, -1, 69, -1, 70, -1, 71, -1, 72, -1, 725 73, -1, 75, -1, 74, -1, 67, -1, 76, -1, 726 77, -1, 78, -1, 93, -1, 134, 34, -1, 134, 727 35, -1, 11, 36, -1, 12, 36, -1, 15, 36, 728 147, 36, -1, 37, -1, 38, -1, 61, 148, -1, 729 61, -1, 62, 148, -1, 62, -1, 63, -1, 64, 730 -1, 140, -1, 39, 49, -1, 40, 49, -1, 41, 731 36, -1, 42, 36, -1, 43, 141, -1, 44, 142, 732 -1, 36, -1, 49, -1, 49, -1, 113, -1, 46, 733 -1, 114, -1, 47, -1, 115, -1, 48, -1, 148, 734 -1, 146, -1, 138, 116, 145, 117, -1, 138, 116, 735 145, 118, 36, 117, -1, 145, 106, 145, -1, 145, 736 107, 145, -1, 145, 108, 145, -1, 145, 109, 145, 737 -1, 145, 105, 145, -1, 145, 104, 145, -1, 145, 738 54, 145, -1, 145, 55, 145, -1, 107, 145, -1, 739 128, 146, 111, -1, 56, -1, 105, -1, 104, -1, 740 115, -1, 113, -1, 114, -1, 36, -1, 128, 148, 741 111, -1, 79, -1, 80, -1, 81, -1, 82, -1, 742 85, -1, 86, -1, 83, -1, 84, -1, 87, -1, 743 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 744 153, -1, 143, 36, -1, 144, 36, -1, 128, 154, 745 111, -1, 36, -1, 153, -1, 154, 124, 153, -1, 746 94, -1, 95, -1, 96, -1, 97, -1, 98, -1, 747 99, -1, 100, -1, 158, -1, 143, 36, -1, 144, 748 36, -1, 128, 159, 111, -1, 36, -1, 158, -1, 749 159, 124, 158, -1 750}; 751 752/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 753static const unsigned short int yyrline[] = 754{ 755 0, 210, 210, 214, 216, 218, 219, 220, 221, 222, 756 224, 226, 228, 229, 231, 233, 234, 236, 238, 243, 757 252, 261, 270, 279, 281, 283, 285, 286, 287, 289, 758 291, 293, 294, 296, 297, 298, 299, 300, 301, 303, 759 304, 305, 306, 308, 310, 311, 312, 313, 314, 315, 760 318, 319, 322, 323, 324, 325, 326, 327, 330, 331, 761 332, 333, 336, 338, 339, 340, 341, 342, 343, 344, 762 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 763 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 764 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 765 375, 377, 378, 379, 380, 381, 382, 383, 384, 385, 766 386, 387, 388, 389, 390, 393, 394, 395, 396, 397, 767 398, 401, 402, 405, 408, 409, 410, 412, 413, 414, 768 416, 417, 419, 420, 421, 422, 423, 424, 425, 426, 769 427, 428, 429, 430, 431, 433, 434, 435, 436, 437, 770 439, 440, 442, 443, 444, 445, 446, 447, 448, 449, 771 451, 452, 453, 454, 457, 458, 460, 461, 462, 463, 772 465, 472, 473, 476, 477, 478, 481, 482, 483, 484, 773 486, 487, 488, 489, 491, 500, 501 774}; 775#endif 776 777#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 778/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 779 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 780static const char *const yytname[] = 781{ 782 "$end", "error", "$undefined", "DST", "SRC", "HOST", "GATEWAY", "NET", 783 "NETMASK", "PORT", "PORTRANGE", "LESS", "GREATER", "PROTO", "PROTOCHAIN", 784 "CBYTE", "ARP", "RARP", "IP", "SCTP", "TCP", "UDP", "ICMP", "IGMP", 785 "IGRP", "PIM", "VRRP", "ATALK", "AARP", "DECNET", "LAT", "SCA", "MOPRC", 786 "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND", "OUTBOUND", 787 "PF_IFNAME", "PF_RSET", "PF_RNR", "PF_SRNR", "PF_REASON", "PF_ACTION", 788 "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID", "HID6", "AID", "LSH", 789 "RSH", "LEN", "IPV6", "ICMPV6", "AH", "ESP", "VLAN", "MPLS", "PPPOED", 790 "PPPOES", "ISO", "ESIS", "CLNP", "ISIS", "L1", "L2", "IIH", "LSP", "SNP", 791 "CSNP", "PSNP", "STP", "IPX", "NETBEUI", "LANE", "LLC", "METAC", "BCC", 792 "SC", "ILMIC", "OAMF4EC", "OAMF4SC", "OAM", "OAMF4", "CONNECTMSG", 793 "METACONNECT", "VPI", "VCI", "RADIO", "FISU", "LSSU", "MSU", "SIO", 794 "OPC", "DPC", "SLS", "AND", "OR", "'!'", "'|'", "'&'", "'+'", "'-'", 795 "'*'", "'/'", "UMINUS", "')'", "'('", "'>'", "'='", "'<'", "'['", "']'", 796 "':'", "$accept", "prog", "null", "expr", "and", "or", "id", "nid", 797 "not", "paren", "pid", "qid", "term", "head", "rterm", "pqual", "dqual", 798 "aqual", "ndaqual", "pname", "other", "pfvar", "reason", "action", 799 "relop", "irelop", "arth", "narth", "byteop", "pnum", "atmtype", 800 "atmmultitype", "atmfield", "atmvalue", "atmfieldvalue", "atmlistvalue", 801 "mtp2type", "mtp3field", "mtp3value", "mtp3fieldvalue", "mtp3listvalue", 0 802}; 803#endif 804 805# ifdef YYPRINT 806/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 807 token YYLEX-NUM. */ 808static const unsigned short int yytoknum[] = 809{ 810 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 811 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 812 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 813 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 814 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 815 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 816 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 817 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 818 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 819 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 820 355, 356, 357, 33, 124, 38, 43, 45, 42, 47, 821 358, 41, 40, 62, 61, 60, 91, 93, 58 822}; 823# endif 824 825/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 826static const unsigned char yyr1[] = 827{ 828 0, 119, 120, 120, 121, 122, 122, 122, 122, 122, 829 123, 124, 125, 125, 125, 126, 126, 126, 126, 126, 830 126, 126, 126, 126, 127, 128, 129, 129, 129, 130, 831 130, 131, 131, 132, 132, 132, 132, 132, 132, 133, 832 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 833 134, 134, 135, 135, 135, 135, 135, 135, 136, 136, 834 136, 136, 137, 138, 138, 138, 138, 138, 138, 138, 835 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 836 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 837 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 838 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, 839 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 840 140, 141, 141, 142, 143, 143, 143, 144, 144, 144, 841 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 842 146, 146, 146, 146, 146, 147, 147, 147, 147, 147, 843 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 844 150, 150, 150, 150, 151, 151, 152, 152, 152, 152, 845 153, 154, 154, 155, 155, 155, 156, 156, 156, 156, 846 157, 157, 157, 157, 158, 159, 159 847}; 848 849/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 850static const unsigned char yyr2[] = 851{ 852 0, 2, 2, 1, 0, 1, 3, 3, 3, 3, 853 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, 854 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 855 1, 1, 2, 3, 2, 2, 2, 2, 2, 2, 856 3, 1, 3, 3, 1, 1, 1, 2, 1, 2, 857 1, 0, 1, 1, 3, 3, 3, 3, 1, 1, 858 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 859 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 860 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 861 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 862 1, 2, 2, 2, 2, 4, 1, 1, 2, 1, 863 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 864 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 865 1, 1, 4, 6, 3, 3, 3, 3, 3, 3, 866 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 867 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 868 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 869 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 870 1, 2, 2, 3, 1, 1, 3 871}; 872 873/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 874 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 875 means the default is an error. */ 876static const unsigned char yydefact[] = 877{ 878 4, 0, 51, 1, 0, 0, 0, 65, 66, 64, 879 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 880 77, 78, 79, 81, 80, 150, 106, 107, 0, 0, 881 0, 0, 0, 0, 63, 144, 82, 83, 84, 85, 882 109, 111, 112, 113, 86, 87, 96, 88, 89, 90, 883 91, 92, 93, 95, 94, 97, 98, 99, 152, 153, 884 154, 155, 158, 159, 156, 157, 160, 161, 162, 163, 885 164, 165, 100, 173, 174, 175, 176, 177, 178, 179, 886 24, 0, 25, 2, 51, 51, 5, 0, 31, 0, 887 50, 44, 114, 0, 131, 130, 45, 46, 0, 48, 888 0, 103, 104, 0, 115, 116, 117, 118, 121, 122, 889 119, 123, 120, 0, 108, 110, 0, 0, 142, 10, 890 11, 51, 51, 32, 0, 131, 130, 15, 21, 18, 891 20, 22, 39, 12, 0, 0, 13, 53, 52, 58, 892 62, 59, 60, 61, 36, 37, 101, 102, 34, 35, 893 38, 0, 125, 127, 129, 0, 0, 0, 0, 0, 894 0, 0, 0, 124, 126, 128, 0, 0, 170, 0, 895 0, 0, 47, 166, 184, 0, 0, 0, 49, 180, 896 146, 145, 148, 149, 147, 0, 0, 0, 7, 51, 897 51, 6, 130, 9, 8, 40, 143, 151, 0, 0, 898 0, 23, 26, 30, 0, 29, 0, 0, 0, 0, 899 33, 0, 140, 141, 139, 138, 134, 135, 136, 137, 900 42, 43, 171, 0, 167, 168, 185, 0, 181, 182, 901 105, 130, 17, 16, 19, 14, 0, 0, 57, 55, 902 56, 54, 132, 0, 169, 0, 183, 0, 27, 28, 903 0, 172, 186, 133 904}; 905 906/* YYDEFGOTO[NTERM-NUM]. */ 907static const short int yydefgoto[] = 908{ 909 -1, 1, 2, 124, 121, 122, 201, 133, 134, 116, 910 203, 204, 86, 87, 88, 89, 148, 149, 150, 117, 911 91, 92, 110, 112, 166, 167, 93, 94, 185, 95, 912 96, 97, 98, 172, 173, 223, 99, 100, 178, 179, 913 227 914}; 915 916/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 917 STATE-NUM. */ 918#define YYPACT_NINF -181 919static const short int yypact[] = 920{ 921 -181, 19, 200, -181, -3, 1, 15, -181, -181, -181, 922 -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, 923 -181, -181, -181, -181, -181, -181, -181, -181, 13, 20, 924 18, 44, -26, 35, -181, -181, -181, -181, -181, -181, 925 -19, -19, -181, -181, -181, -181, -181, -181, -181, -181, 926 -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, 927 -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, 928 -181, -181, -181, -181, -181, -181, -181, -181, -181, -181, 929 -181, 493, -181, 41, 396, 396, -181, -24, -181, 155, 930 2, -181, -181, 488, -181, -181, -181, -181, 9, -181, 931 134, -181, -181, 62, -181, -181, -181, -181, -181, -181, 932 -181, -181, -181, -19, -181, -181, 493, -9, -181, -181, 933 -181, 298, 298, -181, -53, -14, -1, -181, -181, 0, 934 3, -181, -181, -181, -24, -24, -181, 77, 82, -181, 935 -181, -181, -181, -181, -181, -181, -181, -181, 437, -181, 936 -181, 493, -181, -181, -181, 493, 493, 493, 493, 493, 937 493, 493, 493, -181, -181, -181, 493, 493, -181, 78, 938 81, 89, -181, -181, -181, 95, 108, 113, -181, -181, 939 -181, -181, -181, -181, -181, 120, -1, -34, -181, 298, 940 298, -181, 4, -181, -181, -181, -181, -181, 112, 149, 941 150, -181, -181, 80, 41, -1, 188, 189, 205, 206, 942 -181, -41, 65, 65, 98, 144, -93, -93, -181, -181, 943 -34, -34, -181, -80, -181, -181, -181, -58, -181, -181, 944 -181, 46, -181, -181, -181, -181, -24, -24, -181, -181, 945 -181, -181, -181, 174, -181, 78, -181, 95, -181, -181, 946 96, -181, -181, -181 947}; 948 949/* YYPGOTO[NTERM-NUM]. */ 950static const short int yypgoto[] = 951{ 952 -181, -181, -181, 212, 50, -180, -86, -89, 5, -2, 953 -181, -181, -81, -181, -181, -181, -181, 107, -181, 7, 954 -181, -181, -181, -181, -66, -39, -21, -74, -181, -35, 955 -181, -181, -181, -181, -151, -181, -181, -181, -181, -145, 956 -181 957}; 958 959/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 960 positive, shift that token. If negative, reduce the rule which 961 number is the opposite. If zero, do what YYDEFACT says. 962 If YYTABLE_NINF, syntax error. */ 963#define YYTABLE_NINF -42 964static const short int yytable[] = 965{ 966 85, 132, -41, 123, -13, 114, 115, 84, 198, 90, 967 108, 125, 25, 155, 156, 161, 162, 25, 222, 3, 968 155, 156, 120, 109, 237, 127, 128, 129, 130, 131, 969 226, 244, 170, 101, 176, 188, 193, 102, 113, 113, 970 191, 194, 125, 245, 120, 168, 202, 247, 119, 120, 971 126, 103, 136, 246, 106, 152, 153, 154, 195, 171, 972 118, 177, 104, 157, 158, 159, 160, 161, 162, 105, 973 157, 158, 159, 160, 161, 162, 242, 243, 186, 80, 974 107, 126, 85, 85, 111, 135, 192, 192, 82, 84, 975 84, 90, 90, 82, 251, 187, 169, 196, 175, 136, 976 205, 202, 252, -41, -41, -13, -13, 151, 123, 199, 977 197, 113, 200, -41, 168, -13, 125, 224, 151, 190, 978 190, 82, 163, 164, 165, 225, 189, 189, 90, 90, 979 211, 174, 135, 113, 212, 213, 214, 215, 216, 217, 980 218, 219, 119, 120, 228, 220, 221, -29, -29, 229, 981 248, 249, 155, 156, 192, 231, 230, 197, 137, 138, 982 139, 140, 141, 232, 142, 143, 180, 181, 144, 145, 983 174, 159, 160, 161, 162, 182, 183, 184, 206, 207, 984 152, 153, 154, 208, 209, 233, 234, 190, 85, 146, 985 147, 235, 238, 239, 189, 189, 90, 90, 155, 156, 986 -3, 136, 136, 158, 159, 160, 161, 162, 240, 241, 987 250, 4, 5, 253, 83, 6, 7, 8, 9, 10, 988 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 989 21, 22, 23, 24, 135, 135, 25, 26, 27, 28, 990 29, 30, 31, 32, 33, 34, 82, 163, 164, 165, 991 159, 160, 161, 162, 236, 210, 35, 36, 37, 38, 992 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 993 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 994 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 995 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 996 79, 0, 0, 80, 0, 0, 0, 81, 0, 4, 997 5, 0, 82, 6, 7, 8, 9, 10, 11, 12, 998 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 999 23, 24, 0, 0, 25, 26, 27, 28, 29, 30, 1000 31, 32, 33, 34, 0, 0, 0, 127, 128, 129, 1001 130, 131, 0, 0, 35, 36, 37, 38, 39, 40, 1002 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1003 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 1004 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 1005 71, 72, 73, 74, 75, 76, 77, 78, 79, 0, 1006 0, 80, 0, 0, 0, 81, 0, 4, 5, 0, 1007 82, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1008 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1009 0, 0, 25, 26, 27, 28, 29, 30, 31, 32, 1010 33, 34, 139, 0, 141, 0, 142, 143, 0, 0, 1011 0, 0, 35, 36, 37, 38, 39, 40, 41, 42, 1012 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 1013 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 1014 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 1015 73, 74, 75, 76, 77, 78, 79, 0, 0, 80, 1016 0, 0, 0, 81, 0, 0, 0, 0, 82, 7, 1017 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1018 18, 19, 20, 21, 22, 23, 24, 0, 0, 25, 1019 0, 0, 0, 0, 152, 153, 154, 0, 34, 0, 1020 0, 0, 155, 156, 0, 0, 0, 0, 0, 35, 1021 36, 37, 38, 39, 0, 0, 0, 0, 44, 45, 1022 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 1023 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 1024 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 1025 0, 0, 157, 158, 159, 160, 161, 162, 0, 0, 1026 81, 163, 164, 165, 0, 82 1027}; 1028 1029static const short int yycheck[] = 1030{ 1031 2, 87, 0, 84, 0, 40, 41, 2, 8, 2, 1032 36, 85, 36, 54, 55, 108, 109, 36, 169, 0, 1033 54, 55, 102, 49, 204, 49, 50, 51, 52, 53, 1034 175, 111, 98, 36, 100, 121, 122, 36, 40, 41, 1035 121, 122, 116, 223, 102, 36, 135, 227, 101, 102, 1036 85, 36, 87, 111, 36, 46, 47, 48, 111, 98, 1037 81, 100, 49, 104, 105, 106, 107, 108, 109, 49, 1038 104, 105, 106, 107, 108, 109, 117, 118, 113, 103, 1039 36, 116, 84, 85, 49, 87, 121, 122, 112, 84, 1040 85, 84, 85, 112, 245, 116, 98, 111, 100, 134, 1041 135, 190, 247, 101, 102, 101, 102, 116, 189, 109, 1042 111, 113, 109, 111, 36, 111, 190, 36, 116, 121, 1043 122, 112, 113, 114, 115, 36, 121, 122, 121, 122, 1044 151, 36, 134, 135, 155, 156, 157, 158, 159, 160, 1045 161, 162, 101, 102, 36, 166, 167, 101, 102, 36, 1046 236, 237, 54, 55, 189, 190, 36, 111, 3, 4, 1047 5, 6, 7, 51, 9, 10, 104, 105, 13, 14, 1048 36, 106, 107, 108, 109, 113, 114, 115, 101, 102, 1049 46, 47, 48, 101, 102, 36, 36, 189, 190, 34, 1050 35, 111, 4, 4, 189, 190, 189, 190, 54, 55, 1051 0, 236, 237, 105, 106, 107, 108, 109, 3, 3, 1052 36, 11, 12, 117, 2, 15, 16, 17, 18, 19, 1053 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1054 30, 31, 32, 33, 236, 237, 36, 37, 38, 39, 1055 40, 41, 42, 43, 44, 45, 112, 113, 114, 115, 1056 106, 107, 108, 109, 204, 148, 56, 57, 58, 59, 1057 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 1058 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1059 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 1060 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 1061 100, -1, -1, 103, -1, -1, -1, 107, -1, 11, 1062 12, -1, 112, 15, 16, 17, 18, 19, 20, 21, 1063 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1064 32, 33, -1, -1, 36, 37, 38, 39, 40, 41, 1065 42, 43, 44, 45, -1, -1, -1, 49, 50, 51, 1066 52, 53, -1, -1, 56, 57, 58, 59, 60, 61, 1067 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 1068 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 1069 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 1070 92, 93, 94, 95, 96, 97, 98, 99, 100, -1, 1071 -1, 103, -1, -1, -1, 107, -1, 11, 12, -1, 1072 112, 15, 16, 17, 18, 19, 20, 21, 22, 23, 1073 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 1074 -1, -1, 36, 37, 38, 39, 40, 41, 42, 43, 1075 44, 45, 5, -1, 7, -1, 9, 10, -1, -1, 1076 -1, -1, 56, 57, 58, 59, 60, 61, 62, 63, 1077 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 1078 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 1079 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 1080 94, 95, 96, 97, 98, 99, 100, -1, -1, 103, 1081 -1, -1, -1, 107, -1, -1, -1, -1, 112, 16, 1082 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1083 27, 28, 29, 30, 31, 32, 33, -1, -1, 36, 1084 -1, -1, -1, -1, 46, 47, 48, -1, 45, -1, 1085 -1, -1, 54, 55, -1, -1, -1, -1, -1, 56, 1086 57, 58, 59, 60, -1, -1, -1, -1, 65, 66, 1087 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 1088 77, 78, -1, -1, -1, -1, -1, -1, -1, -1, 1089 -1, -1, -1, -1, -1, -1, 93, -1, -1, -1, 1090 -1, -1, 104, 105, 106, 107, 108, 109, -1, -1, 1091 107, 113, 114, 115, -1, 112 1092}; 1093 1094/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 1095 symbol of state STATE-NUM. */ 1096static const unsigned char yystos[] = 1097{ 1098 0, 120, 121, 0, 11, 12, 15, 16, 17, 18, 1099 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1100 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 1101 41, 42, 43, 44, 45, 56, 57, 58, 59, 60, 1102 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 1103 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 1104 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 1105 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 1106 103, 107, 112, 122, 127, 128, 131, 132, 133, 134, 1107 138, 139, 140, 145, 146, 148, 149, 150, 151, 155, 1108 156, 36, 36, 36, 49, 49, 36, 36, 36, 49, 1109 141, 49, 142, 128, 148, 148, 128, 138, 145, 101, 1110 102, 123, 124, 131, 122, 146, 148, 49, 50, 51, 1111 52, 53, 125, 126, 127, 128, 148, 3, 4, 5, 1112 6, 7, 9, 10, 13, 14, 34, 35, 135, 136, 1113 137, 116, 46, 47, 48, 54, 55, 104, 105, 106, 1114 107, 108, 109, 113, 114, 115, 143, 144, 36, 128, 1115 143, 144, 152, 153, 36, 128, 143, 144, 157, 158, 1116 104, 105, 113, 114, 115, 147, 148, 145, 125, 127, 1117 128, 131, 148, 125, 131, 111, 111, 111, 8, 109, 1118 109, 125, 126, 129, 130, 148, 101, 102, 101, 102, 1119 136, 145, 145, 145, 145, 145, 145, 145, 145, 145, 1120 145, 145, 153, 154, 36, 36, 158, 159, 36, 36, 1121 36, 148, 51, 36, 36, 111, 123, 124, 4, 4, 1122 3, 3, 117, 118, 111, 124, 111, 124, 125, 125, 1123 36, 153, 158, 117 1124}; 1125 1126#define yyerrok (yyerrstatus = 0) 1127#define yyclearin (yychar = YYEMPTY) 1128#define YYEMPTY (-2) 1129#define YYEOF 0 1130 1131#define YYACCEPT goto yyacceptlab 1132#define YYABORT goto yyabortlab 1133#define YYERROR goto yyerrorlab 1134 1135 1136/* Like YYERROR except do call yyerror. This remains here temporarily 1137 to ease the transition to the new meaning of YYERROR, for GCC. 1138 Once GCC version 2 has supplanted version 1, this can go. */ 1139 1140#define YYFAIL goto yyerrlab 1141 1142#define YYRECOVERING() (!!yyerrstatus) 1143 1144#define YYBACKUP(Token, Value) \ 1145do \ 1146 if (yychar == YYEMPTY && yylen == 1) \ 1147 { \ 1148 yychar = (Token); \ 1149 yylval = (Value); \ 1150 yytoken = YYTRANSLATE (yychar); \ 1151 YYPOPSTACK; \ 1152 goto yybackup; \ 1153 } \ 1154 else \ 1155 { \ 1156 yyerror (YY_("syntax error: cannot back up")); \ 1157 YYERROR; \ 1158 } \ 1159while (0) 1160 1161 1162#define YYTERROR 1 1163#define YYERRCODE 256 1164 1165 1166/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 1167 If N is 0, then set CURRENT to the empty location which ends 1168 the previous symbol: RHS[0] (always defined). */ 1169 1170#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 1171#ifndef YYLLOC_DEFAULT 1172# define YYLLOC_DEFAULT(Current, Rhs, N) \ 1173 do \ 1174 if (N) \ 1175 { \ 1176 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 1177 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 1178 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 1179 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 1180 } \ 1181 else \ 1182 { \ 1183 (Current).first_line = (Current).last_line = \ 1184 YYRHSLOC (Rhs, 0).last_line; \ 1185 (Current).first_column = (Current).last_column = \ 1186 YYRHSLOC (Rhs, 0).last_column; \ 1187 } \ 1188 while (0) 1189#endif 1190 1191 1192/* YY_LOCATION_PRINT -- Print the location on the stream. 1193 This macro was not mandated originally: define only if we know 1194 we won't break user code: when these are the locations we know. */ 1195 1196#ifndef YY_LOCATION_PRINT 1197# if YYLTYPE_IS_TRIVIAL 1198# define YY_LOCATION_PRINT(File, Loc) \ 1199 fprintf (File, "%d.%d-%d.%d", \ 1200 (Loc).first_line, (Loc).first_column, \ 1201 (Loc).last_line, (Loc).last_column) 1202# else 1203# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 1204# endif 1205#endif 1206 1207 1208/* YYLEX -- calling `yylex' with the right arguments. */ 1209 1210#ifdef YYLEX_PARAM 1211# define YYLEX yylex (YYLEX_PARAM) 1212#else 1213# define YYLEX yylex () 1214#endif 1215 1216/* Enable debugging if requested. */ 1217#if YYDEBUG 1218 1219# ifndef YYFPRINTF 1220# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 1221# define YYFPRINTF fprintf 1222# endif 1223 1224# define YYDPRINTF(Args) \ 1225do { \ 1226 if (yydebug) \ 1227 YYFPRINTF Args; \ 1228} while (0) 1229 1230# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 1231do { \ 1232 if (yydebug) \ 1233 { \ 1234 YYFPRINTF (stderr, "%s ", Title); \ 1235 yysymprint (stderr, \ 1236 Type, Value); \ 1237 YYFPRINTF (stderr, "\n"); \ 1238 } \ 1239} while (0) 1240 1241/*------------------------------------------------------------------. 1242| yy_stack_print -- Print the state stack from its BOTTOM up to its | 1243| TOP (included). | 1244`------------------------------------------------------------------*/ 1245 1246#if defined (__STDC__) || defined (__cplusplus) 1247static void 1248yy_stack_print (short int *bottom, short int *top) 1249#else 1250static void 1251yy_stack_print (bottom, top) 1252 short int *bottom; 1253 short int *top; 1254#endif 1255{ 1256 YYFPRINTF (stderr, "Stack now"); 1257 for (/* Nothing. */; bottom <= top; ++bottom) 1258 YYFPRINTF (stderr, " %d", *bottom); 1259 YYFPRINTF (stderr, "\n"); 1260} 1261 1262# define YY_STACK_PRINT(Bottom, Top) \ 1263do { \ 1264 if (yydebug) \ 1265 yy_stack_print ((Bottom), (Top)); \ 1266} while (0) 1267 1268 1269/*------------------------------------------------. 1270| Report that the YYRULE is going to be reduced. | 1271`------------------------------------------------*/ 1272 1273#if defined (__STDC__) || defined (__cplusplus) 1274static void 1275yy_reduce_print (int yyrule) 1276#else 1277static void 1278yy_reduce_print (yyrule) 1279 int yyrule; 1280#endif 1281{ 1282 int yyi; 1283 unsigned long int yylno = yyrline[yyrule]; 1284 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", 1285 yyrule - 1, yylno); 1286 /* Print the symbols being reduced, and their result. */ 1287 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 1288 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); 1289 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); 1290} 1291 1292# define YY_REDUCE_PRINT(Rule) \ 1293do { \ 1294 if (yydebug) \ 1295 yy_reduce_print (Rule); \ 1296} while (0) 1297 1298/* Nonzero means print parse trace. It is left uninitialized so that 1299 multiple parsers can coexist. */ 1300int yydebug; 1301#else /* !YYDEBUG */ 1302# define YYDPRINTF(Args) 1303# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1304# define YY_STACK_PRINT(Bottom, Top) 1305# define YY_REDUCE_PRINT(Rule) 1306#endif /* !YYDEBUG */ 1307 1308 1309/* YYINITDEPTH -- initial size of the parser's stacks. */ 1310#ifndef YYINITDEPTH 1311# define YYINITDEPTH 200 1312#endif 1313 1314/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1315 if the built-in stack extension method is used). 1316 1317 Do not make this value too large; the results are undefined if 1318 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1319 evaluated with infinite-precision integer arithmetic. */ 1320 1321#ifndef YYMAXDEPTH 1322# define YYMAXDEPTH 10000 1323#endif 1324 1325 1326 1327#if YYERROR_VERBOSE 1328 1329# ifndef yystrlen 1330# if defined (__GLIBC__) && defined (_STRING_H) 1331# define yystrlen strlen 1332# else 1333/* Return the length of YYSTR. */ 1334static YYSIZE_T 1335# if defined (__STDC__) || defined (__cplusplus) 1336yystrlen (const char *yystr) 1337# else 1338yystrlen (yystr) 1339 const char *yystr; 1340# endif 1341{ 1342 const char *yys = yystr; 1343 1344 while (*yys++ != '\0') 1345 continue; 1346 1347 return yys - yystr - 1; 1348} 1349# endif 1350# endif 1351 1352# ifndef yystpcpy 1353# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 1354# define yystpcpy stpcpy 1355# else 1356/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1357 YYDEST. */ 1358static char * 1359# if defined (__STDC__) || defined (__cplusplus) 1360yystpcpy (char *yydest, const char *yysrc) 1361# else 1362yystpcpy (yydest, yysrc) 1363 char *yydest; 1364 const char *yysrc; 1365# endif 1366{ 1367 char *yyd = yydest; 1368 const char *yys = yysrc; 1369 1370 while ((*yyd++ = *yys++) != '\0') 1371 continue; 1372 1373 return yyd - 1; 1374} 1375# endif 1376# endif 1377 1378# ifndef yytnamerr 1379/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1380 quotes and backslashes, so that it's suitable for yyerror. The 1381 heuristic is that double-quoting is unnecessary unless the string 1382 contains an apostrophe, a comma, or backslash (other than 1383 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1384 null, do not copy; instead, return the length of what the result 1385 would have been. */ 1386static YYSIZE_T 1387yytnamerr (char *yyres, const char *yystr) 1388{ 1389 if (*yystr == '"') 1390 { 1391 size_t yyn = 0; 1392 char const *yyp = yystr; 1393 1394 for (;;) 1395 switch (*++yyp) 1396 { 1397 case '\'': 1398 case ',': 1399 goto do_not_strip_quotes; 1400 1401 case '\\': 1402 if (*++yyp != '\\') 1403 goto do_not_strip_quotes; 1404 /* Fall through. */ 1405 default: 1406 if (yyres) 1407 yyres[yyn] = *yyp; 1408 yyn++; 1409 break; 1410 1411 case '"': 1412 if (yyres) 1413 yyres[yyn] = '\0'; 1414 return yyn; 1415 } 1416 do_not_strip_quotes: ; 1417 } 1418 1419 if (! yyres) 1420 return yystrlen (yystr); 1421 1422 return yystpcpy (yyres, yystr) - yyres; 1423} 1424# endif 1425 1426#endif /* YYERROR_VERBOSE */ 1427 1428 1429 1430#if YYDEBUG 1431/*--------------------------------. 1432| Print this symbol on YYOUTPUT. | 1433`--------------------------------*/ 1434 1435#if defined (__STDC__) || defined (__cplusplus) 1436static void 1437yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) 1438#else 1439static void 1440yysymprint (yyoutput, yytype, yyvaluep) 1441 FILE *yyoutput; 1442 int yytype; 1443 YYSTYPE *yyvaluep; 1444#endif 1445{ 1446 /* Pacify ``unused variable'' warnings. */ 1447 (void) yyvaluep; 1448 1449 if (yytype < YYNTOKENS) 1450 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 1451 else 1452 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 1453 1454 1455# ifdef YYPRINT 1456 if (yytype < YYNTOKENS) 1457 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 1458# endif 1459 switch (yytype) 1460 { 1461 default: 1462 break; 1463 } 1464 YYFPRINTF (yyoutput, ")"); 1465} 1466 1467#endif /* ! YYDEBUG */ 1468/*-----------------------------------------------. 1469| Release the memory associated to this symbol. | 1470`-----------------------------------------------*/ 1471 1472#if defined (__STDC__) || defined (__cplusplus) 1473static void 1474yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1475#else 1476static void 1477yydestruct (yymsg, yytype, yyvaluep) 1478 const char *yymsg; 1479 int yytype; 1480 YYSTYPE *yyvaluep; 1481#endif 1482{ 1483 /* Pacify ``unused variable'' warnings. */ 1484 (void) yyvaluep; 1485 1486 if (!yymsg) 1487 yymsg = "Deleting"; 1488 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1489 1490 switch (yytype) 1491 { 1492 1493 default: 1494 break; 1495 } 1496} 1497 1498 1499/* Prevent warnings from -Wmissing-prototypes. */ 1500 1501#ifdef YYPARSE_PARAM 1502# if defined (__STDC__) || defined (__cplusplus) 1503int yyparse (void *YYPARSE_PARAM); 1504# else 1505int yyparse (); 1506# endif 1507#else /* ! YYPARSE_PARAM */ 1508#if defined (__STDC__) || defined (__cplusplus) 1509int yyparse (void); 1510#else 1511int yyparse (); 1512#endif 1513#endif /* ! YYPARSE_PARAM */ 1514 1515 1516 1517/* The look-ahead symbol. */ 1518int yychar; 1519 1520/* The semantic value of the look-ahead symbol. */ 1521YYSTYPE yylval; 1522 1523/* Number of syntax errors so far. */ 1524int yynerrs; 1525 1526 1527 1528/*----------. 1529| yyparse. | 1530`----------*/ 1531 1532#ifdef YYPARSE_PARAM 1533# if defined (__STDC__) || defined (__cplusplus) 1534int yyparse (void *YYPARSE_PARAM) 1535# else 1536int yyparse (YYPARSE_PARAM) 1537 void *YYPARSE_PARAM; 1538# endif 1539#else /* ! YYPARSE_PARAM */ 1540#if defined (__STDC__) || defined (__cplusplus) 1541int 1542yyparse (void) 1543#else 1544int 1545yyparse () 1546 ; 1547#endif 1548#endif 1549{ 1550 1551 int yystate; 1552 int yyn; 1553 int yyresult; 1554 /* Number of tokens to shift before error messages enabled. */ 1555 int yyerrstatus; 1556 /* Look-ahead token as an internal (translated) token number. */ 1557 int yytoken = 0; 1558 1559 /* Three stacks and their tools: 1560 `yyss': related to states, 1561 `yyvs': related to semantic values, 1562 `yyls': related to locations. 1563 1564 Refer to the stacks thru separate pointers, to allow yyoverflow 1565 to reallocate them elsewhere. */ 1566 1567 /* The state stack. */ 1568 short int yyssa[YYINITDEPTH]; 1569 short int *yyss = yyssa; 1570 short int *yyssp; 1571 1572 /* The semantic value stack. */ 1573 YYSTYPE yyvsa[YYINITDEPTH]; 1574 YYSTYPE *yyvs = yyvsa; 1575 YYSTYPE *yyvsp; 1576 1577 1578 1579#define YYPOPSTACK (yyvsp--, yyssp--) 1580 1581 YYSIZE_T yystacksize = YYINITDEPTH; 1582 1583 /* The variables used to return semantic value and location from the 1584 action routines. */ 1585 YYSTYPE yyval; 1586 1587 1588 /* When reducing, the number of symbols on the RHS of the reduced 1589 rule. */ 1590 int yylen; 1591 1592 YYDPRINTF ((stderr, "Starting parse\n")); 1593 1594 yystate = 0; 1595 yyerrstatus = 0; 1596 yynerrs = 0; 1597 yychar = YYEMPTY; /* Cause a token to be read. */ 1598 1599 /* Initialize stack pointers. 1600 Waste one element of value and location stack 1601 so that they stay on the same level as the state stack. 1602 The wasted elements are never initialized. */ 1603 1604 yyssp = yyss; 1605 yyvsp = yyvs; 1606 1607 goto yysetstate; 1608 1609/*------------------------------------------------------------. 1610| yynewstate -- Push a new state, which is found in yystate. | 1611`------------------------------------------------------------*/ 1612 yynewstate: 1613 /* In all cases, when you get here, the value and location stacks 1614 have just been pushed. so pushing a state here evens the stacks. 1615 */ 1616 yyssp++; 1617 1618 yysetstate: 1619 *yyssp = yystate; 1620 1621 if (yyss + yystacksize - 1 <= yyssp) 1622 { 1623 /* Get the current used size of the three stacks, in elements. */ 1624 YYSIZE_T yysize = yyssp - yyss + 1; 1625 1626#ifdef yyoverflow 1627 { 1628 /* Give user a chance to reallocate the stack. Use copies of 1629 these so that the &'s don't force the real ones into 1630 memory. */ 1631 YYSTYPE *yyvs1 = yyvs; 1632 short int *yyss1 = yyss; 1633 1634 1635 /* Each stack pointer address is followed by the size of the 1636 data in use in that stack, in bytes. This used to be a 1637 conditional around just the two extra args, but that might 1638 be undefined if yyoverflow is a macro. */ 1639 yyoverflow (YY_("memory exhausted"), 1640 &yyss1, yysize * sizeof (*yyssp), 1641 &yyvs1, yysize * sizeof (*yyvsp), 1642 1643 &yystacksize); 1644 1645 yyss = yyss1; 1646 yyvs = yyvs1; 1647 } 1648#else /* no yyoverflow */ 1649# ifndef YYSTACK_RELOCATE 1650 goto yyexhaustedlab; 1651# else 1652 /* Extend the stack our own way. */ 1653 if (YYMAXDEPTH <= yystacksize) 1654 goto yyexhaustedlab; 1655 yystacksize *= 2; 1656 if (YYMAXDEPTH < yystacksize) 1657 yystacksize = YYMAXDEPTH; 1658 1659 { 1660 short int *yyss1 = yyss; 1661 union yyalloc *yyptr = 1662 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1663 if (! yyptr) 1664 goto yyexhaustedlab; 1665 YYSTACK_RELOCATE (yyss); 1666 YYSTACK_RELOCATE (yyvs); 1667 1668# undef YYSTACK_RELOCATE 1669 if (yyss1 != yyssa) 1670 YYSTACK_FREE (yyss1); 1671 } 1672# endif 1673#endif /* no yyoverflow */ 1674 1675 yyssp = yyss + yysize - 1; 1676 yyvsp = yyvs + yysize - 1; 1677 1678 1679 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1680 (unsigned long int) yystacksize)); 1681 1682 if (yyss + yystacksize - 1 <= yyssp) 1683 YYABORT; 1684 } 1685 1686 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1687 1688 goto yybackup; 1689 1690/*-----------. 1691| yybackup. | 1692`-----------*/ 1693yybackup: 1694 1695/* Do appropriate processing given the current state. */ 1696/* Read a look-ahead token if we need one and don't already have one. */ 1697/* yyresume: */ 1698 1699 /* First try to decide what to do without reference to look-ahead token. */ 1700 1701 yyn = yypact[yystate]; 1702 if (yyn == YYPACT_NINF) 1703 goto yydefault; 1704 1705 /* Not known => get a look-ahead token if don't already have one. */ 1706 1707 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1708 if (yychar == YYEMPTY) 1709 { 1710 YYDPRINTF ((stderr, "Reading a token: ")); 1711 yychar = YYLEX; 1712 } 1713 1714 if (yychar <= YYEOF) 1715 { 1716 yychar = yytoken = YYEOF; 1717 YYDPRINTF ((stderr, "Now at end of input.\n")); 1718 } 1719 else 1720 { 1721 yytoken = YYTRANSLATE (yychar); 1722 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1723 } 1724 1725 /* If the proper action on seeing token YYTOKEN is to reduce or to 1726 detect an error, take that action. */ 1727 yyn += yytoken; 1728 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1729 goto yydefault; 1730 yyn = yytable[yyn]; 1731 if (yyn <= 0) 1732 { 1733 if (yyn == 0 || yyn == YYTABLE_NINF) 1734 goto yyerrlab; 1735 yyn = -yyn; 1736 goto yyreduce; 1737 } 1738 1739 if (yyn == YYFINAL) 1740 YYACCEPT; 1741 1742 /* Shift the look-ahead token. */ 1743 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1744 1745 /* Discard the token being shifted unless it is eof. */ 1746 if (yychar != YYEOF) 1747 yychar = YYEMPTY; 1748 1749 *++yyvsp = yylval; 1750 1751 1752 /* Count tokens shifted since error; after three, turn off error 1753 status. */ 1754 if (yyerrstatus) 1755 yyerrstatus--; 1756 1757 yystate = yyn; 1758 goto yynewstate; 1759 1760 1761/*-----------------------------------------------------------. 1762| yydefault -- do the default action for the current state. | 1763`-----------------------------------------------------------*/ 1764yydefault: 1765 yyn = yydefact[yystate]; 1766 if (yyn == 0) 1767 goto yyerrlab; 1768 goto yyreduce; 1769 1770 1771/*-----------------------------. 1772| yyreduce -- Do a reduction. | 1773`-----------------------------*/ 1774yyreduce: 1775 /* yyn is the number of a rule to reduce with. */ 1776 yylen = yyr2[yyn]; 1777 1778 /* If YYLEN is nonzero, implement the default value of the action: 1779 `$$ = $1'. 1780 1781 Otherwise, the following line sets YYVAL to garbage. 1782 This behavior is undocumented and Bison 1783 users should not rely upon it. Assigning to YYVAL 1784 unconditionally makes the parser a bit smaller, and it avoids a 1785 GCC warning that YYVAL may be used uninitialized. */ 1786 yyval = yyvsp[1-yylen]; 1787 1788 1789 YY_REDUCE_PRINT (yyn); 1790 switch (yyn) 1791 { 1792 case 2: 1793#line 211 "grammar.y" 1794 { 1795 finish_parse((yyvsp[0].blk).b); 1796} 1797 break; 1798 1799 case 4: 1800#line 216 "grammar.y" 1801 { (yyval.blk).q = qerr; } 1802 break; 1803 1804 case 6: 1805#line 219 "grammar.y" 1806 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1807 break; 1808 1809 case 7: 1810#line 220 "grammar.y" 1811 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1812 break; 1813 1814 case 8: 1815#line 221 "grammar.y" 1816 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1817 break; 1818 1819 case 9: 1820#line 222 "grammar.y" 1821 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1822 break; 1823 1824 case 10: 1825#line 224 "grammar.y" 1826 { (yyval.blk) = (yyvsp[-1].blk); } 1827 break; 1828 1829 case 11: 1830#line 226 "grammar.y" 1831 { (yyval.blk) = (yyvsp[-1].blk); } 1832 break; 1833 1834 case 13: 1835#line 229 "grammar.y" 1836 { (yyval.blk).b = gen_ncode(NULL, (bpf_u_int32)(yyvsp[0].i), 1837 (yyval.blk).q = (yyvsp[-1].blk).q); } 1838 break; 1839 1840 case 14: 1841#line 231 "grammar.y" 1842 { (yyval.blk) = (yyvsp[-1].blk); } 1843 break; 1844 1845 case 15: 1846#line 233 "grammar.y" 1847 { (yyval.blk).b = gen_scode((yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q); } 1848 break; 1849 1850 case 16: 1851#line 234 "grammar.y" 1852 { (yyval.blk).b = gen_mcode((yyvsp[-2].s), NULL, (yyvsp[0].i), 1853 (yyval.blk).q = (yyvsp[-3].blk).q); } 1854 break; 1855 1856 case 17: 1857#line 236 "grammar.y" 1858 { (yyval.blk).b = gen_mcode((yyvsp[-2].s), (yyvsp[0].s), 0, 1859 (yyval.blk).q = (yyvsp[-3].blk).q); } 1860 break; 1861 1862 case 18: 1863#line 238 "grammar.y" 1864 { 1865 /* Decide how to parse HID based on proto */ 1866 (yyval.blk).q = (yyvsp[-1].blk).q; 1867 (yyval.blk).b = gen_ncode((yyvsp[0].s), 0, (yyval.blk).q); 1868 } 1869 break; 1870 1871 case 19: 1872#line 243 "grammar.y" 1873 { 1874#ifdef INET6 1875 (yyval.blk).b = gen_mcode6((yyvsp[-2].s), NULL, (yyvsp[0].i), 1876 (yyval.blk).q = (yyvsp[-3].blk).q); 1877#else 1878 bpf_error("'ip6addr/prefixlen' not supported " 1879 "in this configuration"); 1880#endif /*INET6*/ 1881 } 1882 break; 1883 1884 case 20: 1885#line 252 "grammar.y" 1886 { 1887#ifdef INET6 1888 (yyval.blk).b = gen_mcode6((yyvsp[0].s), 0, 128, 1889 (yyval.blk).q = (yyvsp[-1].blk).q); 1890#else 1891 bpf_error("'ip6addr' not supported " 1892 "in this configuration"); 1893#endif /*INET6*/ 1894 } 1895 break; 1896 1897 case 21: 1898#line 261 "grammar.y" 1899 { 1900 (yyval.blk).b = gen_ecode((yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q); 1901 /* 1902 * $1 was allocated by "pcap_ether_aton()", 1903 * so we must free it now that we're done 1904 * with it. 1905 */ 1906 free((yyvsp[0].e)); 1907 } 1908 break; 1909 1910 case 22: 1911#line 270 "grammar.y" 1912 { 1913 (yyval.blk).b = gen_acode((yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q); 1914 /* 1915 * $1 was allocated by "pcap_ether_aton()", 1916 * so we must free it now that we're done 1917 * with it. 1918 */ 1919 free((yyvsp[0].e)); 1920 } 1921 break; 1922 1923 case 23: 1924#line 279 "grammar.y" 1925 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1926 break; 1927 1928 case 24: 1929#line 281 "grammar.y" 1930 { (yyval.blk) = (yyvsp[-1].blk); } 1931 break; 1932 1933 case 25: 1934#line 283 "grammar.y" 1935 { (yyval.blk) = (yyvsp[-1].blk); } 1936 break; 1937 1938 case 27: 1939#line 286 "grammar.y" 1940 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1941 break; 1942 1943 case 28: 1944#line 287 "grammar.y" 1945 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1946 break; 1947 1948 case 29: 1949#line 289 "grammar.y" 1950 { (yyval.blk).b = gen_ncode(NULL, (bpf_u_int32)(yyvsp[0].i), 1951 (yyval.blk).q = (yyvsp[-1].blk).q); } 1952 break; 1953 1954 case 32: 1955#line 294 "grammar.y" 1956 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 1957 break; 1958 1959 case 33: 1960#line 296 "grammar.y" 1961 { QSET((yyval.blk).q, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i)); } 1962 break; 1963 1964 case 34: 1965#line 297 "grammar.y" 1966 { QSET((yyval.blk).q, (yyvsp[-1].i), (yyvsp[0].i), Q_DEFAULT); } 1967 break; 1968 1969 case 35: 1970#line 298 "grammar.y" 1971 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } 1972 break; 1973 1974 case 36: 1975#line 299 "grammar.y" 1976 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTO); } 1977 break; 1978 1979 case 37: 1980#line 300 "grammar.y" 1981 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTOCHAIN); } 1982 break; 1983 1984 case 38: 1985#line 301 "grammar.y" 1986 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); } 1987 break; 1988 1989 case 39: 1990#line 303 "grammar.y" 1991 { (yyval.blk) = (yyvsp[0].blk); } 1992 break; 1993 1994 case 40: 1995#line 304 "grammar.y" 1996 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = (yyvsp[-2].blk).q; } 1997 break; 1998 1999 case 41: 2000#line 305 "grammar.y" 2001 { (yyval.blk).b = gen_proto_abbrev((yyvsp[0].i)); (yyval.blk).q = qerr; } 2002 break; 2003 2004 case 42: 2005#line 306 "grammar.y" 2006 { (yyval.blk).b = gen_relation((yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 0); 2007 (yyval.blk).q = qerr; } 2008 break; 2009 2010 case 43: 2011#line 308 "grammar.y" 2012 { (yyval.blk).b = gen_relation((yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 1); 2013 (yyval.blk).q = qerr; } 2014 break; 2015 2016 case 44: 2017#line 310 "grammar.y" 2018 { (yyval.blk).b = (yyvsp[0].rblk); (yyval.blk).q = qerr; } 2019 break; 2020 2021 case 45: 2022#line 311 "grammar.y" 2023 { (yyval.blk).b = gen_atmtype_abbrev((yyvsp[0].i)); (yyval.blk).q = qerr; } 2024 break; 2025 2026 case 46: 2027#line 312 "grammar.y" 2028 { (yyval.blk).b = gen_atmmulti_abbrev((yyvsp[0].i)); (yyval.blk).q = qerr; } 2029 break; 2030 2031 case 47: 2032#line 313 "grammar.y" 2033 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } 2034 break; 2035 2036 case 48: 2037#line 314 "grammar.y" 2038 { (yyval.blk).b = gen_mtp2type_abbrev((yyvsp[0].i)); (yyval.blk).q = qerr; } 2039 break; 2040 2041 case 49: 2042#line 315 "grammar.y" 2043 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; } 2044 break; 2045 2046 case 51: 2047#line 319 "grammar.y" 2048 { (yyval.i) = Q_DEFAULT; } 2049 break; 2050 2051 case 52: 2052#line 322 "grammar.y" 2053 { (yyval.i) = Q_SRC; } 2054 break; 2055 2056 case 53: 2057#line 323 "grammar.y" 2058 { (yyval.i) = Q_DST; } 2059 break; 2060 2061 case 54: 2062#line 324 "grammar.y" 2063 { (yyval.i) = Q_OR; } 2064 break; 2065 2066 case 55: 2067#line 325 "grammar.y" 2068 { (yyval.i) = Q_OR; } 2069 break; 2070 2071 case 56: 2072#line 326 "grammar.y" 2073 { (yyval.i) = Q_AND; } 2074 break; 2075 2076 case 57: 2077#line 327 "grammar.y" 2078 { (yyval.i) = Q_AND; } 2079 break; 2080 2081 case 58: 2082#line 330 "grammar.y" 2083 { (yyval.i) = Q_HOST; } 2084 break; 2085 2086 case 59: 2087#line 331 "grammar.y" 2088 { (yyval.i) = Q_NET; } 2089 break; 2090 2091 case 60: 2092#line 332 "grammar.y" 2093 { (yyval.i) = Q_PORT; } 2094 break; 2095 2096 case 61: 2097#line 333 "grammar.y" 2098 { (yyval.i) = Q_PORTRANGE; } 2099 break; 2100 2101 case 62: 2102#line 336 "grammar.y" 2103 { (yyval.i) = Q_GATEWAY; } 2104 break; 2105 2106 case 63: 2107#line 338 "grammar.y" 2108 { (yyval.i) = Q_LINK; } 2109 break; 2110 2111 case 64: 2112#line 339 "grammar.y" 2113 { (yyval.i) = Q_IP; } 2114 break; 2115 2116 case 65: 2117#line 340 "grammar.y" 2118 { (yyval.i) = Q_ARP; } 2119 break; 2120 2121 case 66: 2122#line 341 "grammar.y" 2123 { (yyval.i) = Q_RARP; } 2124 break; 2125 2126 case 67: 2127#line 342 "grammar.y" 2128 { (yyval.i) = Q_SCTP; } 2129 break; 2130 2131 case 68: 2132#line 343 "grammar.y" 2133 { (yyval.i) = Q_TCP; } 2134 break; 2135 2136 case 69: 2137#line 344 "grammar.y" 2138 { (yyval.i) = Q_UDP; } 2139 break; 2140 2141 case 70: 2142#line 345 "grammar.y" 2143 { (yyval.i) = Q_ICMP; } 2144 break; 2145 2146 case 71: 2147#line 346 "grammar.y" 2148 { (yyval.i) = Q_IGMP; } 2149 break; 2150 2151 case 72: 2152#line 347 "grammar.y" 2153 { (yyval.i) = Q_IGRP; } 2154 break; 2155 2156 case 73: 2157#line 348 "grammar.y" 2158 { (yyval.i) = Q_PIM; } 2159 break; 2160 2161 case 74: 2162#line 349 "grammar.y" 2163 { (yyval.i) = Q_VRRP; } 2164 break; 2165 2166 case 75: 2167#line 350 "grammar.y" 2168 { (yyval.i) = Q_ATALK; } 2169 break; 2170 2171 case 76: 2172#line 351 "grammar.y" 2173 { (yyval.i) = Q_AARP; } 2174 break; 2175 2176 case 77: 2177#line 352 "grammar.y" 2178 { (yyval.i) = Q_DECNET; } 2179 break; 2180 2181 case 78: 2182#line 353 "grammar.y" 2183 { (yyval.i) = Q_LAT; } 2184 break; 2185 2186 case 79: 2187#line 354 "grammar.y" 2188 { (yyval.i) = Q_SCA; } 2189 break; 2190 2191 case 80: 2192#line 355 "grammar.y" 2193 { (yyval.i) = Q_MOPDL; } 2194 break; 2195 2196 case 81: 2197#line 356 "grammar.y" 2198 { (yyval.i) = Q_MOPRC; } 2199 break; 2200 2201 case 82: 2202#line 357 "grammar.y" 2203 { (yyval.i) = Q_IPV6; } 2204 break; 2205 2206 case 83: 2207#line 358 "grammar.y" 2208 { (yyval.i) = Q_ICMPV6; } 2209 break; 2210 2211 case 84: 2212#line 359 "grammar.y" 2213 { (yyval.i) = Q_AH; } 2214 break; 2215 2216 case 85: 2217#line 360 "grammar.y" 2218 { (yyval.i) = Q_ESP; } 2219 break; 2220 2221 case 86: 2222#line 361 "grammar.y" 2223 { (yyval.i) = Q_ISO; } 2224 break; 2225 2226 case 87: 2227#line 362 "grammar.y" 2228 { (yyval.i) = Q_ESIS; } 2229 break; 2230 2231 case 88: 2232#line 363 "grammar.y" 2233 { (yyval.i) = Q_ISIS; } 2234 break; 2235 2236 case 89: 2237#line 364 "grammar.y" 2238 { (yyval.i) = Q_ISIS_L1; } 2239 break; 2240 2241 case 90: 2242#line 365 "grammar.y" 2243 { (yyval.i) = Q_ISIS_L2; } 2244 break; 2245 2246 case 91: 2247#line 366 "grammar.y" 2248 { (yyval.i) = Q_ISIS_IIH; } 2249 break; 2250 2251 case 92: 2252#line 367 "grammar.y" 2253 { (yyval.i) = Q_ISIS_LSP; } 2254 break; 2255 2256 case 93: 2257#line 368 "grammar.y" 2258 { (yyval.i) = Q_ISIS_SNP; } 2259 break; 2260 2261 case 94: 2262#line 369 "grammar.y" 2263 { (yyval.i) = Q_ISIS_PSNP; } 2264 break; 2265 2266 case 95: 2267#line 370 "grammar.y" 2268 { (yyval.i) = Q_ISIS_CSNP; } 2269 break; 2270 2271 case 96: 2272#line 371 "grammar.y" 2273 { (yyval.i) = Q_CLNP; } 2274 break; 2275 2276 case 97: 2277#line 372 "grammar.y" 2278 { (yyval.i) = Q_STP; } 2279 break; 2280 2281 case 98: 2282#line 373 "grammar.y" 2283 { (yyval.i) = Q_IPX; } 2284 break; 2285 2286 case 99: 2287#line 374 "grammar.y" 2288 { (yyval.i) = Q_NETBEUI; } 2289 break; 2290 2291 case 100: 2292#line 375 "grammar.y" 2293 { (yyval.i) = Q_RADIO; } 2294 break; 2295 2296 case 101: 2297#line 377 "grammar.y" 2298 { (yyval.rblk) = gen_broadcast((yyvsp[-1].i)); } 2299 break; 2300 2301 case 102: 2302#line 378 "grammar.y" 2303 { (yyval.rblk) = gen_multicast((yyvsp[-1].i)); } 2304 break; 2305 2306 case 103: 2307#line 379 "grammar.y" 2308 { (yyval.rblk) = gen_less((yyvsp[0].i)); } 2309 break; 2310 2311 case 104: 2312#line 380 "grammar.y" 2313 { (yyval.rblk) = gen_greater((yyvsp[0].i)); } 2314 break; 2315 2316 case 105: 2317#line 381 "grammar.y" 2318 { (yyval.rblk) = gen_byteop((yyvsp[-1].i), (yyvsp[-2].i), (yyvsp[0].i)); } 2319 break; 2320 2321 case 106: 2322#line 382 "grammar.y" 2323 { (yyval.rblk) = gen_inbound(0); } 2324 break; 2325 2326 case 107: 2327#line 383 "grammar.y" 2328 { (yyval.rblk) = gen_inbound(1); } 2329 break; 2330 2331 case 108: 2332#line 384 "grammar.y" 2333 { (yyval.rblk) = gen_vlan((yyvsp[0].i)); } 2334 break; 2335 2336 case 109: 2337#line 385 "grammar.y" 2338 { (yyval.rblk) = gen_vlan(-1); } 2339 break; 2340 2341 case 110: 2342#line 386 "grammar.y" 2343 { (yyval.rblk) = gen_mpls((yyvsp[0].i)); } 2344 break; 2345 2346 case 111: 2347#line 387 "grammar.y" 2348 { (yyval.rblk) = gen_mpls(-1); } 2349 break; 2350 2351 case 112: 2352#line 388 "grammar.y" 2353 { (yyval.rblk) = gen_pppoed(); } 2354 break; 2355 2356 case 113: 2357#line 389 "grammar.y" 2358 { (yyval.rblk) = gen_pppoes(); } 2359 break; 2360 2361 case 114: 2362#line 390 "grammar.y" 2363 { (yyval.rblk) = (yyvsp[0].rblk); } 2364 break; 2365 2366 case 115: 2367#line 393 "grammar.y" 2368 { (yyval.rblk) = gen_pf_ifname((yyvsp[0].s)); } 2369 break; 2370 2371 case 116: 2372#line 394 "grammar.y" 2373 { (yyval.rblk) = gen_pf_ruleset((yyvsp[0].s)); } 2374 break; 2375 2376 case 117: 2377#line 395 "grammar.y" 2378 { (yyval.rblk) = gen_pf_rnr((yyvsp[0].i)); } 2379 break; 2380 2381 case 118: 2382#line 396 "grammar.y" 2383 { (yyval.rblk) = gen_pf_srnr((yyvsp[0].i)); } 2384 break; 2385 2386 case 119: 2387#line 397 "grammar.y" 2388 { (yyval.rblk) = gen_pf_reason((yyvsp[0].i)); } 2389 break; 2390 2391 case 120: 2392#line 398 "grammar.y" 2393 { (yyval.rblk) = gen_pf_action((yyvsp[0].i)); } 2394 break; 2395 2396 case 121: 2397#line 401 "grammar.y" 2398 { (yyval.i) = (yyvsp[0].i); } 2399 break; 2400 2401 case 122: 2402#line 402 "grammar.y" 2403 { (yyval.i) = pfreason_to_num((yyvsp[0].s)); } 2404 break; 2405 2406 case 123: 2407#line 405 "grammar.y" 2408 { (yyval.i) = pfaction_to_num((yyvsp[0].s)); } 2409 break; 2410 2411 case 124: 2412#line 408 "grammar.y" 2413 { (yyval.i) = BPF_JGT; } 2414 break; 2415 2416 case 125: 2417#line 409 "grammar.y" 2418 { (yyval.i) = BPF_JGE; } 2419 break; 2420 2421 case 126: 2422#line 410 "grammar.y" 2423 { (yyval.i) = BPF_JEQ; } 2424 break; 2425 2426 case 127: 2427#line 412 "grammar.y" 2428 { (yyval.i) = BPF_JGT; } 2429 break; 2430 2431 case 128: 2432#line 413 "grammar.y" 2433 { (yyval.i) = BPF_JGE; } 2434 break; 2435 2436 case 129: 2437#line 414 "grammar.y" 2438 { (yyval.i) = BPF_JEQ; } 2439 break; 2440 2441 case 130: 2442#line 416 "grammar.y" 2443 { (yyval.a) = gen_loadi((yyvsp[0].i)); } 2444 break; 2445 2446 case 132: 2447#line 419 "grammar.y" 2448 { (yyval.a) = gen_load((yyvsp[-3].i), (yyvsp[-1].a), 1); } 2449 break; 2450 2451 case 133: 2452#line 420 "grammar.y" 2453 { (yyval.a) = gen_load((yyvsp[-5].i), (yyvsp[-3].a), (yyvsp[-1].i)); } 2454 break; 2455 2456 case 134: 2457#line 421 "grammar.y" 2458 { (yyval.a) = gen_arth(BPF_ADD, (yyvsp[-2].a), (yyvsp[0].a)); } 2459 break; 2460 2461 case 135: 2462#line 422 "grammar.y" 2463 { (yyval.a) = gen_arth(BPF_SUB, (yyvsp[-2].a), (yyvsp[0].a)); } 2464 break; 2465 2466 case 136: 2467#line 423 "grammar.y" 2468 { (yyval.a) = gen_arth(BPF_MUL, (yyvsp[-2].a), (yyvsp[0].a)); } 2469 break; 2470 2471 case 137: 2472#line 424 "grammar.y" 2473 { (yyval.a) = gen_arth(BPF_DIV, (yyvsp[-2].a), (yyvsp[0].a)); } 2474 break; 2475 2476 case 138: 2477#line 425 "grammar.y" 2478 { (yyval.a) = gen_arth(BPF_AND, (yyvsp[-2].a), (yyvsp[0].a)); } 2479 break; 2480 2481 case 139: 2482#line 426 "grammar.y" 2483 { (yyval.a) = gen_arth(BPF_OR, (yyvsp[-2].a), (yyvsp[0].a)); } 2484 break; 2485 2486 case 140: 2487#line 427 "grammar.y" 2488 { (yyval.a) = gen_arth(BPF_LSH, (yyvsp[-2].a), (yyvsp[0].a)); } 2489 break; 2490 2491 case 141: 2492#line 428 "grammar.y" 2493 { (yyval.a) = gen_arth(BPF_RSH, (yyvsp[-2].a), (yyvsp[0].a)); } 2494 break; 2495 2496 case 142: 2497#line 429 "grammar.y" 2498 { (yyval.a) = gen_neg((yyvsp[0].a)); } 2499 break; 2500 2501 case 143: 2502#line 430 "grammar.y" 2503 { (yyval.a) = (yyvsp[-1].a); } 2504 break; 2505 2506 case 144: 2507#line 431 "grammar.y" 2508 { (yyval.a) = gen_loadlen(); } 2509 break; 2510 2511 case 145: 2512#line 433 "grammar.y" 2513 { (yyval.i) = '&'; } 2514 break; 2515 2516 case 146: 2517#line 434 "grammar.y" 2518 { (yyval.i) = '|'; } 2519 break; 2520 2521 case 147: 2522#line 435 "grammar.y" 2523 { (yyval.i) = '<'; } 2524 break; 2525 2526 case 148: 2527#line 436 "grammar.y" 2528 { (yyval.i) = '>'; } 2529 break; 2530 2531 case 149: 2532#line 437 "grammar.y" 2533 { (yyval.i) = '='; } 2534 break; 2535 2536 case 151: 2537#line 440 "grammar.y" 2538 { (yyval.i) = (yyvsp[-1].i); } 2539 break; 2540 2541 case 152: 2542#line 442 "grammar.y" 2543 { (yyval.i) = A_LANE; } 2544 break; 2545 2546 case 153: 2547#line 443 "grammar.y" 2548 { (yyval.i) = A_LLC; } 2549 break; 2550 2551 case 154: 2552#line 444 "grammar.y" 2553 { (yyval.i) = A_METAC; } 2554 break; 2555 2556 case 155: 2557#line 445 "grammar.y" 2558 { (yyval.i) = A_BCC; } 2559 break; 2560 2561 case 156: 2562#line 446 "grammar.y" 2563 { (yyval.i) = A_OAMF4EC; } 2564 break; 2565 2566 case 157: 2567#line 447 "grammar.y" 2568 { (yyval.i) = A_OAMF4SC; } 2569 break; 2570 2571 case 158: 2572#line 448 "grammar.y" 2573 { (yyval.i) = A_SC; } 2574 break; 2575 2576 case 159: 2577#line 449 "grammar.y" 2578 { (yyval.i) = A_ILMIC; } 2579 break; 2580 2581 case 160: 2582#line 451 "grammar.y" 2583 { (yyval.i) = A_OAM; } 2584 break; 2585 2586 case 161: 2587#line 452 "grammar.y" 2588 { (yyval.i) = A_OAMF4; } 2589 break; 2590 2591 case 162: 2592#line 453 "grammar.y" 2593 { (yyval.i) = A_CONNECTMSG; } 2594 break; 2595 2596 case 163: 2597#line 454 "grammar.y" 2598 { (yyval.i) = A_METACONNECT; } 2599 break; 2600 2601 case 164: 2602#line 457 "grammar.y" 2603 { (yyval.blk).atmfieldtype = A_VPI; } 2604 break; 2605 2606 case 165: 2607#line 458 "grammar.y" 2608 { (yyval.blk).atmfieldtype = A_VCI; } 2609 break; 2610 2611 case 167: 2612#line 461 "grammar.y" 2613 { (yyval.blk).b = gen_atmfield_code((yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 0); } 2614 break; 2615 2616 case 168: 2617#line 462 "grammar.y" 2618 { (yyval.blk).b = gen_atmfield_code((yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 1); } 2619 break; 2620 2621 case 169: 2622#line 463 "grammar.y" 2623 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } 2624 break; 2625 2626 case 170: 2627#line 465 "grammar.y" 2628 { 2629 (yyval.blk).atmfieldtype = (yyvsp[-1].blk).atmfieldtype; 2630 if ((yyval.blk).atmfieldtype == A_VPI || 2631 (yyval.blk).atmfieldtype == A_VCI) 2632 (yyval.blk).b = gen_atmfield_code((yyval.blk).atmfieldtype, (bpf_int32) (yyvsp[0].i), BPF_JEQ, 0); 2633 } 2634 break; 2635 2636 case 172: 2637#line 473 "grammar.y" 2638 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2639 break; 2640 2641 case 173: 2642#line 476 "grammar.y" 2643 { (yyval.i) = M_FISU; } 2644 break; 2645 2646 case 174: 2647#line 477 "grammar.y" 2648 { (yyval.i) = M_LSSU; } 2649 break; 2650 2651 case 175: 2652#line 478 "grammar.y" 2653 { (yyval.i) = M_MSU; } 2654 break; 2655 2656 case 176: 2657#line 481 "grammar.y" 2658 { (yyval.blk).mtp3fieldtype = M_SIO; } 2659 break; 2660 2661 case 177: 2662#line 482 "grammar.y" 2663 { (yyval.blk).mtp3fieldtype = M_OPC; } 2664 break; 2665 2666 case 178: 2667#line 483 "grammar.y" 2668 { (yyval.blk).mtp3fieldtype = M_DPC; } 2669 break; 2670 2671 case 179: 2672#line 484 "grammar.y" 2673 { (yyval.blk).mtp3fieldtype = M_SLS; } 2674 break; 2675 2676 case 181: 2677#line 487 "grammar.y" 2678 { (yyval.blk).b = gen_mtp3field_code((yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 0); } 2679 break; 2680 2681 case 182: 2682#line 488 "grammar.y" 2683 { (yyval.blk).b = gen_mtp3field_code((yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 1); } 2684 break; 2685 2686 case 183: 2687#line 489 "grammar.y" 2688 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; } 2689 break; 2690 2691 case 184: 2692#line 491 "grammar.y" 2693 { 2694 (yyval.blk).mtp3fieldtype = (yyvsp[-1].blk).mtp3fieldtype; 2695 if ((yyval.blk).mtp3fieldtype == M_SIO || 2696 (yyval.blk).mtp3fieldtype == M_OPC || 2697 (yyval.blk).mtp3fieldtype == M_DPC || 2698 (yyval.blk).mtp3fieldtype == M_SLS ) 2699 (yyval.blk).b = gen_mtp3field_code((yyval.blk).mtp3fieldtype, (u_int) (yyvsp[0].i), BPF_JEQ, 0); 2700 } 2701 break; 2702 2703 case 186: 2704#line 501 "grammar.y" 2705 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); } 2706 break; 2707 2708 2709 default: break; 2710 } 2711 2712/* Line 1126 of yacc.c. */ 2713#line 2714 "y.tab.c" 2714 2715 yyvsp -= yylen; 2716 yyssp -= yylen; 2717 2718 2719 YY_STACK_PRINT (yyss, yyssp); 2720 2721 *++yyvsp = yyval; 2722 2723 2724 /* Now `shift' the result of the reduction. Determine what state 2725 that goes to, based on the state we popped back to and the rule 2726 number reduced by. */ 2727 2728 yyn = yyr1[yyn]; 2729 2730 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 2731 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 2732 yystate = yytable[yystate]; 2733 else 2734 yystate = yydefgoto[yyn - YYNTOKENS]; 2735 2736 goto yynewstate; 2737 2738 2739/*------------------------------------. 2740| yyerrlab -- here on detecting error | 2741`------------------------------------*/ 2742yyerrlab: 2743 /* If not already recovering from an error, report this error. */ 2744 if (!yyerrstatus) 2745 { 2746 ++yynerrs; 2747#if YYERROR_VERBOSE 2748 yyn = yypact[yystate]; 2749 2750 if (YYPACT_NINF < yyn && yyn < YYLAST) 2751 { 2752 int yytype = YYTRANSLATE (yychar); 2753 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 2754 YYSIZE_T yysize = yysize0; 2755 YYSIZE_T yysize1; 2756 int yysize_overflow = 0; 2757 char *yymsg = 0; 2758# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 2759 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 2760 int yyx; 2761 2762#if 0 2763 /* This is so xgettext sees the translatable formats that are 2764 constructed on the fly. */ 2765 YY_("syntax error, unexpected %s"); 2766 YY_("syntax error, unexpected %s, expecting %s"); 2767 YY_("syntax error, unexpected %s, expecting %s or %s"); 2768 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 2769 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 2770#endif 2771 char *yyfmt; 2772 char const *yyf; 2773 static char const yyunexpected[] = "syntax error, unexpected %s"; 2774 static char const yyexpecting[] = ", expecting %s"; 2775 static char const yyor[] = " or %s"; 2776 char yyformat[sizeof yyunexpected 2777 + sizeof yyexpecting - 1 2778 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 2779 * (sizeof yyor - 1))]; 2780 char const *yyprefix = yyexpecting; 2781 2782 /* Start YYX at -YYN if negative to avoid negative indexes in 2783 YYCHECK. */ 2784 int yyxbegin = yyn < 0 ? -yyn : 0; 2785 2786 /* Stay within bounds of both yycheck and yytname. */ 2787 int yychecklim = YYLAST - yyn; 2788 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 2789 int yycount = 1; 2790 2791 yyarg[0] = yytname[yytype]; 2792 yyfmt = yystpcpy (yyformat, yyunexpected); 2793 2794 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 2795 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 2796 { 2797 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 2798 { 2799 yycount = 1; 2800 yysize = yysize0; 2801 yyformat[sizeof yyunexpected - 1] = '\0'; 2802 break; 2803 } 2804 yyarg[yycount++] = yytname[yyx]; 2805 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 2806 yysize_overflow |= yysize1 < yysize; 2807 yysize = yysize1; 2808 yyfmt = yystpcpy (yyfmt, yyprefix); 2809 yyprefix = yyor; 2810 } 2811 2812 yyf = YY_(yyformat); 2813 yysize1 = yysize + yystrlen (yyf); 2814 yysize_overflow |= yysize1 < yysize; 2815 yysize = yysize1; 2816 2817 if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) 2818 yymsg = (char *) YYSTACK_ALLOC (yysize); 2819 if (yymsg) 2820 { 2821 /* Avoid sprintf, as that infringes on the user's name space. 2822 Don't have undefined behavior even if the translation 2823 produced a string with the wrong number of "%s"s. */ 2824 char *yyp = yymsg; 2825 int yyi = 0; 2826 while ((*yyp = *yyf)) 2827 { 2828 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 2829 { 2830 yyp += yytnamerr (yyp, yyarg[yyi++]); 2831 yyf += 2; 2832 } 2833 else 2834 { 2835 yyp++; 2836 yyf++; 2837 } 2838 } 2839 yyerror (yymsg); 2840 YYSTACK_FREE (yymsg); 2841 } 2842 else 2843 { 2844 yyerror (YY_("syntax error")); 2845 goto yyexhaustedlab; 2846 } 2847 } 2848 else 2849#endif /* YYERROR_VERBOSE */ 2850 yyerror (YY_("syntax error")); 2851 } 2852 2853 2854 2855 if (yyerrstatus == 3) 2856 { 2857 /* If just tried and failed to reuse look-ahead token after an 2858 error, discard it. */ 2859 2860 if (yychar <= YYEOF) 2861 { 2862 /* Return failure if at end of input. */ 2863 if (yychar == YYEOF) 2864 YYABORT; 2865 } 2866 else 2867 { 2868 yydestruct ("Error: discarding", yytoken, &yylval); 2869 yychar = YYEMPTY; 2870 } 2871 } 2872 2873 /* Else will try to reuse look-ahead token after shifting the error 2874 token. */ 2875 goto yyerrlab1; 2876 2877 2878/*---------------------------------------------------. 2879| yyerrorlab -- error raised explicitly by YYERROR. | 2880`---------------------------------------------------*/ 2881yyerrorlab: 2882 2883 /* Pacify compilers like GCC when the user code never invokes 2884 YYERROR and the label yyerrorlab therefore never appears in user 2885 code. */ 2886 if (0) 2887 goto yyerrorlab; 2888 2889yyvsp -= yylen; 2890 yyssp -= yylen; 2891 yystate = *yyssp; 2892 goto yyerrlab1; 2893 2894 2895/*-------------------------------------------------------------. 2896| yyerrlab1 -- common code for both syntax error and YYERROR. | 2897`-------------------------------------------------------------*/ 2898yyerrlab1: 2899 yyerrstatus = 3; /* Each real token shifted decrements this. */ 2900 2901 for (;;) 2902 { 2903 yyn = yypact[yystate]; 2904 if (yyn != YYPACT_NINF) 2905 { 2906 yyn += YYTERROR; 2907 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2908 { 2909 yyn = yytable[yyn]; 2910 if (0 < yyn) 2911 break; 2912 } 2913 } 2914 2915 /* Pop the current state because it cannot handle the error token. */ 2916 if (yyssp == yyss) 2917 YYABORT; 2918 2919 2920 yydestruct ("Error: popping", yystos[yystate], yyvsp); 2921 YYPOPSTACK; 2922 yystate = *yyssp; 2923 YY_STACK_PRINT (yyss, yyssp); 2924 } 2925 2926 if (yyn == YYFINAL) 2927 YYACCEPT; 2928 2929 *++yyvsp = yylval; 2930 2931 2932 /* Shift the error token. */ 2933 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 2934 2935 yystate = yyn; 2936 goto yynewstate; 2937 2938 2939/*-------------------------------------. 2940| yyacceptlab -- YYACCEPT comes here. | 2941`-------------------------------------*/ 2942yyacceptlab: 2943 yyresult = 0; 2944 goto yyreturn; 2945 2946/*-----------------------------------. 2947| yyabortlab -- YYABORT comes here. | 2948`-----------------------------------*/ 2949yyabortlab: 2950 yyresult = 1; 2951 goto yyreturn; 2952 2953#ifndef yyoverflow 2954/*-------------------------------------------------. 2955| yyexhaustedlab -- memory exhaustion comes here. | 2956`-------------------------------------------------*/ 2957yyexhaustedlab: 2958 yyerror (YY_("memory exhausted")); 2959 yyresult = 2; 2960 /* Fall through. */ 2961#endif 2962 2963yyreturn: 2964 if (yychar != YYEOF && yychar != YYEMPTY) 2965 yydestruct ("Cleanup: discarding lookahead", 2966 yytoken, &yylval); 2967 while (yyssp != yyss) 2968 { 2969 yydestruct ("Cleanup: popping", 2970 yystos[*yyssp], yyvsp); 2971 YYPOPSTACK; 2972 } 2973#ifndef yyoverflow 2974 if (yyss != yyssa) 2975 YYSTACK_FREE (yyss); 2976#endif 2977 return yyresult; 2978} 2979 2980 2981#line 503 "grammar.y" 2982 2983 2984