add initial support for the crisarchitecture used on foxboards to openwrt
[openwrt.git] / target / linux / etrax-2.6 / image / e100boot / src / libpcap-0.4 / grammar.c
1 /* A Bison parser, made by GNU Bison 2.3.  */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6    Free Software Foundation, Inc.
7
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)
11    any later version.
12
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.
17
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.  */
22
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.
32
33    This special exception was added by the Free Software Foundation in
34    version 2.2 of Bison.  */
35
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37    simplifying the original so-called "semantic" parser.  */
38
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.  */
45
46 /* Identify Bison output.  */
47 #define YYBISON 1
48
49 /* Bison version.  */
50 #define YYBISON_VERSION "2.3"
51
52 /* Skeleton name.  */
53 #define YYSKELETON_NAME "yacc.c"
54
55 /* Pure parsers.  */
56 #define YYPURE 0
57
58 /* Using locations.  */
59 #define YYLSP_NEEDED 0
60
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
69
70
71 /* Tokens.  */
72 #ifndef YYTOKENTYPE
73 # define YYTOKENTYPE
74    /* Put the tokens into the symbol table, so that GDB and other debuggers
75       know about them.  */
76    enum yytokentype {
77      DST = 258,
78      SRC = 259,
79      HOST = 260,
80      GATEWAY = 261,
81      NET = 262,
82      MASK = 263,
83      PORT = 264,
84      LESS = 265,
85      GREATER = 266,
86      PROTO = 267,
87      BYTE = 268,
88      ARP = 269,
89      RARP = 270,
90      IP = 271,
91      TCP = 272,
92      UDP = 273,
93      ICMP = 274,
94      IGMP = 275,
95      IGRP = 276,
96      ATALK = 277,
97      DECNET = 278,
98      LAT = 279,
99      SCA = 280,
100      MOPRC = 281,
101      MOPDL = 282,
102      TK_BROADCAST = 283,
103      TK_MULTICAST = 284,
104      NUM = 285,
105      INBOUND = 286,
106      OUTBOUND = 287,
107      LINK = 288,
108      GEQ = 289,
109      LEQ = 290,
110      NEQ = 291,
111      ID = 292,
112      EID = 293,
113      HID = 294,
114      LSH = 295,
115      RSH = 296,
116      LEN = 297,
117      AND = 298,
118      OR = 299,
119      UMINUS = 300
120    };
121 #endif
122 /* Tokens.  */
123 #define DST 258
124 #define SRC 259
125 #define HOST 260
126 #define GATEWAY 261
127 #define NET 262
128 #define MASK 263
129 #define PORT 264
130 #define LESS 265
131 #define GREATER 266
132 #define PROTO 267
133 #define BYTE 268
134 #define ARP 269
135 #define RARP 270
136 #define IP 271
137 #define TCP 272
138 #define UDP 273
139 #define ICMP 274
140 #define IGMP 275
141 #define IGRP 276
142 #define ATALK 277
143 #define DECNET 278
144 #define LAT 279
145 #define SCA 280
146 #define MOPRC 281
147 #define MOPDL 282
148 #define TK_BROADCAST 283
149 #define TK_MULTICAST 284
150 #define NUM 285
151 #define INBOUND 286
152 #define OUTBOUND 287
153 #define LINK 288
154 #define GEQ 289
155 #define LEQ 290
156 #define NEQ 291
157 #define ID 292
158 #define EID 293
159 #define HID 294
160 #define LSH 295
161 #define RSH 296
162 #define LEN 297
163 #define AND 298
164 #define OR 299
165 #define UMINUS 300
166
167
168
169
170 /* Copy the first part of user declarations.  */
171 #line 1 "grammar.y"
172
173 /*
174  * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
175  *      The Regents of the University of California.  All rights reserved.
176  *
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.
192  *
193  */
194 #ifndef lint
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)";
197 #endif
198
199 #include <sys/types.h>
200 #include <sys/time.h>
201 #include <sys/socket.h>
202
203 #if __STDC__
204 struct mbuf;
205 struct rtentry;
206 #endif
207
208 #include <net/if.h>
209
210 #include <netinet/in.h>
211 #include <netinet/if_ether.h>
212
213 #include <stdio.h>
214
215 #include "pcap-int.h"
216
217 #include "gencode.h"
218 #include <pcap-namedb.h>
219
220 #include "gnuc.h"
221 #ifdef HAVE_OS_PROTO_H
222 #include "os-proto.h"
223 #endif
224
225 #define QSET(q, p, d, a) (q).proto = (p),\
226                          (q).dir = (d),\
227                          (q).addr = (a)
228
229 int n_errors = 0;
230
231 static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };
232
233 static void
234 yyerror(char *msg)
235 {
236         ++n_errors;
237         bpf_error("%s", msg);
238         /* NOTREACHED */
239 }
240
241 #ifndef YYBISON
242 int yyparse(void);
243
244 int
245 pcap_parse()
246 {
247         return (yyparse());
248 }
249 #endif
250
251
252
253 /* Enabling traces.  */
254 #ifndef YYDEBUG
255 # define YYDEBUG 0
256 #endif
257
258 /* Enabling verbose error messages.  */
259 #ifdef YYERROR_VERBOSE
260 # undef YYERROR_VERBOSE
261 # define YYERROR_VERBOSE 1
262 #else
263 # define YYERROR_VERBOSE 0
264 #endif
265
266 /* Enabling the token table.  */
267 #ifndef YYTOKEN_TABLE
268 # define YYTOKEN_TABLE 0
269 #endif
270
271 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
272 typedef union YYSTYPE
273 #line 82 "grammar.y"
274 {
275         int i;
276         bpf_u_int32 h;
277         u_char *e;
278         char *s;
279         struct stmt *stmt;
280         struct arth *a;
281         struct {
282                 struct qual q;
283                 struct block *b;
284         } blk;
285         struct block *rblk;
286 }
287 /* Line 187 of yacc.c.  */
288 #line 289 "y.tab.c"
289         YYSTYPE;
290 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
291 # define YYSTYPE_IS_DECLARED 1
292 # define YYSTYPE_IS_TRIVIAL 1
293 #endif
294
295
296
297 /* Copy the second part of user declarations.  */
298
299
300 /* Line 216 of yacc.c.  */
301 #line 302 "y.tab.c"
302
303 #ifdef short
304 # undef short
305 #endif
306
307 #ifdef YYTYPE_UINT8
308 typedef YYTYPE_UINT8 yytype_uint8;
309 #else
310 typedef unsigned char yytype_uint8;
311 #endif
312
313 #ifdef YYTYPE_INT8
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;
318 #else
319 typedef short int yytype_int8;
320 #endif
321
322 #ifdef YYTYPE_UINT16
323 typedef YYTYPE_UINT16 yytype_uint16;
324 #else
325 typedef unsigned short int yytype_uint16;
326 #endif
327
328 #ifdef YYTYPE_INT16
329 typedef YYTYPE_INT16 yytype_int16;
330 #else
331 typedef short int yytype_int16;
332 #endif
333
334 #ifndef YYSIZE_T
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
343 # else
344 #  define YYSIZE_T unsigned int
345 # endif
346 #endif
347
348 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
349
350 #ifndef YY_
351 # if YYENABLE_NLS
352 #  if ENABLE_NLS
353 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
354 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
355 #  endif
356 # endif
357 # ifndef YY_
358 #  define YY_(msgid) msgid
359 # endif
360 #endif
361
362 /* Suppress unused-variable warnings by "using" E.  */
363 #if ! defined lint || defined __GNUC__
364 # define YYUSE(e) ((void) (e))
365 #else
366 # define YYUSE(e) /* empty */
367 #endif
368
369 /* Identity function, used to suppress warnings about constant conditions.  */
370 #ifndef lint
371 # define YYID(n) (n)
372 #else
373 #if (defined __STDC__ || defined __C99__FUNC__ \
374      || defined __cplusplus || defined _MSC_VER)
375 static int
376 YYID (int i)
377 #else
378 static int
379 YYID (i)
380     int i;
381 #endif
382 {
383   return i;
384 }
385 #endif
386
387 #if ! defined yyoverflow || YYERROR_VERBOSE
388
389 /* The parser invokes alloca or malloc; define the necessary symbols.  */
390
391 # ifdef YYSTACK_USE_ALLOCA
392 #  if YYSTACK_USE_ALLOCA
393 #   ifdef __GNUC__
394 #    define YYSTACK_ALLOC __builtin_alloca
395 #   elif defined __BUILTIN_VA_ARG_INCR
396 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
397 #   elif defined _AIX
398 #    define YYSTACK_ALLOC __alloca
399 #   elif defined _MSC_VER
400 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
401 #    define alloca _alloca
402 #   else
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 */
407 #     ifndef _STDLIB_H
408 #      define _STDLIB_H 1
409 #     endif
410 #    endif
411 #   endif
412 #  endif
413 # endif
414
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 */
424 #  endif
425 # else
426 #  define YYSTACK_ALLOC YYMALLOC
427 #  define YYSTACK_FREE YYFREE
428 #  ifndef YYSTACK_ALLOC_MAXIMUM
429 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
430 #  endif
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 */
435 #   ifndef _STDLIB_H
436 #    define _STDLIB_H 1
437 #   endif
438 #  endif
439 #  ifndef YYMALLOC
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 */
444 #   endif
445 #  endif
446 #  ifndef YYFREE
447 #   define YYFREE free
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 */
451 #   endif
452 #  endif
453 # endif
454 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
455
456
457 #if (! defined yyoverflow \
458      && (! defined __cplusplus \
459          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
460
461 /* A type that is properly aligned for any stack member.  */
462 union yyalloc
463 {
464   yytype_int16 yyss;
465   YYSTYPE yyvs;
466   };
467
468 /* The size of the maximum gap between one aligned stack and the next.  */
469 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
470
471 /* The size of an array large to enough to hold all stacks, each with
472    N elements.  */
473 # define YYSTACK_BYTES(N) \
474      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
475       + YYSTACK_GAP_MAXIMUM)
476
477 /* Copy COUNT objects from FROM to TO.  The source and destination do
478    not overlap.  */
479 # ifndef YYCOPY
480 #  if defined __GNUC__ && 1 < __GNUC__
481 #   define YYCOPY(To, From, Count) \
482       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
483 #  else
484 #   define YYCOPY(To, From, Count)              \
485       do                                        \
486         {                                       \
487           YYSIZE_T yyi;                         \
488           for (yyi = 0; yyi < (Count); yyi++)   \
489             (To)[yyi] = (From)[yyi];            \
490         }                                       \
491       while (YYID (0))
492 #  endif
493 # endif
494
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
499    stack.  */
500 # define YYSTACK_RELOCATE(Stack)                                        \
501     do                                                                  \
502       {                                                                 \
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);                          \
508       }                                                                 \
509     while (YYID (0))
510
511 #endif
512
513 /* YYFINAL -- State number of the termination state.  */
514 #define YYFINAL  3
515 /* YYLAST -- Last index in YYTABLE.  */
516 #define YYLAST   345
517
518 /* YYNTOKENS -- Number of terminals.  */
519 #define YYNTOKENS  61
520 /* YYNNTS -- Number of nonterminals.  */
521 #define YYNNTS  27
522 /* YYNRULES -- Number of rules.  */
523 #define YYNRULES  102
524 /* YYNRULES -- Number of states.  */
525 #define YYNSTATES  151
526
527 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
528 #define YYUNDEFTOK  2
529 #define YYMAXUTOK   300
530
531 #define YYTRANSLATE(YYX)                                                \
532   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
533
534 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
535 static const yytype_uint8 yytranslate[] =
536 {
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,
567       52
568 };
569
570 #if YYDEBUG
571 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
572    YYRHS.  */
573 static const yytype_uint16 yyprhs[] =
574 {
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,
585      273,   275,   277
586 };
587
588 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
589 static const yytype_int8 yyrhs[] =
590 {
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,
619       -1
620 };
621
622 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
623 static const yytype_uint16 yyrline[] =
624 {
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,
635      276,   278,   279
636 };
637 #endif
638
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[] =
643 {
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",
654   "byteop", "pnum", 0
655 };
656 #endif
657
658 # ifdef YYPRINT
659 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
660    token YYLEX-NUM.  */
661 static const yytype_uint16 yytoknum[] =
662 {
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,
669       58
670 };
671 # endif
672
673 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
674 static const yytype_uint8 yyr1[] =
675 {
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,
686       86,    87,    87
687 };
688
689 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
690 static const yytype_uint8 yyr2[] =
691 {
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,
702        1,     1,     3
703 };
704
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[] =
709 {
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,
725       84
726 };
727
728 /* YYDEFGOTO[NTERM-NUM].  */
729 static const yytype_int8 yydefgoto[] =
730 {
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
734 };
735
736 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
737    STATE-NUM.  */
738 #define YYPACT_NINF -53
739 static const yytype_int16 yypact[] =
740 {
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,
756      -53
757 };
758
759 /* YYPGOTO[NTERM-NUM].  */
760 static const yytype_int8 yypgoto[] =
761 {
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
765 };
766
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[] =
773 {
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,
808        0,     0,     0,    94,    95,    96
809 };
810
811 static const yytype_int16 yycheck[] =
812 {
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
848 };
849
850 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
851    symbol of state STATE-NUM.  */
852 static const yytype_uint8 yystos[] =
853 {
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,
869       59
870 };
871
872 #define yyerrok         (yyerrstatus = 0)
873 #define yyclearin       (yychar = YYEMPTY)
874 #define YYEMPTY         (-2)
875 #define YYEOF           0
876
877 #define YYACCEPT        goto yyacceptlab
878 #define YYABORT         goto yyabortlab
879 #define YYERROR         goto yyerrorlab
880
881
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.  */
885
886 #define YYFAIL          goto yyerrlab
887
888 #define YYRECOVERING()  (!!yyerrstatus)
889
890 #define YYBACKUP(Token, Value)                                  \
891 do                                                              \
892   if (yychar == YYEMPTY && yylen == 1)                          \
893     {                                                           \
894       yychar = (Token);                                         \
895       yylval = (Value);                                         \
896       yytoken = YYTRANSLATE (yychar);                           \
897       YYPOPSTACK (1);                                           \
898       goto yybackup;                                            \
899     }                                                           \
900   else                                                          \
901     {                                                           \
902       yyerror (YY_("syntax error: cannot back up")); \
903       YYERROR;                                                  \
904     }                                                           \
905 while (YYID (0))
906
907
908 #define YYTERROR        1
909 #define YYERRCODE       256
910
911
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).  */
915
916 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
917 #ifndef YYLLOC_DEFAULT
918 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
919     do                                                                  \
920       if (YYID (N))                                                    \
921         {                                                               \
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;       \
926         }                                                               \
927       else                                                              \
928         {                                                               \
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;                              \
933         }                                                               \
934     while (YYID (0))
935 #endif
936
937
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.  */
941
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)
948 # else
949 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
950 # endif
951 #endif
952
953
954 /* YYLEX -- calling `yylex' with the right arguments.  */
955
956 #ifdef YYLEX_PARAM
957 # define YYLEX yylex (YYLEX_PARAM)
958 #else
959 # define YYLEX yylex ()
960 #endif
961
962 /* Enable debugging if requested.  */
963 #if YYDEBUG
964
965 # ifndef YYFPRINTF
966 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
967 #  define YYFPRINTF fprintf
968 # endif
969
970 # define YYDPRINTF(Args)                        \
971 do {                                            \
972   if (yydebug)                                  \
973     YYFPRINTF Args;                             \
974 } while (YYID (0))
975
976 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
977 do {                                                                      \
978   if (yydebug)                                                            \
979     {                                                                     \
980       YYFPRINTF (stderr, "%s ", Title);                                   \
981       yy_symbol_print (stderr,                                            \
982                   Type, Value); \
983       YYFPRINTF (stderr, "\n");                                           \
984     }                                                                     \
985 } while (YYID (0))
986
987
988 /*--------------------------------.
989 | Print this symbol on YYOUTPUT.  |
990 `--------------------------------*/
991
992 /*ARGSUSED*/
993 #if (defined __STDC__ || defined __C99__FUNC__ \
994      || defined __cplusplus || defined _MSC_VER)
995 static void
996 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
997 #else
998 static void
999 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1000     FILE *yyoutput;
1001     int yytype;
1002     YYSTYPE const * const yyvaluep;
1003 #endif
1004 {
1005   if (!yyvaluep)
1006     return;
1007 # ifdef YYPRINT
1008   if (yytype < YYNTOKENS)
1009     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1010 # else
1011   YYUSE (yyoutput);
1012 # endif
1013   switch (yytype)
1014     {
1015       default:
1016         break;
1017     }
1018 }
1019
1020
1021 /*--------------------------------.
1022 | Print this symbol on YYOUTPUT.  |
1023 `--------------------------------*/
1024
1025 #if (defined __STDC__ || defined __C99__FUNC__ \
1026      || defined __cplusplus || defined _MSC_VER)
1027 static void
1028 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1029 #else
1030 static void
1031 yy_symbol_print (yyoutput, yytype, yyvaluep)
1032     FILE *yyoutput;
1033     int yytype;
1034     YYSTYPE const * const yyvaluep;
1035 #endif
1036 {
1037   if (yytype < YYNTOKENS)
1038     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1039   else
1040     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1041
1042   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1043   YYFPRINTF (yyoutput, ")");
1044 }
1045
1046 /*------------------------------------------------------------------.
1047 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1048 | TOP (included).                                                   |
1049 `------------------------------------------------------------------*/
1050
1051 #if (defined __STDC__ || defined __C99__FUNC__ \
1052      || defined __cplusplus || defined _MSC_VER)
1053 static void
1054 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1055 #else
1056 static void
1057 yy_stack_print (bottom, top)
1058     yytype_int16 *bottom;
1059     yytype_int16 *top;
1060 #endif
1061 {
1062   YYFPRINTF (stderr, "Stack now");
1063   for (; bottom <= top; ++bottom)
1064     YYFPRINTF (stderr, " %d", *bottom);
1065   YYFPRINTF (stderr, "\n");
1066 }
1067
1068 # define YY_STACK_PRINT(Bottom, Top)                            \
1069 do {                                                            \
1070   if (yydebug)                                                  \
1071     yy_stack_print ((Bottom), (Top));                           \
1072 } while (YYID (0))
1073
1074
1075 /*------------------------------------------------.
1076 | Report that the YYRULE is going to be reduced.  |
1077 `------------------------------------------------*/
1078
1079 #if (defined __STDC__ || defined __C99__FUNC__ \
1080      || defined __cplusplus || defined _MSC_VER)
1081 static void
1082 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1083 #else
1084 static void
1085 yy_reduce_print (yyvsp, yyrule)
1086     YYSTYPE *yyvsp;
1087     int yyrule;
1088 #endif
1089 {
1090   int yynrhs = yyr2[yyrule];
1091   int yyi;
1092   unsigned long int yylno = yyrline[yyrule];
1093   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1094              yyrule - 1, yylno);
1095   /* The symbols being reduced.  */
1096   for (yyi = 0; yyi < yynrhs; yyi++)
1097     {
1098       fprintf (stderr, "   $%d = ", yyi + 1);
1099       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1100                        &(yyvsp[(yyi + 1) - (yynrhs)])
1101                                        );
1102       fprintf (stderr, "\n");
1103     }
1104 }
1105
1106 # define YY_REDUCE_PRINT(Rule)          \
1107 do {                                    \
1108   if (yydebug)                          \
1109     yy_reduce_print (yyvsp, Rule); \
1110 } while (YYID (0))
1111
1112 /* Nonzero means print parse trace.  It is left uninitialized so that
1113    multiple parsers can coexist.  */
1114 int yydebug;
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 */
1121
1122
1123 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1124 #ifndef YYINITDEPTH
1125 # define YYINITDEPTH 200
1126 #endif
1127
1128 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1129    if the built-in stack extension method is used).
1130
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.  */
1134
1135 #ifndef YYMAXDEPTH
1136 # define YYMAXDEPTH 10000
1137 #endif
1138
1139 \f
1140
1141 #if YYERROR_VERBOSE
1142
1143 # ifndef yystrlen
1144 #  if defined __GLIBC__ && defined _STRING_H
1145 #   define yystrlen strlen
1146 #  else
1147 /* Return the length of YYSTR.  */
1148 #if (defined __STDC__ || defined __C99__FUNC__ \
1149      || defined __cplusplus || defined _MSC_VER)
1150 static YYSIZE_T
1151 yystrlen (const char *yystr)
1152 #else
1153 static YYSIZE_T
1154 yystrlen (yystr)
1155     const char *yystr;
1156 #endif
1157 {
1158   YYSIZE_T yylen;
1159   for (yylen = 0; yystr[yylen]; yylen++)
1160     continue;
1161   return yylen;
1162 }
1163 #  endif
1164 # endif
1165
1166 # ifndef yystpcpy
1167 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1168 #   define yystpcpy stpcpy
1169 #  else
1170 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1171    YYDEST.  */
1172 #if (defined __STDC__ || defined __C99__FUNC__ \
1173      || defined __cplusplus || defined _MSC_VER)
1174 static char *
1175 yystpcpy (char *yydest, const char *yysrc)
1176 #else
1177 static char *
1178 yystpcpy (yydest, yysrc)
1179     char *yydest;
1180     const char *yysrc;
1181 #endif
1182 {
1183   char *yyd = yydest;
1184   const char *yys = yysrc;
1185
1186   while ((*yyd++ = *yys++) != '\0')
1187     continue;
1188
1189   return yyd - 1;
1190 }
1191 #  endif
1192 # endif
1193
1194 # ifndef yytnamerr
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
1201    would have been.  */
1202 static YYSIZE_T
1203 yytnamerr (char *yyres, const char *yystr)
1204 {
1205   if (*yystr == '"')
1206     {
1207       YYSIZE_T yyn = 0;
1208       char const *yyp = yystr;
1209
1210       for (;;)
1211         switch (*++yyp)
1212           {
1213           case '\'':
1214           case ',':
1215             goto do_not_strip_quotes;
1216
1217           case '\\':
1218             if (*++yyp != '\\')
1219               goto do_not_strip_quotes;
1220             /* Fall through.  */
1221           default:
1222             if (yyres)
1223               yyres[yyn] = *yyp;
1224             yyn++;
1225             break;
1226
1227           case '"':
1228             if (yyres)
1229               yyres[yyn] = '\0';
1230             return yyn;
1231           }
1232     do_not_strip_quotes: ;
1233     }
1234
1235   if (! yyres)
1236     return yystrlen (yystr);
1237
1238   return yystpcpy (yyres, yystr) - yyres;
1239 }
1240 # endif
1241
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.  */
1249 static YYSIZE_T
1250 yysyntax_error (char *yyresult, int yystate, int yychar)
1251 {
1252   int yyn = yypact[yystate];
1253
1254   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1255     return 0;
1256   else
1257     {
1258       int yytype = YYTRANSLATE (yychar);
1259       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1260       YYSIZE_T yysize = yysize0;
1261       YYSIZE_T yysize1;
1262       int yysize_overflow = 0;
1263       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1264       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1265       int yyx;
1266
1267 # if 0
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");
1275 # endif
1276       char *yyfmt;
1277       char const *yyf;
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;
1286
1287       /* Start YYX at -YYN if negative to avoid negative indexes in
1288          YYCHECK.  */
1289       int yyxbegin = yyn < 0 ? -yyn : 0;
1290
1291       /* Stay within bounds of both yycheck and yytname.  */
1292       int yychecklim = YYLAST - yyn + 1;
1293       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1294       int yycount = 1;
1295
1296       yyarg[0] = yytname[yytype];
1297       yyfmt = yystpcpy (yyformat, yyunexpected);
1298
1299       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1300         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1301           {
1302             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1303               {
1304                 yycount = 1;
1305                 yysize = yysize0;
1306                 yyformat[sizeof yyunexpected - 1] = '\0';
1307                 break;
1308               }
1309             yyarg[yycount++] = yytname[yyx];
1310             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1311             yysize_overflow |= (yysize1 < yysize);
1312             yysize = yysize1;
1313             yyfmt = yystpcpy (yyfmt, yyprefix);
1314             yyprefix = yyor;
1315           }
1316
1317       yyf = YY_(yyformat);
1318       yysize1 = yysize + yystrlen (yyf);
1319       yysize_overflow |= (yysize1 < yysize);
1320       yysize = yysize1;
1321
1322       if (yysize_overflow)
1323         return YYSIZE_MAXIMUM;
1324
1325       if (yyresult)
1326         {
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;
1331           int yyi = 0;
1332           while ((*yyp = *yyf) != '\0')
1333             {
1334               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1335                 {
1336                   yyp += yytnamerr (yyp, yyarg[yyi++]);
1337                   yyf += 2;
1338                 }
1339               else
1340                 {
1341                   yyp++;
1342                   yyf++;
1343                 }
1344             }
1345         }
1346       return yysize;
1347     }
1348 }
1349 #endif /* YYERROR_VERBOSE */
1350 \f
1351
1352 /*-----------------------------------------------.
1353 | Release the memory associated to this symbol.  |
1354 `-----------------------------------------------*/
1355
1356 /*ARGSUSED*/
1357 #if (defined __STDC__ || defined __C99__FUNC__ \
1358      || defined __cplusplus || defined _MSC_VER)
1359 static void
1360 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1361 #else
1362 static void
1363 yydestruct (yymsg, yytype, yyvaluep)
1364     const char *yymsg;
1365     int yytype;
1366     YYSTYPE *yyvaluep;
1367 #endif
1368 {
1369   YYUSE (yyvaluep);
1370
1371   if (!yymsg)
1372     yymsg = "Deleting";
1373   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1374
1375   switch (yytype)
1376     {
1377
1378       default:
1379         break;
1380     }
1381 }
1382 \f
1383
1384 /* Prevent warnings from -Wmissing-prototypes.  */
1385
1386 #ifdef YYPARSE_PARAM
1387 #if defined __STDC__ || defined __cplusplus
1388 int yyparse (void *YYPARSE_PARAM);
1389 #else
1390 int yyparse ();
1391 #endif
1392 #else /* ! YYPARSE_PARAM */
1393 #if defined __STDC__ || defined __cplusplus
1394 int yyparse (void);
1395 #else
1396 int yyparse ();
1397 #endif
1398 #endif /* ! YYPARSE_PARAM */
1399
1400
1401
1402 /* The look-ahead symbol.  */
1403 int yychar;
1404
1405 /* The semantic value of the look-ahead symbol.  */
1406 YYSTYPE yylval;
1407
1408 /* Number of syntax errors so far.  */
1409 int yynerrs;
1410
1411
1412
1413 /*----------.
1414 | yyparse.  |
1415 `----------*/
1416
1417 #ifdef YYPARSE_PARAM
1418 #if (defined __STDC__ || defined __C99__FUNC__ \
1419      || defined __cplusplus || defined _MSC_VER)
1420 int
1421 yyparse (void *YYPARSE_PARAM)
1422 #else
1423 int
1424 yyparse (YYPARSE_PARAM)
1425     void *YYPARSE_PARAM;
1426 #endif
1427 #else /* ! YYPARSE_PARAM */
1428 #if (defined __STDC__ || defined __C99__FUNC__ \
1429      || defined __cplusplus || defined _MSC_VER)
1430 int
1431 yyparse (void)
1432 #else
1433 int
1434 yyparse ()
1435
1436 #endif
1437 #endif
1438 {
1439   
1440   int yystate;
1441   int yyn;
1442   int yyresult;
1443   /* Number of tokens to shift before error messages enabled.  */
1444   int yyerrstatus;
1445   /* Look-ahead token as an internal (translated) token number.  */
1446   int yytoken = 0;
1447 #if YYERROR_VERBOSE
1448   /* Buffer for error messages, and its allocated size.  */
1449   char yymsgbuf[128];
1450   char *yymsg = yymsgbuf;
1451   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1452 #endif
1453
1454   /* Three stacks and their tools:
1455      `yyss': related to states,
1456      `yyvs': related to semantic values,
1457      `yyls': related to locations.
1458
1459      Refer to the stacks thru separate pointers, to allow yyoverflow
1460      to reallocate them elsewhere.  */
1461
1462   /* The state stack.  */
1463   yytype_int16 yyssa[YYINITDEPTH];
1464   yytype_int16 *yyss = yyssa;
1465   yytype_int16 *yyssp;
1466
1467   /* The semantic value stack.  */
1468   YYSTYPE yyvsa[YYINITDEPTH];
1469   YYSTYPE *yyvs = yyvsa;
1470   YYSTYPE *yyvsp;
1471
1472
1473
1474 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1475
1476   YYSIZE_T yystacksize = YYINITDEPTH;
1477
1478   /* The variables used to return semantic value and location from the
1479      action routines.  */
1480   YYSTYPE yyval;
1481
1482
1483   /* The number of symbols on the RHS of the reduced rule.
1484      Keep to zero when no symbol should be popped.  */
1485   int yylen = 0;
1486
1487   YYDPRINTF ((stderr, "Starting parse\n"));
1488
1489   yystate = 0;
1490   yyerrstatus = 0;
1491   yynerrs = 0;
1492   yychar = YYEMPTY;             /* Cause a token to be read.  */
1493
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.  */
1498
1499   yyssp = yyss;
1500   yyvsp = yyvs;
1501
1502   goto yysetstate;
1503
1504 /*------------------------------------------------------------.
1505 | yynewstate -- Push a new state, which is found in yystate.  |
1506 `------------------------------------------------------------*/
1507  yynewstate:
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.  */
1510   yyssp++;
1511
1512  yysetstate:
1513   *yyssp = yystate;
1514
1515   if (yyss + yystacksize - 1 <= yyssp)
1516     {
1517       /* Get the current used size of the three stacks, in elements.  */
1518       YYSIZE_T yysize = yyssp - yyss + 1;
1519
1520 #ifdef yyoverflow
1521       {
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
1524            memory.  */
1525         YYSTYPE *yyvs1 = yyvs;
1526         yytype_int16 *yyss1 = yyss;
1527
1528
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),
1536
1537                     &yystacksize);
1538
1539         yyss = yyss1;
1540         yyvs = yyvs1;
1541       }
1542 #else /* no yyoverflow */
1543 # ifndef YYSTACK_RELOCATE
1544       goto yyexhaustedlab;
1545 # else
1546       /* Extend the stack our own way.  */
1547       if (YYMAXDEPTH <= yystacksize)
1548         goto yyexhaustedlab;
1549       yystacksize *= 2;
1550       if (YYMAXDEPTH < yystacksize)
1551         yystacksize = YYMAXDEPTH;
1552
1553       {
1554         yytype_int16 *yyss1 = yyss;
1555         union yyalloc *yyptr =
1556           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1557         if (! yyptr)
1558           goto yyexhaustedlab;
1559         YYSTACK_RELOCATE (yyss);
1560         YYSTACK_RELOCATE (yyvs);
1561
1562 #  undef YYSTACK_RELOCATE
1563         if (yyss1 != yyssa)
1564           YYSTACK_FREE (yyss1);
1565       }
1566 # endif
1567 #endif /* no yyoverflow */
1568
1569       yyssp = yyss + yysize - 1;
1570       yyvsp = yyvs + yysize - 1;
1571
1572
1573       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1574                   (unsigned long int) yystacksize));
1575
1576       if (yyss + yystacksize - 1 <= yyssp)
1577         YYABORT;
1578     }
1579
1580   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1581
1582   goto yybackup;
1583
1584 /*-----------.
1585 | yybackup.  |
1586 `-----------*/
1587 yybackup:
1588
1589   /* Do appropriate processing given the current state.  Read a
1590      look-ahead token if we need one and don't already have one.  */
1591
1592   /* First try to decide what to do without reference to look-ahead token.  */
1593   yyn = yypact[yystate];
1594   if (yyn == YYPACT_NINF)
1595     goto yydefault;
1596
1597   /* Not known => get a look-ahead token if don't already have one.  */
1598
1599   /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1600   if (yychar == YYEMPTY)
1601     {
1602       YYDPRINTF ((stderr, "Reading a token: "));
1603       yychar = YYLEX;
1604     }
1605
1606   if (yychar <= YYEOF)
1607     {
1608       yychar = yytoken = YYEOF;
1609       YYDPRINTF ((stderr, "Now at end of input.\n"));
1610     }
1611   else
1612     {
1613       yytoken = YYTRANSLATE (yychar);
1614       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1615     }
1616
1617   /* If the proper action on seeing token YYTOKEN is to reduce or to
1618      detect an error, take that action.  */
1619   yyn += yytoken;
1620   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1621     goto yydefault;
1622   yyn = yytable[yyn];
1623   if (yyn <= 0)
1624     {
1625       if (yyn == 0 || yyn == YYTABLE_NINF)
1626         goto yyerrlab;
1627       yyn = -yyn;
1628       goto yyreduce;
1629     }
1630
1631   if (yyn == YYFINAL)
1632     YYACCEPT;
1633
1634   /* Count tokens shifted since error; after three, turn off error
1635      status.  */
1636   if (yyerrstatus)
1637     yyerrstatus--;
1638
1639   /* Shift the look-ahead token.  */
1640   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1641
1642   /* Discard the shifted token unless it is eof.  */
1643   if (yychar != YYEOF)
1644     yychar = YYEMPTY;
1645
1646   yystate = yyn;
1647   *++yyvsp = yylval;
1648
1649   goto yynewstate;
1650
1651
1652 /*-----------------------------------------------------------.
1653 | yydefault -- do the default action for the current state.  |
1654 `-----------------------------------------------------------*/
1655 yydefault:
1656   yyn = yydefact[yystate];
1657   if (yyn == 0)
1658     goto yyerrlab;
1659   goto yyreduce;
1660
1661
1662 /*-----------------------------.
1663 | yyreduce -- Do a reduction.  |
1664 `-----------------------------*/
1665 yyreduce:
1666   /* yyn is the number of a rule to reduce with.  */
1667   yylen = yyr2[yyn];
1668
1669   /* If YYLEN is nonzero, implement the default value of the action:
1670      `$$ = $1'.
1671
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];
1678
1679
1680   YY_REDUCE_PRINT (yyn);
1681   switch (yyn)
1682     {
1683         case 2:
1684 #line 131 "grammar.y"
1685     {
1686         finish_parse((yyvsp[(2) - (2)].blk).b);
1687 }
1688     break;
1689
1690   case 4:
1691 #line 136 "grammar.y"
1692     { (yyval.blk).q = qerr; }
1693     break;
1694
1695   case 6:
1696 #line 139 "grammar.y"
1697     { gen_and((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1698     break;
1699
1700   case 7:
1701 #line 140 "grammar.y"
1702     { gen_and((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1703     break;
1704
1705   case 8:
1706 #line 141 "grammar.y"
1707     { gen_or((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1708     break;
1709
1710   case 9:
1711 #line 142 "grammar.y"
1712     { gen_or((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1713     break;
1714
1715   case 10:
1716 #line 144 "grammar.y"
1717     { (yyval.blk) = (yyvsp[(0) - (1)].blk); }
1718     break;
1719
1720   case 11:
1721 #line 146 "grammar.y"
1722     { (yyval.blk) = (yyvsp[(0) - (1)].blk); }
1723     break;
1724
1725   case 13:
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); }
1729     break;
1730
1731   case 14:
1732 #line 151 "grammar.y"
1733     { (yyval.blk) = (yyvsp[(2) - (3)].blk); }
1734     break;
1735
1736   case 15:
1737 #line 153 "grammar.y"
1738     { (yyval.blk).b = gen_scode((yyvsp[(1) - (1)].s), (yyval.blk).q = (yyvsp[(0) - (1)].blk).q); }
1739     break;
1740
1741   case 16:
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); }
1745     break;
1746
1747   case 17:
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); }
1751     break;
1752
1753   case 18:
1754 #line 158 "grammar.y"
1755     {
1756                                   /* Decide how to parse HID based on proto */
1757                                   (yyval.blk).q = (yyvsp[(0) - (1)].blk).q;
1758                                   switch ((yyval.blk).q.proto) {
1759                                   case Q_DECNET:
1760                                         (yyval.blk).b = gen_ncode((yyvsp[(1) - (1)].s), 0, (yyval.blk).q);
1761                                         break;
1762                                   default:
1763                                         (yyval.blk).b = gen_ncode((yyvsp[(1) - (1)].s), 0, (yyval.blk).q);
1764                                         break;
1765                                   }
1766                                 }
1767     break;
1768
1769   case 19:
1770 #line 170 "grammar.y"
1771     { (yyval.blk).b = gen_ecode((yyvsp[(1) - (1)].e), (yyval.blk).q = (yyvsp[(0) - (1)].blk).q); }
1772     break;
1773
1774   case 20:
1775 #line 171 "grammar.y"
1776     { gen_not((yyvsp[(2) - (2)].blk).b); (yyval.blk) = (yyvsp[(2) - (2)].blk); }
1777     break;
1778
1779   case 21:
1780 #line 173 "grammar.y"
1781     { (yyval.blk) = (yyvsp[(0) - (1)].blk); }
1782     break;
1783
1784   case 22:
1785 #line 175 "grammar.y"
1786     { (yyval.blk) = (yyvsp[(0) - (1)].blk); }
1787     break;
1788
1789   case 24:
1790 #line 178 "grammar.y"
1791     { gen_and((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1792     break;
1793
1794   case 25:
1795 #line 179 "grammar.y"
1796     { gen_or((yyvsp[(1) - (3)].blk).b, (yyvsp[(3) - (3)].blk).b); (yyval.blk) = (yyvsp[(3) - (3)].blk); }
1797     break;
1798
1799   case 26:
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); }
1803     break;
1804
1805   case 29:
1806 #line 186 "grammar.y"
1807     { gen_not((yyvsp[(2) - (2)].blk).b); (yyval.blk) = (yyvsp[(2) - (2)].blk); }
1808     break;
1809
1810   case 30:
1811 #line 188 "grammar.y"
1812     { QSET((yyval.blk).q, (yyvsp[(1) - (3)].i), (yyvsp[(2) - (3)].i), (yyvsp[(3) - (3)].i)); }
1813     break;
1814
1815   case 31:
1816 #line 189 "grammar.y"
1817     { QSET((yyval.blk).q, (yyvsp[(1) - (2)].i), (yyvsp[(2) - (2)].i), Q_DEFAULT); }
1818     break;
1819
1820   case 32:
1821 #line 190 "grammar.y"
1822     { QSET((yyval.blk).q, (yyvsp[(1) - (2)].i), Q_DEFAULT, (yyvsp[(2) - (2)].i)); }
1823     break;
1824
1825   case 33:
1826 #line 191 "grammar.y"
1827     { QSET((yyval.blk).q, (yyvsp[(1) - (2)].i), Q_DEFAULT, Q_PROTO); }
1828     break;
1829
1830   case 34:
1831 #line 192 "grammar.y"
1832     { QSET((yyval.blk).q, (yyvsp[(1) - (2)].i), Q_DEFAULT, (yyvsp[(2) - (2)].i)); }
1833     break;
1834
1835   case 35:
1836 #line 194 "grammar.y"
1837     { (yyval.blk) = (yyvsp[(2) - (2)].blk); }
1838     break;
1839
1840   case 36:
1841 #line 195 "grammar.y"
1842     { (yyval.blk).b = (yyvsp[(2) - (3)].blk).b; (yyval.blk).q = (yyvsp[(1) - (3)].blk).q; }
1843     break;
1844
1845   case 37:
1846 #line 196 "grammar.y"
1847     { (yyval.blk).b = gen_proto_abbrev((yyvsp[(1) - (1)].i)); (yyval.blk).q = qerr; }
1848     break;
1849
1850   case 38:
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; }
1854     break;
1855
1856   case 39:
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; }
1860     break;
1861
1862   case 40:
1863 #line 201 "grammar.y"
1864     { (yyval.blk).b = (yyvsp[(1) - (1)].rblk); (yyval.blk).q = qerr; }
1865     break;
1866
1867   case 42:
1868 #line 205 "grammar.y"
1869     { (yyval.i) = Q_DEFAULT; }
1870     break;
1871
1872   case 43:
1873 #line 208 "grammar.y"
1874     { (yyval.i) = Q_SRC; }
1875     break;
1876
1877   case 44:
1878 #line 209 "grammar.y"
1879     { (yyval.i) = Q_DST; }
1880     break;
1881
1882   case 45:
1883 #line 210 "grammar.y"
1884     { (yyval.i) = Q_OR; }
1885     break;
1886
1887   case 46:
1888 #line 211 "grammar.y"
1889     { (yyval.i) = Q_OR; }
1890     break;
1891
1892   case 47:
1893 #line 212 "grammar.y"
1894     { (yyval.i) = Q_AND; }
1895     break;
1896
1897   case 48:
1898 #line 213 "grammar.y"
1899     { (yyval.i) = Q_AND; }
1900     break;
1901
1902   case 49:
1903 #line 216 "grammar.y"
1904     { (yyval.i) = Q_HOST; }
1905     break;
1906
1907   case 50:
1908 #line 217 "grammar.y"
1909     { (yyval.i) = Q_NET; }
1910     break;
1911
1912   case 51:
1913 #line 218 "grammar.y"
1914     { (yyval.i) = Q_PORT; }
1915     break;
1916
1917   case 52:
1918 #line 221 "grammar.y"
1919     { (yyval.i) = Q_GATEWAY; }
1920     break;
1921
1922   case 53:
1923 #line 223 "grammar.y"
1924     { (yyval.i) = Q_LINK; }
1925     break;
1926
1927   case 54:
1928 #line 224 "grammar.y"
1929     { (yyval.i) = Q_IP; }
1930     break;
1931
1932   case 55:
1933 #line 225 "grammar.y"
1934     { (yyval.i) = Q_ARP; }
1935     break;
1936
1937   case 56:
1938 #line 226 "grammar.y"
1939     { (yyval.i) = Q_RARP; }
1940     break;
1941
1942   case 57:
1943 #line 227 "grammar.y"
1944     { (yyval.i) = Q_TCP; }
1945     break;
1946
1947   case 58:
1948 #line 228 "grammar.y"
1949     { (yyval.i) = Q_UDP; }
1950     break;
1951
1952   case 59:
1953 #line 229 "grammar.y"
1954     { (yyval.i) = Q_ICMP; }
1955     break;
1956
1957   case 60:
1958 #line 230 "grammar.y"
1959     { (yyval.i) = Q_IGMP; }
1960     break;
1961
1962   case 61:
1963 #line 231 "grammar.y"
1964     { (yyval.i) = Q_IGRP; }
1965     break;
1966
1967   case 62:
1968 #line 232 "grammar.y"
1969     { (yyval.i) = Q_ATALK; }
1970     break;
1971
1972   case 63:
1973 #line 233 "grammar.y"
1974     { (yyval.i) = Q_DECNET; }
1975     break;
1976
1977   case 64:
1978 #line 234 "grammar.y"
1979     { (yyval.i) = Q_LAT; }
1980     break;
1981
1982   case 65:
1983 #line 235 "grammar.y"
1984     { (yyval.i) = Q_SCA; }
1985     break;
1986
1987   case 66:
1988 #line 236 "grammar.y"
1989     { (yyval.i) = Q_MOPDL; }
1990     break;
1991
1992   case 67:
1993 #line 237 "grammar.y"
1994     { (yyval.i) = Q_MOPRC; }
1995     break;
1996
1997   case 68:
1998 #line 239 "grammar.y"
1999     { (yyval.rblk) = gen_broadcast((yyvsp[(1) - (2)].i)); }
2000     break;
2001
2002   case 69:
2003 #line 240 "grammar.y"
2004     { (yyval.rblk) = gen_multicast((yyvsp[(1) - (2)].i)); }
2005     break;
2006
2007   case 70:
2008 #line 241 "grammar.y"
2009     { (yyval.rblk) = gen_less((yyvsp[(2) - (2)].i)); }
2010     break;
2011
2012   case 71:
2013 #line 242 "grammar.y"
2014     { (yyval.rblk) = gen_greater((yyvsp[(2) - (2)].i)); }
2015     break;
2016
2017   case 72:
2018 #line 243 "grammar.y"
2019     { (yyval.rblk) = gen_byteop((yyvsp[(3) - (4)].i), (yyvsp[(2) - (4)].i), (yyvsp[(4) - (4)].i)); }
2020     break;
2021
2022   case 73:
2023 #line 244 "grammar.y"
2024     { (yyval.rblk) = gen_inbound(0); }
2025     break;
2026
2027   case 74:
2028 #line 245 "grammar.y"
2029     { (yyval.rblk) = gen_inbound(1); }
2030     break;
2031
2032   case 75:
2033 #line 247 "grammar.y"
2034     { (yyval.i) = BPF_JGT; }
2035     break;
2036
2037   case 76:
2038 #line 248 "grammar.y"
2039     { (yyval.i) = BPF_JGE; }
2040     break;
2041
2042   case 77:
2043 #line 249 "grammar.y"
2044     { (yyval.i) = BPF_JEQ; }
2045     break;
2046
2047   case 78:
2048 #line 251 "grammar.y"
2049     { (yyval.i) = BPF_JGT; }
2050     break;
2051
2052   case 79:
2053 #line 252 "grammar.y"
2054     { (yyval.i) = BPF_JGE; }
2055     break;
2056
2057   case 80:
2058 #line 253 "grammar.y"
2059     { (yyval.i) = BPF_JEQ; }
2060     break;
2061
2062   case 81:
2063 #line 255 "grammar.y"
2064     { (yyval.a) = gen_loadi((yyvsp[(1) - (1)].i)); }
2065     break;
2066
2067   case 83:
2068 #line 258 "grammar.y"
2069     { (yyval.a) = gen_load((yyvsp[(1) - (4)].i), (yyvsp[(3) - (4)].a), 1); }
2070     break;
2071
2072   case 84:
2073 #line 259 "grammar.y"
2074     { (yyval.a) = gen_load((yyvsp[(1) - (6)].i), (yyvsp[(3) - (6)].a), (yyvsp[(5) - (6)].i)); }
2075     break;
2076
2077   case 85:
2078 #line 260 "grammar.y"
2079     { (yyval.a) = gen_arth(BPF_ADD, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2080     break;
2081
2082   case 86:
2083 #line 261 "grammar.y"
2084     { (yyval.a) = gen_arth(BPF_SUB, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2085     break;
2086
2087   case 87:
2088 #line 262 "grammar.y"
2089     { (yyval.a) = gen_arth(BPF_MUL, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2090     break;
2091
2092   case 88:
2093 #line 263 "grammar.y"
2094     { (yyval.a) = gen_arth(BPF_DIV, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2095     break;
2096
2097   case 89:
2098 #line 264 "grammar.y"
2099     { (yyval.a) = gen_arth(BPF_AND, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2100     break;
2101
2102   case 90:
2103 #line 265 "grammar.y"
2104     { (yyval.a) = gen_arth(BPF_OR, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2105     break;
2106
2107   case 91:
2108 #line 266 "grammar.y"
2109     { (yyval.a) = gen_arth(BPF_LSH, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2110     break;
2111
2112   case 92:
2113 #line 267 "grammar.y"
2114     { (yyval.a) = gen_arth(BPF_RSH, (yyvsp[(1) - (3)].a), (yyvsp[(3) - (3)].a)); }
2115     break;
2116
2117   case 93:
2118 #line 268 "grammar.y"
2119     { (yyval.a) = gen_neg((yyvsp[(2) - (2)].a)); }
2120     break;
2121
2122   case 94:
2123 #line 269 "grammar.y"
2124     { (yyval.a) = (yyvsp[(2) - (3)].a); }
2125     break;
2126
2127   case 95:
2128 #line 270 "grammar.y"
2129     { (yyval.a) = gen_loadlen(); }
2130     break;
2131
2132   case 96:
2133 #line 272 "grammar.y"
2134     { (yyval.i) = '&'; }
2135     break;
2136
2137   case 97:
2138 #line 273 "grammar.y"
2139     { (yyval.i) = '|'; }
2140     break;
2141
2142   case 98:
2143 #line 274 "grammar.y"
2144     { (yyval.i) = '<'; }
2145     break;
2146
2147   case 99:
2148 #line 275 "grammar.y"
2149     { (yyval.i) = '>'; }
2150     break;
2151
2152   case 100:
2153 #line 276 "grammar.y"
2154     { (yyval.i) = '='; }
2155     break;
2156
2157   case 102:
2158 #line 279 "grammar.y"
2159     { (yyval.i) = (yyvsp[(2) - (3)].i); }
2160     break;
2161
2162
2163 /* Line 1267 of yacc.c.  */
2164 #line 2165 "y.tab.c"
2165       default: break;
2166     }
2167   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2168
2169   YYPOPSTACK (yylen);
2170   yylen = 0;
2171   YY_STACK_PRINT (yyss, yyssp);
2172
2173   *++yyvsp = yyval;
2174
2175
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.  */
2179
2180   yyn = yyr1[yyn];
2181
2182   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2183   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2184     yystate = yytable[yystate];
2185   else
2186     yystate = yydefgoto[yyn - YYNTOKENS];
2187
2188   goto yynewstate;
2189
2190
2191 /*------------------------------------.
2192 | yyerrlab -- here on detecting error |
2193 `------------------------------------*/
2194 yyerrlab:
2195   /* If not already recovering from an error, report this error.  */
2196   if (!yyerrstatus)
2197     {
2198       ++yynerrs;
2199 #if ! YYERROR_VERBOSE
2200       yyerror (YY_("syntax error"));
2201 #else
2202       {
2203         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2204         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2205           {
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);
2212             if (yymsg)
2213               yymsg_alloc = yyalloc;
2214             else
2215               {
2216                 yymsg = yymsgbuf;
2217                 yymsg_alloc = sizeof yymsgbuf;
2218               }
2219           }
2220
2221         if (0 < yysize && yysize <= yymsg_alloc)
2222           {
2223             (void) yysyntax_error (yymsg, yystate, yychar);
2224             yyerror (yymsg);
2225           }
2226         else
2227           {
2228             yyerror (YY_("syntax error"));
2229             if (yysize != 0)
2230               goto yyexhaustedlab;
2231           }
2232       }
2233 #endif
2234     }
2235
2236
2237
2238   if (yyerrstatus == 3)
2239     {
2240       /* If just tried and failed to reuse look-ahead token after an
2241          error, discard it.  */
2242
2243       if (yychar <= YYEOF)
2244         {
2245           /* Return failure if at end of input.  */
2246           if (yychar == YYEOF)
2247             YYABORT;
2248         }
2249       else
2250         {
2251           yydestruct ("Error: discarding",
2252                       yytoken, &yylval);
2253           yychar = YYEMPTY;
2254         }
2255     }
2256
2257   /* Else will try to reuse look-ahead token after shifting the error
2258      token.  */
2259   goto yyerrlab1;
2260
2261
2262 /*---------------------------------------------------.
2263 | yyerrorlab -- error raised explicitly by YYERROR.  |
2264 `---------------------------------------------------*/
2265 yyerrorlab:
2266
2267   /* Pacify compilers like GCC when the user code never invokes
2268      YYERROR and the label yyerrorlab therefore never appears in user
2269      code.  */
2270   if (/*CONSTCOND*/ 0)
2271      goto yyerrorlab;
2272
2273   /* Do not reclaim the symbols of the rule which action triggered
2274      this YYERROR.  */
2275   YYPOPSTACK (yylen);
2276   yylen = 0;
2277   YY_STACK_PRINT (yyss, yyssp);
2278   yystate = *yyssp;
2279   goto yyerrlab1;
2280
2281
2282 /*-------------------------------------------------------------.
2283 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2284 `-------------------------------------------------------------*/
2285 yyerrlab1:
2286   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2287
2288   for (;;)
2289     {
2290       yyn = yypact[yystate];
2291       if (yyn != YYPACT_NINF)
2292         {
2293           yyn += YYTERROR;
2294           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2295             {
2296               yyn = yytable[yyn];
2297               if (0 < yyn)
2298                 break;
2299             }
2300         }
2301
2302       /* Pop the current state because it cannot handle the error token.  */
2303       if (yyssp == yyss)
2304         YYABORT;
2305
2306
2307       yydestruct ("Error: popping",
2308                   yystos[yystate], yyvsp);
2309       YYPOPSTACK (1);
2310       yystate = *yyssp;
2311       YY_STACK_PRINT (yyss, yyssp);
2312     }
2313
2314   if (yyn == YYFINAL)
2315     YYACCEPT;
2316
2317   *++yyvsp = yylval;
2318
2319
2320   /* Shift the error token.  */
2321   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2322
2323   yystate = yyn;
2324   goto yynewstate;
2325
2326
2327 /*-------------------------------------.
2328 | yyacceptlab -- YYACCEPT comes here.  |
2329 `-------------------------------------*/
2330 yyacceptlab:
2331   yyresult = 0;
2332   goto yyreturn;
2333
2334 /*-----------------------------------.
2335 | yyabortlab -- YYABORT comes here.  |
2336 `-----------------------------------*/
2337 yyabortlab:
2338   yyresult = 1;
2339   goto yyreturn;
2340
2341 #ifndef yyoverflow
2342 /*-------------------------------------------------.
2343 | yyexhaustedlab -- memory exhaustion comes here.  |
2344 `-------------------------------------------------*/
2345 yyexhaustedlab:
2346   yyerror (YY_("memory exhausted"));
2347   yyresult = 2;
2348   /* Fall through.  */
2349 #endif
2350
2351 yyreturn:
2352   if (yychar != YYEOF && yychar != YYEMPTY)
2353      yydestruct ("Cleanup: discarding lookahead",
2354                  yytoken, &yylval);
2355   /* Do not reclaim the symbols of the rule which action triggered
2356      this YYABORT or YYACCEPT.  */
2357   YYPOPSTACK (yylen);
2358   YY_STACK_PRINT (yyss, yyssp);
2359   while (yyssp != yyss)
2360     {
2361       yydestruct ("Cleanup: popping",
2362                   yystos[*yyssp], yyvsp);
2363       YYPOPSTACK (1);
2364     }
2365 #ifndef yyoverflow
2366   if (yyss != yyssa)
2367     YYSTACK_FREE (yyss);
2368 #endif
2369 #if YYERROR_VERBOSE
2370   if (yymsg != yymsgbuf)
2371     YYSTACK_FREE (yymsg);
2372 #endif
2373   /* Make sure YYID is used.  */
2374   return YYID (yyresult);
2375 }
2376
2377
2378 #line 281 "grammar.y"
2379
2380