1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse pcap_parse
63 #define yylex pcap_lex
64 #define yyerror pcap_error
65 #define yylval pcap_lval
66 #define yychar pcap_char
67 #define yydebug pcap_debug
68 #define yynerrs pcap_nerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
148 #define TK_BROADCAST 283
149 #define TK_MULTICAST 284
170 /* Copy the first part of user declarations. */
174 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
175 * The Regents of the University of California. All rights reserved.
177 * Redistribution and use in source and binary forms, with or without
178 * modification, are permitted provided that: (1) source code distributions
179 * retain the above copyright notice and this paragraph in its entirety, (2)
180 * distributions including binary code include the above copyright notice and
181 * this paragraph in its entirety in the documentation or other materials
182 * provided with the distribution, and (3) all advertising materials mentioning
183 * features or use of this software display the following acknowledgement:
184 * ``This product includes software developed by the University of California,
185 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
186 * the University nor the names of its contributors may be used to endorse
187 * or promote products derived from this software without specific prior
188 * written permission.
189 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
190 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
191 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
195 static const char rcsid
[] =
196 "@(#) $Header: /usr/local/cvs/linux/tools/build/e100boot/libpcap-0.4/grammar.y,v 1.1 1999/08/26 10:05:22 johana Exp $ (LBL)";
199 #include <sys/types.h>
200 #include <sys/time.h>
201 #include <sys/socket.h>
210 #include <netinet/in.h>
211 #include <netinet/if_ether.h>
215 #include "pcap-int.h"
218 #include <pcap-namedb.h>
221 #ifdef HAVE_OS_PROTO_H
222 #include "os-proto.h"
225 #define QSET(q, p, d, a) (q).proto = (p),\
231 static struct qual qerr
= { Q_UNDEF
, Q_UNDEF
, Q_UNDEF
, Q_UNDEF
};
237 bpf_error("%s", msg
);
253 /* Enabling traces. */
258 /* Enabling verbose error messages. */
259 #ifdef YYERROR_VERBOSE
260 # undef YYERROR_VERBOSE
261 # define YYERROR_VERBOSE 1
263 # define YYERROR_VERBOSE 0
266 /* Enabling the token table. */
267 #ifndef YYTOKEN_TABLE
268 # define YYTOKEN_TABLE 0
271 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
272 typedef union YYSTYPE
287 /* Line 187 of yacc.c. */
290 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
291 # define YYSTYPE_IS_DECLARED 1
292 # define YYSTYPE_IS_TRIVIAL 1
297 /* Copy the second part of user declarations. */
300 /* Line 216 of yacc.c. */
308 typedef YYTYPE_UINT8 yytype_uint8
;
310 typedef unsigned char yytype_uint8
;
314 typedef YYTYPE_INT8 yytype_int8
;
315 #elif (defined __STDC__ || defined __C99__FUNC__ \
316 || defined __cplusplus || defined _MSC_VER)
317 typedef signed char yytype_int8
;
319 typedef short int yytype_int8
;
323 typedef YYTYPE_UINT16 yytype_uint16
;
325 typedef unsigned short int yytype_uint16
;
329 typedef YYTYPE_INT16 yytype_int16
;
331 typedef short int yytype_int16
;
335 # ifdef __SIZE_TYPE__
336 # define YYSIZE_T __SIZE_TYPE__
337 # elif defined size_t
338 # define YYSIZE_T size_t
339 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
340 || defined __cplusplus || defined _MSC_VER)
341 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
342 # define YYSIZE_T size_t
344 # define YYSIZE_T unsigned int
348 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
353 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
354 # define YY_(msgid) dgettext ("bison-runtime", msgid)
358 # define YY_(msgid) msgid
362 /* Suppress unused-variable warnings by "using" E. */
363 #if ! defined lint || defined __GNUC__
364 # define YYUSE(e) ((void) (e))
366 # define YYUSE(e) /* empty */
369 /* Identity function, used to suppress warnings about constant conditions. */
373 #if (defined __STDC__ || defined __C99__FUNC__ \
374 || defined __cplusplus || defined _MSC_VER)
387 #if ! defined yyoverflow || YYERROR_VERBOSE
389 /* The parser invokes alloca or malloc; define the necessary symbols. */
391 # ifdef YYSTACK_USE_ALLOCA
392 # if YYSTACK_USE_ALLOCA
394 # define YYSTACK_ALLOC __builtin_alloca
395 # elif defined __BUILTIN_VA_ARG_INCR
396 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
398 # define YYSTACK_ALLOC __alloca
399 # elif defined _MSC_VER
400 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
401 # define alloca _alloca
403 # define YYSTACK_ALLOC alloca
404 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
405 || defined __cplusplus || defined _MSC_VER)
406 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
415 # ifdef YYSTACK_ALLOC
416 /* Pacify GCC's `empty if-body' warning. */
417 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
418 # ifndef YYSTACK_ALLOC_MAXIMUM
419 /* The OS might guarantee only one guard page at the bottom of the stack,
420 and a page size can be as small as 4096 bytes. So we cannot safely
421 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
422 to allow for a few compiler-allocated temporary stack slots. */
423 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
426 # define YYSTACK_ALLOC YYMALLOC
427 # define YYSTACK_FREE YYFREE
428 # ifndef YYSTACK_ALLOC_MAXIMUM
429 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
431 # if (defined __cplusplus && ! defined _STDLIB_H \
432 && ! ((defined YYMALLOC || defined malloc) \
433 && (defined YYFREE || defined free)))
434 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
440 # define YYMALLOC malloc
441 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
442 || defined __cplusplus || defined _MSC_VER)
443 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
448 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
449 || defined __cplusplus || defined _MSC_VER)
450 void free (void *); /* INFRINGES ON USER NAME SPACE */
454 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
457 #if (! defined yyoverflow \
458 && (! defined __cplusplus \
459 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
461 /* A type that is properly aligned for any stack member. */
468 /* The size of the maximum gap between one aligned stack and the next. */
469 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
471 /* The size of an array large to enough to hold all stacks, each with
473 # define YYSTACK_BYTES(N) \
474 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
475 + YYSTACK_GAP_MAXIMUM)
477 /* Copy COUNT objects from FROM to TO. The source and destination do
480 # if defined __GNUC__ && 1 < __GNUC__
481 # define YYCOPY(To, From, Count) \
482 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
484 # define YYCOPY(To, From, Count) \
488 for (yyi = 0; yyi < (Count); yyi++) \
489 (To)[yyi] = (From)[yyi]; \
495 /* Relocate STACK from its old location to the new one. The
496 local variables YYSIZE and YYSTACKSIZE give the old and new number of
497 elements in the stack, and YYPTR gives the new location of the
498 stack. Advance YYPTR to a properly aligned location for the next
500 # define YYSTACK_RELOCATE(Stack) \
503 YYSIZE_T yynewbytes; \
504 YYCOPY (&yyptr->Stack, Stack, yysize); \
505 Stack = &yyptr->Stack; \
506 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
507 yyptr += yynewbytes / sizeof (*yyptr); \
513 /* YYFINAL -- State number of the termination state. */
515 /* YYLAST -- Last index in YYTABLE. */
518 /* YYNTOKENS -- Number of terminals. */
520 /* YYNNTS -- Number of nonterminals. */
522 /* YYNRULES -- Number of rules. */
524 /* YYNRULES -- Number of states. */
525 #define YYNSTATES 151
527 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
529 #define YYMAXUTOK 300
531 #define YYTRANSLATE(YYX) \
532 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
534 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
535 static const yytype_uint8 yytranslate
[] =
537 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 45, 2, 2, 2, 2, 47, 2,
541 54, 53, 50, 48, 2, 49, 2, 51, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 60, 2,
543 57, 56, 55, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 58, 2, 59, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 46, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
563 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
564 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
565 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
566 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
571 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
573 static const yytype_uint16 yyprhs
[] =
575 0, 0, 3, 6, 8, 9, 11, 15, 19, 23,
576 27, 29, 31, 33, 35, 39, 41, 45, 49, 51,
577 53, 56, 58, 60, 62, 66, 70, 72, 74, 76,
578 79, 83, 86, 89, 92, 95, 98, 102, 104, 108,
579 112, 114, 116, 117, 119, 121, 125, 129, 133, 137,
580 139, 141, 143, 145, 147, 149, 151, 153, 155, 157,
581 159, 161, 163, 165, 167, 169, 171, 173, 175, 178,
582 181, 184, 187, 192, 194, 196, 198, 200, 202, 204,
583 206, 208, 210, 212, 217, 224, 228, 232, 236, 240,
584 244, 248, 252, 256, 259, 263, 265, 267, 269, 271,
588 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
589 static const yytype_int8 yyrhs
[] =
591 62, 0, -1, 63, 64, -1, 63, -1, -1, 73,
592 -1, 64, 65, 73, -1, 64, 65, 67, -1, 64,
593 66, 73, -1, 64, 66, 67, -1, 43, -1, 44,
594 -1, 68, -1, 87, -1, 70, 71, 53, -1, 37,
595 -1, 39, 51, 30, -1, 39, 8, 39, -1, 39,
596 -1, 38, -1, 69, 67, -1, 45, -1, 54, -1,
597 68, -1, 72, 65, 67, -1, 72, 66, 67, -1,
598 87, -1, 71, -1, 75, -1, 69, 73, -1, 76,
599 77, 78, -1, 76, 77, -1, 76, 78, -1, 76,
600 12, -1, 76, 79, -1, 74, 67, -1, 70, 64,
601 53, -1, 80, -1, 84, 82, 84, -1, 84, 83,
602 84, -1, 81, -1, 80, -1, -1, 4, -1, 3,
603 -1, 4, 44, 3, -1, 3, 44, 4, -1, 4,
604 43, 3, -1, 3, 43, 4, -1, 5, -1, 7,
605 -1, 9, -1, 6, -1, 33, -1, 16, -1, 14,
606 -1, 15, -1, 17, -1, 18, -1, 19, -1, 20,
607 -1, 21, -1, 22, -1, 23, -1, 24, -1, 25,
608 -1, 27, -1, 26, -1, 76, 28, -1, 76, 29,
609 -1, 10, 30, -1, 11, 30, -1, 13, 30, 86,
610 30, -1, 31, -1, 32, -1, 55, -1, 34, -1,
611 56, -1, 35, -1, 57, -1, 36, -1, 87, -1,
612 85, -1, 80, 58, 84, 59, -1, 80, 58, 84,
613 60, 30, 59, -1, 84, 48, 84, -1, 84, 49,
614 84, -1, 84, 50, 84, -1, 84, 51, 84, -1,
615 84, 47, 84, -1, 84, 46, 84, -1, 84, 40,
616 84, -1, 84, 41, 84, -1, 49, 84, -1, 70,
617 85, 53, -1, 42, -1, 47, -1, 46, -1, 57,
618 -1, 55, -1, 56, -1, 30, -1, 70, 87, 53,
622 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
623 static const yytype_uint16 yyrline
[] =
625 0, 130, 130, 134, 136, 138, 139, 140, 141, 142,
626 144, 146, 148, 149, 151, 153, 154, 156, 158, 170,
627 171, 173, 175, 177, 178, 179, 181, 183, 185, 186,
628 188, 189, 190, 191, 192, 194, 195, 196, 197, 199,
629 201, 204, 205, 208, 209, 210, 211, 212, 213, 216,
630 217, 218, 221, 223, 224, 225, 226, 227, 228, 229,
631 230, 231, 232, 233, 234, 235, 236, 237, 239, 240,
632 241, 242, 243, 244, 245, 247, 248, 249, 251, 252,
633 253, 255, 256, 258, 259, 260, 261, 262, 263, 264,
634 265, 266, 267, 268, 269, 270, 272, 273, 274, 275,
639 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
640 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
641 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
642 static const char *const yytname
[] =
644 "$end", "error", "$undefined", "DST", "SRC", "HOST", "GATEWAY", "NET",
645 "MASK", "PORT", "LESS", "GREATER", "PROTO", "BYTE", "ARP", "RARP", "IP",
646 "TCP", "UDP", "ICMP", "IGMP", "IGRP", "ATALK", "DECNET", "LAT", "SCA",
647 "MOPRC", "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND",
648 "OUTBOUND", "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID", "LSH",
649 "RSH", "LEN", "AND", "OR", "'!'", "'|'", "'&'", "'+'", "'-'", "'*'",
650 "'/'", "UMINUS", "')'", "'('", "'>'", "'='", "'<'", "'['", "']'", "':'",
651 "$accept", "prog", "null", "expr", "and", "or", "id", "nid", "not",
652 "paren", "pid", "qid", "term", "head", "rterm", "pqual", "dqual",
653 "aqual", "ndaqual", "pname", "other", "relop", "irelop", "arth", "narth",
659 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
661 static const yytype_uint16 yytoknum
[] =
663 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
664 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
665 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
666 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
667 295, 296, 297, 298, 299, 33, 124, 38, 43, 45,
668 42, 47, 300, 41, 40, 62, 61, 60, 91, 93,
673 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
674 static const yytype_uint8 yyr1
[] =
676 0, 61, 62, 62, 63, 64, 64, 64, 64, 64,
677 65, 66, 67, 67, 67, 68, 68, 68, 68, 68,
678 68, 69, 70, 71, 71, 71, 72, 72, 73, 73,
679 74, 74, 74, 74, 74, 75, 75, 75, 75, 75,
680 75, 76, 76, 77, 77, 77, 77, 77, 77, 78,
681 78, 78, 79, 80, 80, 80, 80, 80, 80, 80,
682 80, 80, 80, 80, 80, 80, 80, 80, 81, 81,
683 81, 81, 81, 81, 81, 82, 82, 82, 83, 83,
684 83, 84, 84, 85, 85, 85, 85, 85, 85, 85,
685 85, 85, 85, 85, 85, 85, 86, 86, 86, 86,
689 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
690 static const yytype_uint8 yyr2
[] =
692 0, 2, 2, 1, 0, 1, 3, 3, 3, 3,
693 1, 1, 1, 1, 3, 1, 3, 3, 1, 1,
694 2, 1, 1, 1, 3, 3, 1, 1, 1, 2,
695 3, 2, 2, 2, 2, 2, 3, 1, 3, 3,
696 1, 1, 0, 1, 1, 3, 3, 3, 3, 1,
697 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
698 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
699 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
700 1, 1, 1, 4, 6, 3, 3, 3, 3, 3,
701 3, 3, 3, 2, 3, 1, 1, 1, 1, 1,
705 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
706 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
707 means the default is an error. */
708 static const yytype_uint8 yydefact
[] =
710 4, 0, 42, 1, 0, 0, 0, 55, 56, 54,
711 57, 58, 59, 60, 61, 62, 63, 64, 65, 67,
712 66, 101, 73, 74, 53, 95, 21, 0, 22, 2,
713 42, 42, 5, 0, 28, 0, 41, 40, 0, 82,
714 81, 70, 71, 0, 0, 0, 93, 10, 11, 42,
715 42, 29, 0, 82, 81, 15, 19, 18, 35, 12,
716 0, 0, 13, 44, 43, 49, 52, 50, 51, 33,
717 68, 69, 31, 32, 34, 0, 76, 78, 80, 0,
718 0, 0, 0, 0, 0, 0, 0, 75, 77, 79,
719 0, 0, 97, 96, 99, 100, 98, 0, 0, 7,
720 42, 42, 6, 81, 9, 8, 36, 94, 102, 0,
721 0, 20, 23, 0, 27, 0, 26, 0, 0, 0,
722 0, 30, 0, 91, 92, 90, 89, 85, 86, 87,
723 88, 38, 39, 72, 81, 17, 16, 0, 14, 0,
724 0, 48, 46, 47, 45, 83, 0, 24, 25, 0,
728 /* YYDEFGOTO[NTERM-NUM]. */
729 static const yytype_int8 yydefgoto
[] =
731 -1, 1, 2, 52, 49, 50, 111, 59, 60, 44,
732 114, 115, 32, 33, 34, 35, 72, 73, 74, 45,
733 37, 90, 91, 38, 39, 97, 40
736 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
738 #define YYPACT_NINF -53
739 static const yytype_int16 yypact
[] =
741 -53, 10, 129, -53, -25, -18, 0, -53, -53, -53,
742 -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
743 -53, -53, -53, -53, -53, -53, -53, 254, -53, -1,
744 213, 213, -53, 50, -53, 285, 8, -53, 270, -53,
745 -53, -53, -53, 288, 254, -33, -53, -53, -53, 171,
746 171, -53, -3, -26, -21, -53, -53, -5, -53, -53,
747 50, 50, -53, 13, 53, -53, -53, -53, -53, -53,
748 -53, -53, 210, -53, -53, 254, -53, -53, -53, 254,
749 254, 254, 254, 254, 254, 254, 254, -53, -53, -53,
750 254, 254, -53, -53, -53, -53, -53, 9, 201, -53,
751 171, 171, -53, 26, -53, -53, -53, -53, -53, 21,
752 23, -53, -53, -17, -15, -1, -21, 58, 61, 64,
753 69, -53, 117, 27, 27, 43, 282, -36, -36, -53,
754 -53, 201, 201, -53, 57, -53, -53, -21, -53, 50,
755 50, -53, -53, -53, -53, -53, 52, -53, -53, 44,
759 /* YYPGOTO[NTERM-NUM]. */
760 static const yytype_int8 yypgoto
[] =
762 -53, -53, -53, 100, -8, 2, -31, -52, 5, -2,
763 -53, -53, -29, -53, -53, -53, -53, 46, -53, 14,
764 -53, -53, -53, 41, -20, -53, -27
767 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
768 positive, shift that token. If negative, reduce the rule which
769 number is the opposite. If zero, do what YYDEFACT says.
770 If YYTABLE_NINF, syntax error. */
771 #define YYTABLE_NINF -38
772 static const yytype_int16 yytable
[] =
774 31, 51, 58, 109, 54, 41, 62, 30, -37, 112,
775 3, 53, 42, 21, 85, 86, 36, 54, 99, 104,
776 102, 105, 103, 103, 53, 75, -13, 107, 31, 31,
777 43, 61, 108, 62, 116, 30, 30, 28, 138, 133,
778 47, 48, 47, 48, 36, 36, 110, 101, 101, 112,
779 106, -37, -37, 136, 100, 100, 117, 118, 61, 113,
780 135, -37, 141, 36, 36, 142, 75, 143, 46, -13,
781 -13, 51, 144, 103, 134, 83, 84, 85, 86, -13,
782 21, 53, 149, 79, 80, 98, 137, 55, 56, 57,
783 82, 83, 84, 85, 86, 26, 119, 120, 101, 31,
784 -26, -26, 29, 150, 28, 100, 100, 139, 147, 148,
785 108, 113, 62, 62, 36, 36, 122, 140, 121, 0,
786 123, 124, 125, 126, 127, 128, 129, 130, 0, -3,
787 0, 131, 132, 0, 0, 0, 0, 61, 61, 4,
788 5, 0, 6, 7, 8, 9, 10, 11, 12, 13,
789 14, 15, 16, 17, 18, 19, 20, 79, 80, 21,
790 22, 23, 24, 81, 82, 83, 84, 85, 86, 0,
791 0, 25, 0, 0, 26, 0, 145, 146, 27, 0,
792 0, 4, 5, 28, 6, 7, 8, 9, 10, 11,
793 12, 13, 14, 15, 16, 17, 18, 19, 20, 0,
794 0, 21, 22, 23, 24, 0, 0, 0, 55, 56,
795 57, 0, 0, 25, 0, 65, 26, 67, 0, 68,
796 27, 0, 0, 4, 5, 28, 6, 7, 8, 9,
797 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
798 20, 79, 80, 21, 22, 23, 24, 81, 82, 83,
799 84, 85, 86, 0, 0, 25, 0, 0, 26, 0,
800 0, 0, 27, 0, 0, 0, 0, 28, 7, 8,
801 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
802 19, 20, 0, 0, 21, 0, 0, 24, 63, 64,
803 65, 66, 67, 0, 68, 0, 25, 69, 0, 0,
804 0, 0, 0, 27, 76, 77, 78, 0, 28, 0,
805 79, 80, 0, 70, 71, 0, 81, 82, 83, 84,
806 85, 86, 79, 80, 0, 87, 88, 89, 0, 0,
807 83, 84, 85, 86, 92, 93, 0, 0, 0, 0,
811 static const yytype_int16 yycheck
[] =
813 2, 30, 33, 8, 31, 30, 33, 2, 0, 61,
814 0, 31, 30, 30, 50, 51, 2, 44, 49, 50,
815 49, 50, 49, 50, 44, 58, 0, 53, 30, 31,
816 30, 33, 53, 60, 61, 30, 31, 54, 53, 30,
817 43, 44, 43, 44, 30, 31, 51, 49, 50, 101,
818 53, 43, 44, 30, 49, 50, 43, 44, 60, 61,
819 39, 53, 4, 49, 50, 4, 58, 3, 27, 43,
820 44, 100, 3, 100, 101, 48, 49, 50, 51, 53,
821 30, 101, 30, 40, 41, 44, 113, 37, 38, 39,
822 47, 48, 49, 50, 51, 45, 43, 44, 100, 101,
823 43, 44, 2, 59, 54, 100, 101, 115, 139, 140,
824 53, 113, 139, 140, 100, 101, 75, 115, 72, -1,
825 79, 80, 81, 82, 83, 84, 85, 86, -1, 0,
826 -1, 90, 91, -1, -1, -1, -1, 139, 140, 10,
827 11, -1, 13, 14, 15, 16, 17, 18, 19, 20,
828 21, 22, 23, 24, 25, 26, 27, 40, 41, 30,
829 31, 32, 33, 46, 47, 48, 49, 50, 51, -1,
830 -1, 42, -1, -1, 45, -1, 59, 60, 49, -1,
831 -1, 10, 11, 54, 13, 14, 15, 16, 17, 18,
832 19, 20, 21, 22, 23, 24, 25, 26, 27, -1,
833 -1, 30, 31, 32, 33, -1, -1, -1, 37, 38,
834 39, -1, -1, 42, -1, 5, 45, 7, -1, 9,
835 49, -1, -1, 10, 11, 54, 13, 14, 15, 16,
836 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
837 27, 40, 41, 30, 31, 32, 33, 46, 47, 48,
838 49, 50, 51, -1, -1, 42, -1, -1, 45, -1,
839 -1, -1, 49, -1, -1, -1, -1, 54, 14, 15,
840 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
841 26, 27, -1, -1, 30, -1, -1, 33, 3, 4,
842 5, 6, 7, -1, 9, -1, 42, 12, -1, -1,
843 -1, -1, -1, 49, 34, 35, 36, -1, 54, -1,
844 40, 41, -1, 28, 29, -1, 46, 47, 48, 49,
845 50, 51, 40, 41, -1, 55, 56, 57, -1, -1,
846 48, 49, 50, 51, 46, 47, -1, -1, -1, -1,
847 -1, -1, -1, 55, 56, 57
850 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
851 symbol of state STATE-NUM. */
852 static const yytype_uint8 yystos
[] =
854 0, 62, 63, 0, 10, 11, 13, 14, 15, 16,
855 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
856 27, 30, 31, 32, 33, 42, 45, 49, 54, 64,
857 69, 70, 73, 74, 75, 76, 80, 81, 84, 85,
858 87, 30, 30, 30, 70, 80, 84, 43, 44, 65,
859 66, 73, 64, 85, 87, 37, 38, 39, 67, 68,
860 69, 70, 87, 3, 4, 5, 6, 7, 9, 12,
861 28, 29, 77, 78, 79, 58, 34, 35, 36, 40,
862 41, 46, 47, 48, 49, 50, 51, 55, 56, 57,
863 82, 83, 46, 47, 55, 56, 57, 86, 84, 67,
864 69, 70, 73, 87, 67, 73, 53, 53, 53, 8,
865 51, 67, 68, 70, 71, 72, 87, 43, 44, 43,
866 44, 78, 84, 84, 84, 84, 84, 84, 84, 84,
867 84, 84, 84, 30, 87, 39, 30, 87, 53, 65,
868 66, 4, 4, 3, 3, 59, 60, 67, 67, 30,
872 #define yyerrok (yyerrstatus = 0)
873 #define yyclearin (yychar = YYEMPTY)
877 #define YYACCEPT goto yyacceptlab
878 #define YYABORT goto yyabortlab
879 #define YYERROR goto yyerrorlab
882 /* Like YYERROR except do call yyerror. This remains here temporarily
883 to ease the transition to the new meaning of YYERROR, for GCC.
884 Once GCC version 2 has supplanted version 1, this can go. */
886 #define YYFAIL goto yyerrlab
888 #define YYRECOVERING() (!!yyerrstatus)
890 #define YYBACKUP(Token, Value) \
892 if (yychar == YYEMPTY && yylen == 1) \
896 yytoken = YYTRANSLATE (yychar); \
902 yyerror (YY_("syntax error: cannot back up")); \
909 #define YYERRCODE 256
912 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
913 If N is 0, then set CURRENT to the empty location which ends
914 the previous symbol: RHS[0] (always defined). */
916 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
917 #ifndef YYLLOC_DEFAULT
918 # define YYLLOC_DEFAULT(Current, Rhs, N) \
922 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
923 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
924 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
925 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
929 (Current).first_line = (Current).last_line = \
930 YYRHSLOC (Rhs, 0).last_line; \
931 (Current).first_column = (Current).last_column = \
932 YYRHSLOC (Rhs, 0).last_column; \
938 /* YY_LOCATION_PRINT -- Print the location on the stream.
939 This macro was not mandated originally: define only if we know
940 we won't break user code: when these are the locations we know. */
942 #ifndef YY_LOCATION_PRINT
943 # if YYLTYPE_IS_TRIVIAL
944 # define YY_LOCATION_PRINT(File, Loc) \
945 fprintf (File, "%d.%d-%d.%d", \
946 (Loc).first_line, (Loc).first_column, \
947 (Loc).last_line, (Loc).last_column)
949 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
954 /* YYLEX -- calling `yylex' with the right arguments. */
957 # define YYLEX yylex (YYLEX_PARAM)
959 # define YYLEX yylex ()
962 /* Enable debugging if requested. */
966 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
967 # define YYFPRINTF fprintf
970 # define YYDPRINTF(Args) \
976 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
980 YYFPRINTF (stderr, "%s ", Title); \
981 yy_symbol_print (stderr, \
983 YYFPRINTF (stderr, "\n"); \
988 /*--------------------------------.
989 | Print this symbol on YYOUTPUT. |
990 `--------------------------------*/
993 #if (defined __STDC__ || defined __C99__FUNC__ \
994 || defined __cplusplus || defined _MSC_VER)
996 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
999 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
)
1002 YYSTYPE
const * const yyvaluep
;
1008 if (yytype
< YYNTOKENS
)
1009 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1021 /*--------------------------------.
1022 | Print this symbol on YYOUTPUT. |
1023 `--------------------------------*/
1025 #if (defined __STDC__ || defined __C99__FUNC__ \
1026 || defined __cplusplus || defined _MSC_VER)
1028 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1031 yy_symbol_print (yyoutput
, yytype
, yyvaluep
)
1034 YYSTYPE
const * const yyvaluep
;
1037 if (yytype
< YYNTOKENS
)
1038 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1040 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1042 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1043 YYFPRINTF (yyoutput
, ")");
1046 /*------------------------------------------------------------------.
1047 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1049 `------------------------------------------------------------------*/
1051 #if (defined __STDC__ || defined __C99__FUNC__ \
1052 || defined __cplusplus || defined _MSC_VER)
1054 yy_stack_print (yytype_int16
*bottom
, yytype_int16
*top
)
1057 yy_stack_print (bottom
, top
)
1058 yytype_int16
*bottom
;
1062 YYFPRINTF (stderr
, "Stack now");
1063 for (; bottom
<= top
; ++bottom
)
1064 YYFPRINTF (stderr
, " %d", *bottom
);
1065 YYFPRINTF (stderr
, "\n");
1068 # define YY_STACK_PRINT(Bottom, Top) \
1071 yy_stack_print ((Bottom), (Top)); \
1075 /*------------------------------------------------.
1076 | Report that the YYRULE is going to be reduced. |
1077 `------------------------------------------------*/
1079 #if (defined __STDC__ || defined __C99__FUNC__ \
1080 || defined __cplusplus || defined _MSC_VER)
1082 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
)
1085 yy_reduce_print (yyvsp
, yyrule
)
1090 int yynrhs
= yyr2
[yyrule
];
1092 unsigned long int yylno
= yyrline
[yyrule
];
1093 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1095 /* The symbols being reduced. */
1096 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1098 fprintf (stderr
, " $%d = ", yyi
+ 1);
1099 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
1100 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1102 fprintf (stderr
, "\n");
1106 # define YY_REDUCE_PRINT(Rule) \
1109 yy_reduce_print (yyvsp, Rule); \
1112 /* Nonzero means print parse trace. It is left uninitialized so that
1113 multiple parsers can coexist. */
1115 #else /* !YYDEBUG */
1116 # define YYDPRINTF(Args)
1117 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1118 # define YY_STACK_PRINT(Bottom, Top)
1119 # define YY_REDUCE_PRINT(Rule)
1120 #endif /* !YYDEBUG */
1123 /* YYINITDEPTH -- initial size of the parser's stacks. */
1125 # define YYINITDEPTH 200
1128 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1129 if the built-in stack extension method is used).
1131 Do not make this value too large; the results are undefined if
1132 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1133 evaluated with infinite-precision integer arithmetic. */
1136 # define YYMAXDEPTH 10000
1144 # if defined __GLIBC__ && defined _STRING_H
1145 # define yystrlen strlen
1147 /* Return the length of YYSTR. */
1148 #if (defined __STDC__ || defined __C99__FUNC__ \
1149 || defined __cplusplus || defined _MSC_VER)
1151 yystrlen (const char *yystr
)
1159 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1167 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1168 # define yystpcpy stpcpy
1170 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1172 #if (defined __STDC__ || defined __C99__FUNC__ \
1173 || defined __cplusplus || defined _MSC_VER)
1175 yystpcpy (char *yydest
, const char *yysrc
)
1178 yystpcpy (yydest
, yysrc
)
1184 const char *yys
= yysrc
;
1186 while ((*yyd
++ = *yys
++) != '\0')
1195 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1196 quotes and backslashes, so that it's suitable for yyerror. The
1197 heuristic is that double-quoting is unnecessary unless the string
1198 contains an apostrophe, a comma, or backslash (other than
1199 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1200 null, do not copy; instead, return the length of what the result
1203 yytnamerr (char *yyres
, const char *yystr
)
1208 char const *yyp
= yystr
;
1215 goto do_not_strip_quotes
;
1219 goto do_not_strip_quotes
;
1232 do_not_strip_quotes
: ;
1236 return yystrlen (yystr
);
1238 return yystpcpy (yyres
, yystr
) - yyres
;
1242 /* Copy into YYRESULT an error message about the unexpected token
1243 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1244 including the terminating null byte. If YYRESULT is null, do not
1245 copy anything; just return the number of bytes that would be
1246 copied. As a special case, return 0 if an ordinary "syntax error"
1247 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1248 size calculation. */
1250 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1252 int yyn
= yypact
[yystate
];
1254 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1258 int yytype
= YYTRANSLATE (yychar
);
1259 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1260 YYSIZE_T yysize
= yysize0
;
1262 int yysize_overflow
= 0;
1263 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1264 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1268 /* This is so xgettext sees the translatable formats that are
1269 constructed on the fly. */
1270 YY_("syntax error, unexpected %s");
1271 YY_("syntax error, unexpected %s, expecting %s");
1272 YY_("syntax error, unexpected %s, expecting %s or %s");
1273 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1274 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1278 static char const yyunexpected
[] = "syntax error, unexpected %s";
1279 static char const yyexpecting
[] = ", expecting %s";
1280 static char const yyor
[] = " or %s";
1281 char yyformat
[sizeof yyunexpected
1282 + sizeof yyexpecting
- 1
1283 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1284 * (sizeof yyor
- 1))];
1285 char const *yyprefix
= yyexpecting
;
1287 /* Start YYX at -YYN if negative to avoid negative indexes in
1289 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1291 /* Stay within bounds of both yycheck and yytname. */
1292 int yychecklim
= YYLAST
- yyn
+ 1;
1293 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1296 yyarg
[0] = yytname
[yytype
];
1297 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1299 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1300 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1302 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1306 yyformat
[sizeof yyunexpected
- 1] = '\0';
1309 yyarg
[yycount
++] = yytname
[yyx
];
1310 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1311 yysize_overflow
|= (yysize1
< yysize
);
1313 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1317 yyf
= YY_(yyformat
);
1318 yysize1
= yysize
+ yystrlen (yyf
);
1319 yysize_overflow
|= (yysize1
< yysize
);
1322 if (yysize_overflow
)
1323 return YYSIZE_MAXIMUM
;
1327 /* Avoid sprintf, as that infringes on the user's name space.
1328 Don't have undefined behavior even if the translation
1329 produced a string with the wrong number of "%s"s. */
1330 char *yyp
= yyresult
;
1332 while ((*yyp
= *yyf
) != '\0')
1334 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1336 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1349 #endif /* YYERROR_VERBOSE */
1352 /*-----------------------------------------------.
1353 | Release the memory associated to this symbol. |
1354 `-----------------------------------------------*/
1357 #if (defined __STDC__ || defined __C99__FUNC__ \
1358 || defined __cplusplus || defined _MSC_VER)
1360 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1363 yydestruct (yymsg
, yytype
, yyvaluep
)
1373 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1384 /* Prevent warnings from -Wmissing-prototypes. */
1386 #ifdef YYPARSE_PARAM
1387 #if defined __STDC__ || defined __cplusplus
1388 int yyparse (void *YYPARSE_PARAM
);
1392 #else /* ! YYPARSE_PARAM */
1393 #if defined __STDC__ || defined __cplusplus
1398 #endif /* ! YYPARSE_PARAM */
1402 /* The look-ahead symbol. */
1405 /* The semantic value of the look-ahead symbol. */
1408 /* Number of syntax errors so far. */
1417 #ifdef YYPARSE_PARAM
1418 #if (defined __STDC__ || defined __C99__FUNC__ \
1419 || defined __cplusplus || defined _MSC_VER)
1421 yyparse (void *YYPARSE_PARAM
)
1424 yyparse (YYPARSE_PARAM
)
1425 void *YYPARSE_PARAM
;
1427 #else /* ! YYPARSE_PARAM */
1428 #if (defined __STDC__ || defined __C99__FUNC__ \
1429 || defined __cplusplus || defined _MSC_VER)
1443 /* Number of tokens to shift before error messages enabled. */
1445 /* Look-ahead token as an internal (translated) token number. */
1448 /* Buffer for error messages, and its allocated size. */
1450 char *yymsg
= yymsgbuf
;
1451 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1454 /* Three stacks and their tools:
1455 `yyss': related to states,
1456 `yyvs': related to semantic values,
1457 `yyls': related to locations.
1459 Refer to the stacks thru separate pointers, to allow yyoverflow
1460 to reallocate them elsewhere. */
1462 /* The state stack. */
1463 yytype_int16 yyssa
[YYINITDEPTH
];
1464 yytype_int16
*yyss
= yyssa
;
1465 yytype_int16
*yyssp
;
1467 /* The semantic value stack. */
1468 YYSTYPE yyvsa
[YYINITDEPTH
];
1469 YYSTYPE
*yyvs
= yyvsa
;
1474 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1476 YYSIZE_T yystacksize
= YYINITDEPTH
;
1478 /* The variables used to return semantic value and location from the
1483 /* The number of symbols on the RHS of the reduced rule.
1484 Keep to zero when no symbol should be popped. */
1487 YYDPRINTF ((stderr
, "Starting parse\n"));
1492 yychar
= YYEMPTY
; /* Cause a token to be read. */
1494 /* Initialize stack pointers.
1495 Waste one element of value and location stack
1496 so that they stay on the same level as the state stack.
1497 The wasted elements are never initialized. */
1504 /*------------------------------------------------------------.
1505 | yynewstate -- Push a new state, which is found in yystate. |
1506 `------------------------------------------------------------*/
1508 /* In all cases, when you get here, the value and location stacks
1509 have just been pushed. So pushing a state here evens the stacks. */
1515 if (yyss
+ yystacksize
- 1 <= yyssp
)
1517 /* Get the current used size of the three stacks, in elements. */
1518 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1522 /* Give user a chance to reallocate the stack. Use copies of
1523 these so that the &'s don't force the real ones into
1525 YYSTYPE
*yyvs1
= yyvs
;
1526 yytype_int16
*yyss1
= yyss
;
1529 /* Each stack pointer address is followed by the size of the
1530 data in use in that stack, in bytes. This used to be a
1531 conditional around just the two extra args, but that might
1532 be undefined if yyoverflow is a macro. */
1533 yyoverflow (YY_("memory exhausted"),
1534 &yyss1
, yysize
* sizeof (*yyssp
),
1535 &yyvs1
, yysize
* sizeof (*yyvsp
),
1542 #else /* no yyoverflow */
1543 # ifndef YYSTACK_RELOCATE
1544 goto yyexhaustedlab
;
1546 /* Extend the stack our own way. */
1547 if (YYMAXDEPTH
<= yystacksize
)
1548 goto yyexhaustedlab
;
1550 if (YYMAXDEPTH
< yystacksize
)
1551 yystacksize
= YYMAXDEPTH
;
1554 yytype_int16
*yyss1
= yyss
;
1555 union yyalloc
*yyptr
=
1556 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1558 goto yyexhaustedlab
;
1559 YYSTACK_RELOCATE (yyss
);
1560 YYSTACK_RELOCATE (yyvs
);
1562 # undef YYSTACK_RELOCATE
1564 YYSTACK_FREE (yyss1
);
1567 #endif /* no yyoverflow */
1569 yyssp
= yyss
+ yysize
- 1;
1570 yyvsp
= yyvs
+ yysize
- 1;
1573 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1574 (unsigned long int) yystacksize
));
1576 if (yyss
+ yystacksize
- 1 <= yyssp
)
1580 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1589 /* Do appropriate processing given the current state. Read a
1590 look-ahead token if we need one and don't already have one. */
1592 /* First try to decide what to do without reference to look-ahead token. */
1593 yyn
= yypact
[yystate
];
1594 if (yyn
== YYPACT_NINF
)
1597 /* Not known => get a look-ahead token if don't already have one. */
1599 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1600 if (yychar
== YYEMPTY
)
1602 YYDPRINTF ((stderr
, "Reading a token: "));
1606 if (yychar
<= YYEOF
)
1608 yychar
= yytoken
= YYEOF
;
1609 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1613 yytoken
= YYTRANSLATE (yychar
);
1614 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1617 /* If the proper action on seeing token YYTOKEN is to reduce or to
1618 detect an error, take that action. */
1620 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1625 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1634 /* Count tokens shifted since error; after three, turn off error
1639 /* Shift the look-ahead token. */
1640 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1642 /* Discard the shifted token unless it is eof. */
1643 if (yychar
!= YYEOF
)
1652 /*-----------------------------------------------------------.
1653 | yydefault -- do the default action for the current state. |
1654 `-----------------------------------------------------------*/
1656 yyn
= yydefact
[yystate
];
1662 /*-----------------------------.
1663 | yyreduce -- Do a reduction. |
1664 `-----------------------------*/
1666 /* yyn is the number of a rule to reduce with. */
1669 /* If YYLEN is nonzero, implement the default value of the action:
1672 Otherwise, the following line sets YYVAL to garbage.
1673 This behavior is undocumented and Bison
1674 users should not rely upon it. Assigning to YYVAL
1675 unconditionally makes the parser a bit smaller, and it avoids a
1676 GCC warning that YYVAL may be used uninitialized. */
1677 yyval
= yyvsp
[1-yylen
];
1680 YY_REDUCE_PRINT (yyn
);
1684 #line 131 "grammar.y"
1686 finish_parse((yyvsp
[(2) - (2)].blk
).b
);
1691 #line 136 "grammar.y"
1692 { (yyval
.blk
).q
= qerr
; }
1696 #line 139 "grammar.y"
1697 { gen_and((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1701 #line 140 "grammar.y"
1702 { gen_and((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1706 #line 141 "grammar.y"
1707 { gen_or((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1711 #line 142 "grammar.y"
1712 { gen_or((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1716 #line 144 "grammar.y"
1717 { (yyval
.blk
) = (yyvsp
[(0) - (1)].blk
); }
1721 #line 146 "grammar.y"
1722 { (yyval
.blk
) = (yyvsp
[(0) - (1)].blk
); }
1726 #line 149 "grammar.y"
1727 { (yyval
.blk
).b
= gen_ncode(NULL
, (bpf_u_int32
)(yyvsp
[(1) - (1)].i
),
1728 (yyval
.blk
).q
= (yyvsp
[(0) - (1)].blk
).q
); }
1732 #line 151 "grammar.y"
1733 { (yyval
.blk
) = (yyvsp
[(2) - (3)].blk
); }
1737 #line 153 "grammar.y"
1738 { (yyval
.blk
).b
= gen_scode((yyvsp
[(1) - (1)].s
), (yyval
.blk
).q
= (yyvsp
[(0) - (1)].blk
).q
); }
1742 #line 154 "grammar.y"
1743 { (yyval
.blk
).b
= gen_mcode((yyvsp
[(1) - (3)].s
), NULL
, (yyvsp
[(3) - (3)].i
),
1744 (yyval
.blk
).q
= (yyvsp
[(0) - (3)].blk
).q
); }
1748 #line 156 "grammar.y"
1749 { (yyval
.blk
).b
= gen_mcode((yyvsp
[(1) - (3)].s
), (yyvsp
[(3) - (3)].s
), 0,
1750 (yyval
.blk
).q
= (yyvsp
[(0) - (3)].blk
).q
); }
1754 #line 158 "grammar.y"
1756 /* Decide how to parse HID based on proto */
1757 (yyval
.blk
).q
= (yyvsp
[(0) - (1)].blk
).q
;
1758 switch ((yyval
.blk
).q
.proto
) {
1760 (yyval
.blk
).b
= gen_ncode((yyvsp
[(1) - (1)].s
), 0, (yyval
.blk
).q
);
1763 (yyval
.blk
).b
= gen_ncode((yyvsp
[(1) - (1)].s
), 0, (yyval
.blk
).q
);
1770 #line 170 "grammar.y"
1771 { (yyval
.blk
).b
= gen_ecode((yyvsp
[(1) - (1)].e
), (yyval
.blk
).q
= (yyvsp
[(0) - (1)].blk
).q
); }
1775 #line 171 "grammar.y"
1776 { gen_not((yyvsp
[(2) - (2)].blk
).b
); (yyval
.blk
) = (yyvsp
[(2) - (2)].blk
); }
1780 #line 173 "grammar.y"
1781 { (yyval
.blk
) = (yyvsp
[(0) - (1)].blk
); }
1785 #line 175 "grammar.y"
1786 { (yyval
.blk
) = (yyvsp
[(0) - (1)].blk
); }
1790 #line 178 "grammar.y"
1791 { gen_and((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1795 #line 179 "grammar.y"
1796 { gen_or((yyvsp
[(1) - (3)].blk
).b
, (yyvsp
[(3) - (3)].blk
).b
); (yyval
.blk
) = (yyvsp
[(3) - (3)].blk
); }
1800 #line 181 "grammar.y"
1801 { (yyval
.blk
).b
= gen_ncode(NULL
, (bpf_u_int32
)(yyvsp
[(1) - (1)].i
),
1802 (yyval
.blk
).q
= (yyvsp
[(0) - (1)].blk
).q
); }
1806 #line 186 "grammar.y"
1807 { gen_not((yyvsp
[(2) - (2)].blk
).b
); (yyval
.blk
) = (yyvsp
[(2) - (2)].blk
); }
1811 #line 188 "grammar.y"
1812 { QSET((yyval
.blk
).q
, (yyvsp
[(1) - (3)].i
), (yyvsp
[(2) - (3)].i
), (yyvsp
[(3) - (3)].i
)); }
1816 #line 189 "grammar.y"
1817 { QSET((yyval
.blk
).q
, (yyvsp
[(1) - (2)].i
), (yyvsp
[(2) - (2)].i
), Q_DEFAULT
); }
1821 #line 190 "grammar.y"
1822 { QSET((yyval
.blk
).q
, (yyvsp
[(1) - (2)].i
), Q_DEFAULT
, (yyvsp
[(2) - (2)].i
)); }
1826 #line 191 "grammar.y"
1827 { QSET((yyval
.blk
).q
, (yyvsp
[(1) - (2)].i
), Q_DEFAULT
, Q_PROTO
); }
1831 #line 192 "grammar.y"
1832 { QSET((yyval
.blk
).q
, (yyvsp
[(1) - (2)].i
), Q_DEFAULT
, (yyvsp
[(2) - (2)].i
)); }
1836 #line 194 "grammar.y"
1837 { (yyval
.blk
) = (yyvsp
[(2) - (2)].blk
); }
1841 #line 195 "grammar.y"
1842 { (yyval
.blk
).b
= (yyvsp
[(2) - (3)].blk
).b
; (yyval
.blk
).q
= (yyvsp
[(1) - (3)].blk
).q
; }
1846 #line 196 "grammar.y"
1847 { (yyval
.blk
).b
= gen_proto_abbrev((yyvsp
[(1) - (1)].i
)); (yyval
.blk
).q
= qerr
; }
1851 #line 197 "grammar.y"
1852 { (yyval
.blk
).b
= gen_relation((yyvsp
[(2) - (3)].i
), (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
), 0);
1853 (yyval
.blk
).q
= qerr
; }
1857 #line 199 "grammar.y"
1858 { (yyval
.blk
).b
= gen_relation((yyvsp
[(2) - (3)].i
), (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
), 1);
1859 (yyval
.blk
).q
= qerr
; }
1863 #line 201 "grammar.y"
1864 { (yyval
.blk
).b
= (yyvsp
[(1) - (1)].rblk
); (yyval
.blk
).q
= qerr
; }
1868 #line 205 "grammar.y"
1869 { (yyval
.i
) = Q_DEFAULT
; }
1873 #line 208 "grammar.y"
1874 { (yyval
.i
) = Q_SRC
; }
1878 #line 209 "grammar.y"
1879 { (yyval
.i
) = Q_DST
; }
1883 #line 210 "grammar.y"
1884 { (yyval
.i
) = Q_OR
; }
1888 #line 211 "grammar.y"
1889 { (yyval
.i
) = Q_OR
; }
1893 #line 212 "grammar.y"
1894 { (yyval
.i
) = Q_AND
; }
1898 #line 213 "grammar.y"
1899 { (yyval
.i
) = Q_AND
; }
1903 #line 216 "grammar.y"
1904 { (yyval
.i
) = Q_HOST
; }
1908 #line 217 "grammar.y"
1909 { (yyval
.i
) = Q_NET
; }
1913 #line 218 "grammar.y"
1914 { (yyval
.i
) = Q_PORT
; }
1918 #line 221 "grammar.y"
1919 { (yyval
.i
) = Q_GATEWAY
; }
1923 #line 223 "grammar.y"
1924 { (yyval
.i
) = Q_LINK
; }
1928 #line 224 "grammar.y"
1929 { (yyval
.i
) = Q_IP
; }
1933 #line 225 "grammar.y"
1934 { (yyval
.i
) = Q_ARP
; }
1938 #line 226 "grammar.y"
1939 { (yyval
.i
) = Q_RARP
; }
1943 #line 227 "grammar.y"
1944 { (yyval
.i
) = Q_TCP
; }
1948 #line 228 "grammar.y"
1949 { (yyval
.i
) = Q_UDP
; }
1953 #line 229 "grammar.y"
1954 { (yyval
.i
) = Q_ICMP
; }
1958 #line 230 "grammar.y"
1959 { (yyval
.i
) = Q_IGMP
; }
1963 #line 231 "grammar.y"
1964 { (yyval
.i
) = Q_IGRP
; }
1968 #line 232 "grammar.y"
1969 { (yyval
.i
) = Q_ATALK
; }
1973 #line 233 "grammar.y"
1974 { (yyval
.i
) = Q_DECNET
; }
1978 #line 234 "grammar.y"
1979 { (yyval
.i
) = Q_LAT
; }
1983 #line 235 "grammar.y"
1984 { (yyval
.i
) = Q_SCA
; }
1988 #line 236 "grammar.y"
1989 { (yyval
.i
) = Q_MOPDL
; }
1993 #line 237 "grammar.y"
1994 { (yyval
.i
) = Q_MOPRC
; }
1998 #line 239 "grammar.y"
1999 { (yyval
.rblk
) = gen_broadcast((yyvsp
[(1) - (2)].i
)); }
2003 #line 240 "grammar.y"
2004 { (yyval
.rblk
) = gen_multicast((yyvsp
[(1) - (2)].i
)); }
2008 #line 241 "grammar.y"
2009 { (yyval
.rblk
) = gen_less((yyvsp
[(2) - (2)].i
)); }
2013 #line 242 "grammar.y"
2014 { (yyval
.rblk
) = gen_greater((yyvsp
[(2) - (2)].i
)); }
2018 #line 243 "grammar.y"
2019 { (yyval
.rblk
) = gen_byteop((yyvsp
[(3) - (4)].i
), (yyvsp
[(2) - (4)].i
), (yyvsp
[(4) - (4)].i
)); }
2023 #line 244 "grammar.y"
2024 { (yyval
.rblk
) = gen_inbound(0); }
2028 #line 245 "grammar.y"
2029 { (yyval
.rblk
) = gen_inbound(1); }
2033 #line 247 "grammar.y"
2034 { (yyval
.i
) = BPF_JGT
; }
2038 #line 248 "grammar.y"
2039 { (yyval
.i
) = BPF_JGE
; }
2043 #line 249 "grammar.y"
2044 { (yyval
.i
) = BPF_JEQ
; }
2048 #line 251 "grammar.y"
2049 { (yyval
.i
) = BPF_JGT
; }
2053 #line 252 "grammar.y"
2054 { (yyval
.i
) = BPF_JGE
; }
2058 #line 253 "grammar.y"
2059 { (yyval
.i
) = BPF_JEQ
; }
2063 #line 255 "grammar.y"
2064 { (yyval
.a
) = gen_loadi((yyvsp
[(1) - (1)].i
)); }
2068 #line 258 "grammar.y"
2069 { (yyval
.a
) = gen_load((yyvsp
[(1) - (4)].i
), (yyvsp
[(3) - (4)].a
), 1); }
2073 #line 259 "grammar.y"
2074 { (yyval
.a
) = gen_load((yyvsp
[(1) - (6)].i
), (yyvsp
[(3) - (6)].a
), (yyvsp
[(5) - (6)].i
)); }
2078 #line 260 "grammar.y"
2079 { (yyval
.a
) = gen_arth(BPF_ADD
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2083 #line 261 "grammar.y"
2084 { (yyval
.a
) = gen_arth(BPF_SUB
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2088 #line 262 "grammar.y"
2089 { (yyval
.a
) = gen_arth(BPF_MUL
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2093 #line 263 "grammar.y"
2094 { (yyval
.a
) = gen_arth(BPF_DIV
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2098 #line 264 "grammar.y"
2099 { (yyval
.a
) = gen_arth(BPF_AND
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2103 #line 265 "grammar.y"
2104 { (yyval
.a
) = gen_arth(BPF_OR
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2108 #line 266 "grammar.y"
2109 { (yyval
.a
) = gen_arth(BPF_LSH
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2113 #line 267 "grammar.y"
2114 { (yyval
.a
) = gen_arth(BPF_RSH
, (yyvsp
[(1) - (3)].a
), (yyvsp
[(3) - (3)].a
)); }
2118 #line 268 "grammar.y"
2119 { (yyval
.a
) = gen_neg((yyvsp
[(2) - (2)].a
)); }
2123 #line 269 "grammar.y"
2124 { (yyval
.a
) = (yyvsp
[(2) - (3)].a
); }
2128 #line 270 "grammar.y"
2129 { (yyval
.a
) = gen_loadlen(); }
2133 #line 272 "grammar.y"
2134 { (yyval
.i
) = '&'; }
2138 #line 273 "grammar.y"
2139 { (yyval
.i
) = '|'; }
2143 #line 274 "grammar.y"
2144 { (yyval
.i
) = '<'; }
2148 #line 275 "grammar.y"
2149 { (yyval
.i
) = '>'; }
2153 #line 276 "grammar.y"
2154 { (yyval
.i
) = '='; }
2158 #line 279 "grammar.y"
2159 { (yyval
.i
) = (yyvsp
[(2) - (3)].i
); }
2163 /* Line 1267 of yacc.c. */
2164 #line 2165 "y.tab.c"
2167 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2171 YY_STACK_PRINT (yyss
, yyssp
);
2176 /* Now `shift' the result of the reduction. Determine what state
2177 that goes to, based on the state we popped back to and the rule
2178 number reduced by. */
2182 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2183 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2184 yystate
= yytable
[yystate
];
2186 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2191 /*------------------------------------.
2192 | yyerrlab -- here on detecting error |
2193 `------------------------------------*/
2195 /* If not already recovering from an error, report this error. */
2199 #if ! YYERROR_VERBOSE
2200 yyerror (YY_("syntax error"));
2203 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2204 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2206 YYSIZE_T yyalloc
= 2 * yysize
;
2207 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2208 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2209 if (yymsg
!= yymsgbuf
)
2210 YYSTACK_FREE (yymsg
);
2211 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2213 yymsg_alloc
= yyalloc
;
2217 yymsg_alloc
= sizeof yymsgbuf
;
2221 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2223 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2228 yyerror (YY_("syntax error"));
2230 goto yyexhaustedlab
;
2238 if (yyerrstatus
== 3)
2240 /* If just tried and failed to reuse look-ahead token after an
2241 error, discard it. */
2243 if (yychar
<= YYEOF
)
2245 /* Return failure if at end of input. */
2246 if (yychar
== YYEOF
)
2251 yydestruct ("Error: discarding",
2257 /* Else will try to reuse look-ahead token after shifting the error
2262 /*---------------------------------------------------.
2263 | yyerrorlab -- error raised explicitly by YYERROR. |
2264 `---------------------------------------------------*/
2267 /* Pacify compilers like GCC when the user code never invokes
2268 YYERROR and the label yyerrorlab therefore never appears in user
2270 if (/*CONSTCOND*/ 0)
2273 /* Do not reclaim the symbols of the rule which action triggered
2277 YY_STACK_PRINT (yyss
, yyssp
);
2282 /*-------------------------------------------------------------.
2283 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2284 `-------------------------------------------------------------*/
2286 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2290 yyn
= yypact
[yystate
];
2291 if (yyn
!= YYPACT_NINF
)
2294 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2302 /* Pop the current state because it cannot handle the error token. */
2307 yydestruct ("Error: popping",
2308 yystos
[yystate
], yyvsp
);
2311 YY_STACK_PRINT (yyss
, yyssp
);
2320 /* Shift the error token. */
2321 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2327 /*-------------------------------------.
2328 | yyacceptlab -- YYACCEPT comes here. |
2329 `-------------------------------------*/
2334 /*-----------------------------------.
2335 | yyabortlab -- YYABORT comes here. |
2336 `-----------------------------------*/
2342 /*-------------------------------------------------.
2343 | yyexhaustedlab -- memory exhaustion comes here. |
2344 `-------------------------------------------------*/
2346 yyerror (YY_("memory exhausted"));
2352 if (yychar
!= YYEOF
&& yychar
!= YYEMPTY
)
2353 yydestruct ("Cleanup: discarding lookahead",
2355 /* Do not reclaim the symbols of the rule which action triggered
2356 this YYABORT or YYACCEPT. */
2358 YY_STACK_PRINT (yyss
, yyssp
);
2359 while (yyssp
!= yyss
)
2361 yydestruct ("Cleanup: popping",
2362 yystos
[*yyssp
], yyvsp
);
2367 YYSTACK_FREE (yyss
);
2370 if (yymsg
!= yymsgbuf
)
2371 YYSTACK_FREE (yymsg
);
2373 /* Make sure YYID is used. */
2374 return YYID (yyresult
);
2378 #line 281 "grammar.y"