1 /* A Bison parser, made by GNU Bison 3.0.4. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse pcap_parse
64 #define yylex pcap_lex
65 #define yyerror pcap_error
66 #define yydebug pcap_debug
67 #define yynerrs pcap_nerrs
68
69
70 /* Copy the first part of user declarations. */
71 #line 26 "grammar.y" /* yacc.c:339 */
72
73 /*
74 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
75 * The Regents of the University of California. All rights reserved.
76 *
77 * Redistribution and use in source and binary forms, with or without
78 * modification, are permitted provided that: (1) source code distributions
79 * retain the above copyright notice and this paragraph in its entirety, (2)
80 * distributions including binary code include the above copyright notice and
81 * this paragraph in its entirety in the documentation or other materials
82 * provided with the distribution, and (3) all advertising materials mentioning
83 * features or use of this software display the following acknowledgement:
84 * ``This product includes software developed by the University of California,
85 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
86 * the University nor the names of its contributors may be used to endorse
87 * or promote products derived from this software without specific prior
88 * written permission.
89 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
90 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
91 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
92 *
93 */
94
95 #ifdef HAVE_CONFIG_H
96 #include <config.h>
97 #endif
98
99 #include <stdlib.h>
100
101 #ifndef _WIN32
102 #include <sys/types.h>
103 #include <sys/socket.h>
104
105 #if __STDC__
106 struct mbuf;
107 struct rtentry;
108 #endif
109
110 #include <netinet/in.h>
111 #include <arpa/inet.h>
112 #endif /* _WIN32 */
113
114 #include <stdio.h>
115
116 #include "diag-control.h"
117
118 #include "pcap-int.h"
119
120 #include "gencode.h"
121 #include "grammar.h"
122 #include "scanner.h"
123
124 #ifdef HAVE_NET_PFVAR_H
125 #include <net/if.h>
126 #include <net/pfvar.h>
127 #include <net/if_pflog.h>
128 #endif
129 #include "llc.h"
130 #include "ieee80211.h"
131 #include <pcap/namedb.h>
132
133 #ifdef HAVE_OS_PROTO_H
134 #include "os-proto.h"
135 #endif
136
137 #ifdef YYBYACC
138 /*
139 * Both Berkeley YACC and Bison define yydebug (under whatever name
140 * it has) as a global, but Bison does so only if YYDEBUG is defined.
141 * Berkeley YACC define it even if YYDEBUG isn't defined; declare it
142 * here to suppress a warning.
143 */
144 #if !defined(YYDEBUG)
145 extern int yydebug;
146 #endif
147
148 /*
149 * In Berkeley YACC, yynerrs (under whatever name it has) is global,
150 * even if it's building a reentrant parser. In Bison, it's local
151 * in reentrant parsers.
152 *
153 * Declare it to squelch a warning.
154 */
155 extern int yynerrs;
156 #endif
157
158 #define QSET(q, p, d, a) (q).proto = (unsigned char)(p),\
159 (q).dir = (unsigned char)(d),\
160 (q).addr = (unsigned char)(a)
161
162 struct tok {
163 int v; /* value */
164 const char *s; /* string */
165 };
166
167 static const struct tok ieee80211_types[] = {
168 { IEEE80211_FC0_TYPE_DATA, "data" },
169 { IEEE80211_FC0_TYPE_MGT, "mgt" },
170 { IEEE80211_FC0_TYPE_MGT, "management" },
171 { IEEE80211_FC0_TYPE_CTL, "ctl" },
172 { IEEE80211_FC0_TYPE_CTL, "control" },
173 { 0, NULL }
174 };
175 static const struct tok ieee80211_mgt_subtypes[] = {
176 { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assocreq" },
177 { IEEE80211_FC0_SUBTYPE_ASSOC_REQ, "assoc-req" },
178 { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assocresp" },
179 { IEEE80211_FC0_SUBTYPE_ASSOC_RESP, "assoc-resp" },
180 { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassocreq" },
181 { IEEE80211_FC0_SUBTYPE_REASSOC_REQ, "reassoc-req" },
182 { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassocresp" },
183 { IEEE80211_FC0_SUBTYPE_REASSOC_RESP, "reassoc-resp" },
184 { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probereq" },
185 { IEEE80211_FC0_SUBTYPE_PROBE_REQ, "probe-req" },
186 { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "proberesp" },
187 { IEEE80211_FC0_SUBTYPE_PROBE_RESP, "probe-resp" },
188 { IEEE80211_FC0_SUBTYPE_BEACON, "beacon" },
189 { IEEE80211_FC0_SUBTYPE_ATIM, "atim" },
190 { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassoc" },
191 { IEEE80211_FC0_SUBTYPE_DISASSOC, "disassociation" },
192 { IEEE80211_FC0_SUBTYPE_AUTH, "auth" },
193 { IEEE80211_FC0_SUBTYPE_AUTH, "authentication" },
194 { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauth" },
195 { IEEE80211_FC0_SUBTYPE_DEAUTH, "deauthentication" },
196 { 0, NULL }
197 };
198 static const struct tok ieee80211_ctl_subtypes[] = {
199 { IEEE80211_FC0_SUBTYPE_PS_POLL, "ps-poll" },
200 { IEEE80211_FC0_SUBTYPE_RTS, "rts" },
201 { IEEE80211_FC0_SUBTYPE_CTS, "cts" },
202 { IEEE80211_FC0_SUBTYPE_ACK, "ack" },
203 { IEEE80211_FC0_SUBTYPE_CF_END, "cf-end" },
204 { IEEE80211_FC0_SUBTYPE_CF_END_ACK, "cf-end-ack" },
205 { 0, NULL }
206 };
207 static const struct tok ieee80211_data_subtypes[] = {
208 { IEEE80211_FC0_SUBTYPE_DATA, "data" },
209 { IEEE80211_FC0_SUBTYPE_CF_ACK, "data-cf-ack" },
210 { IEEE80211_FC0_SUBTYPE_CF_POLL, "data-cf-poll" },
211 { IEEE80211_FC0_SUBTYPE_CF_ACPL, "data-cf-ack-poll" },
212 { IEEE80211_FC0_SUBTYPE_NODATA, "null" },
213 { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACK, "cf-ack" },
214 { IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "cf-poll" },
215 { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "cf-ack-poll" },
216 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_DATA, "qos-data" },
217 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACK, "qos-data-cf-ack" },
218 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_POLL, "qos-data-cf-poll" },
219 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACPL, "qos-data-cf-ack-poll" },
220 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA, "qos" },
221 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "qos-cf-poll" },
222 { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "qos-cf-ack-poll" },
223 { 0, NULL }
224 };
225 static const struct tok llc_s_subtypes[] = {
226 { LLC_RR, "rr" },
227 { LLC_RNR, "rnr" },
228 { LLC_REJ, "rej" },
229 { 0, NULL }
230 };
231 static const struct tok llc_u_subtypes[] = {
232 { LLC_UI, "ui" },
233 { LLC_UA, "ua" },
234 { LLC_DISC, "disc" },
235 { LLC_DM, "dm" },
236 { LLC_SABME, "sabme" },
237 { LLC_TEST, "test" },
238 { LLC_XID, "xid" },
239 { LLC_FRMR, "frmr" },
240 { 0, NULL }
241 };
242 struct type2tok {
243 int type;
244 const struct tok *tok;
245 };
246 static const struct type2tok ieee80211_type_subtypes[] = {
247 { IEEE80211_FC0_TYPE_MGT, ieee80211_mgt_subtypes },
248 { IEEE80211_FC0_TYPE_CTL, ieee80211_ctl_subtypes },
249 { IEEE80211_FC0_TYPE_DATA, ieee80211_data_subtypes },
250 { 0, NULL }
251 };
252
253 static int
str2tok(const char * str,const struct tok * toks)254 str2tok(const char *str, const struct tok *toks)
255 {
256 int i;
257
258 for (i = 0; toks[i].s != NULL; i++) {
259 if (pcap_strcasecmp(toks[i].s, str) == 0)
260 return (toks[i].v);
261 }
262 return (-1);
263 }
264
265 static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };
266
267 static PCAP_NORETURN_DEF void
yyerror(void * yyscanner _U_,compiler_state_t * cstate,const char * msg)268 yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg)
269 {
270 bpf_syntax_error(cstate, msg);
271 /* NOTREACHED */
272 }
273
274 #ifdef HAVE_NET_PFVAR_H
275 static int
pfreason_to_num(compiler_state_t * cstate,const char * reason)276 pfreason_to_num(compiler_state_t *cstate, const char *reason)
277 {
278 const char *reasons[] = PFRES_NAMES;
279 int i;
280
281 for (i = 0; reasons[i]; i++) {
282 if (pcap_strcasecmp(reason, reasons[i]) == 0)
283 return (i);
284 }
285 bpf_error(cstate, "unknown PF reason");
286 /*NOTREACHED*/
287 }
288
289 static int
pfaction_to_num(compiler_state_t * cstate,const char * action)290 pfaction_to_num(compiler_state_t *cstate, const char *action)
291 {
292 if (pcap_strcasecmp(action, "pass") == 0 ||
293 pcap_strcasecmp(action, "accept") == 0)
294 return (PF_PASS);
295 else if (pcap_strcasecmp(action, "drop") == 0 ||
296 pcap_strcasecmp(action, "block") == 0)
297 return (PF_DROP);
298 #if HAVE_PF_NAT_THROUGH_PF_NORDR
299 else if (pcap_strcasecmp(action, "rdr") == 0)
300 return (PF_RDR);
301 else if (pcap_strcasecmp(action, "nat") == 0)
302 return (PF_NAT);
303 else if (pcap_strcasecmp(action, "binat") == 0)
304 return (PF_BINAT);
305 else if (pcap_strcasecmp(action, "nordr") == 0)
306 return (PF_NORDR);
307 #endif
308 else {
309 bpf_error(cstate, "unknown PF action");
310 /*NOTREACHED*/
311 }
312 }
313 #else /* !HAVE_NET_PFVAR_H */
314 static PCAP_NORETURN_DEF int
pfreason_to_num(compiler_state_t * cstate,const char * reason _U_)315 pfreason_to_num(compiler_state_t *cstate, const char *reason _U_)
316 {
317 bpf_error(cstate, "libpcap was compiled on a machine without pf support");
318 /*NOTREACHED*/
319 }
320
321 static PCAP_NORETURN_DEF int
pfaction_to_num(compiler_state_t * cstate,const char * action _U_)322 pfaction_to_num(compiler_state_t *cstate, const char *action _U_)
323 {
324 bpf_error(cstate, "libpcap was compiled on a machine without pf support");
325 /*NOTREACHED*/
326 }
327 #endif /* HAVE_NET_PFVAR_H */
328
329 DIAG_OFF_BISON_BYACC
330
331 #line 332 "grammar.c" /* yacc.c:339 */
332
333 # ifndef YY_NULLPTR
334 # if defined __cplusplus && 201103L <= __cplusplus
335 # define YY_NULLPTR nullptr
336 # else
337 # define YY_NULLPTR 0
338 # endif
339 # endif
340
341 /* Enabling verbose error messages. */
342 #ifdef YYERROR_VERBOSE
343 # undef YYERROR_VERBOSE
344 # define YYERROR_VERBOSE 1
345 #else
346 # define YYERROR_VERBOSE 0
347 #endif
348
349 /* In a future release of Bison, this section will be replaced
350 by #include "grammar.h". */
351 #ifndef YY_PCAP_GRAMMAR_H_INCLUDED
352 # define YY_PCAP_GRAMMAR_H_INCLUDED
353 /* Debug traces. */
354 #ifndef YYDEBUG
355 # define YYDEBUG 0
356 #endif
357 #if YYDEBUG
358 extern int pcap_debug;
359 #endif
360
361 /* Token type. */
362 #ifndef YYTOKENTYPE
363 # define YYTOKENTYPE
364 enum yytokentype
365 {
366 DST = 258,
367 SRC = 259,
368 HOST = 260,
369 GATEWAY = 261,
370 NET = 262,
371 NETMASK = 263,
372 PORT = 264,
373 PORTRANGE = 265,
374 LESS = 266,
375 GREATER = 267,
376 PROTO = 268,
377 PROTOCHAIN = 269,
378 CBYTE = 270,
379 ARP = 271,
380 RARP = 272,
381 IP = 273,
382 SCTP = 274,
383 TCP = 275,
384 UDP = 276,
385 ICMP = 277,
386 IGMP = 278,
387 IGRP = 279,
388 PIM = 280,
389 VRRP = 281,
390 CARP = 282,
391 ATALK = 283,
392 AARP = 284,
393 DECNET = 285,
394 LAT = 286,
395 SCA = 287,
396 MOPRC = 288,
397 MOPDL = 289,
398 TK_BROADCAST = 290,
399 TK_MULTICAST = 291,
400 NUM = 292,
401 INBOUND = 293,
402 OUTBOUND = 294,
403 PF_IFNAME = 295,
404 PF_RSET = 296,
405 PF_RNR = 297,
406 PF_SRNR = 298,
407 PF_REASON = 299,
408 PF_ACTION = 300,
409 TYPE = 301,
410 SUBTYPE = 302,
411 DIR = 303,
412 ADDR1 = 304,
413 ADDR2 = 305,
414 ADDR3 = 306,
415 ADDR4 = 307,
416 RA = 308,
417 TA = 309,
418 LINK = 310,
419 GEQ = 311,
420 LEQ = 312,
421 NEQ = 313,
422 ID = 314,
423 EID = 315,
424 HID = 316,
425 HID6 = 317,
426 AID = 318,
427 LSH = 319,
428 RSH = 320,
429 LEN = 321,
430 IPV6 = 322,
431 ICMPV6 = 323,
432 AH = 324,
433 ESP = 325,
434 VLAN = 326,
435 MPLS = 327,
436 PPPOED = 328,
437 PPPOES = 329,
438 GENEVE = 330,
439 ISO = 331,
440 ESIS = 332,
441 CLNP = 333,
442 ISIS = 334,
443 L1 = 335,
444 L2 = 336,
445 IIH = 337,
446 LSP = 338,
447 SNP = 339,
448 CSNP = 340,
449 PSNP = 341,
450 STP = 342,
451 IPX = 343,
452 NETBEUI = 344,
453 LANE = 345,
454 LLC = 346,
455 METAC = 347,
456 BCC = 348,
457 SC = 349,
458 ILMIC = 350,
459 OAMF4EC = 351,
460 OAMF4SC = 352,
461 OAM = 353,
462 OAMF4 = 354,
463 CONNECTMSG = 355,
464 METACONNECT = 356,
465 VPI = 357,
466 VCI = 358,
467 RADIO = 359,
468 FISU = 360,
469 LSSU = 361,
470 MSU = 362,
471 HFISU = 363,
472 HLSSU = 364,
473 HMSU = 365,
474 SIO = 366,
475 OPC = 367,
476 DPC = 368,
477 SLS = 369,
478 HSIO = 370,
479 HOPC = 371,
480 HDPC = 372,
481 HSLS = 373,
482 OR = 374,
483 AND = 375,
484 UMINUS = 376
485 };
486 #endif
487 /* Tokens. */
488 #define DST 258
489 #define SRC 259
490 #define HOST 260
491 #define GATEWAY 261
492 #define NET 262
493 #define NETMASK 263
494 #define PORT 264
495 #define PORTRANGE 265
496 #define LESS 266
497 #define GREATER 267
498 #define PROTO 268
499 #define PROTOCHAIN 269
500 #define CBYTE 270
501 #define ARP 271
502 #define RARP 272
503 #define IP 273
504 #define SCTP 274
505 #define TCP 275
506 #define UDP 276
507 #define ICMP 277
508 #define IGMP 278
509 #define IGRP 279
510 #define PIM 280
511 #define VRRP 281
512 #define CARP 282
513 #define ATALK 283
514 #define AARP 284
515 #define DECNET 285
516 #define LAT 286
517 #define SCA 287
518 #define MOPRC 288
519 #define MOPDL 289
520 #define TK_BROADCAST 290
521 #define TK_MULTICAST 291
522 #define NUM 292
523 #define INBOUND 293
524 #define OUTBOUND 294
525 #define PF_IFNAME 295
526 #define PF_RSET 296
527 #define PF_RNR 297
528 #define PF_SRNR 298
529 #define PF_REASON 299
530 #define PF_ACTION 300
531 #define TYPE 301
532 #define SUBTYPE 302
533 #define DIR 303
534 #define ADDR1 304
535 #define ADDR2 305
536 #define ADDR3 306
537 #define ADDR4 307
538 #define RA 308
539 #define TA 309
540 #define LINK 310
541 #define GEQ 311
542 #define LEQ 312
543 #define NEQ 313
544 #define ID 314
545 #define EID 315
546 #define HID 316
547 #define HID6 317
548 #define AID 318
549 #define LSH 319
550 #define RSH 320
551 #define LEN 321
552 #define IPV6 322
553 #define ICMPV6 323
554 #define AH 324
555 #define ESP 325
556 #define VLAN 326
557 #define MPLS 327
558 #define PPPOED 328
559 #define PPPOES 329
560 #define GENEVE 330
561 #define ISO 331
562 #define ESIS 332
563 #define CLNP 333
564 #define ISIS 334
565 #define L1 335
566 #define L2 336
567 #define IIH 337
568 #define LSP 338
569 #define SNP 339
570 #define CSNP 340
571 #define PSNP 341
572 #define STP 342
573 #define IPX 343
574 #define NETBEUI 344
575 #define LANE 345
576 #define LLC 346
577 #define METAC 347
578 #define BCC 348
579 #define SC 349
580 #define ILMIC 350
581 #define OAMF4EC 351
582 #define OAMF4SC 352
583 #define OAM 353
584 #define OAMF4 354
585 #define CONNECTMSG 355
586 #define METACONNECT 356
587 #define VPI 357
588 #define VCI 358
589 #define RADIO 359
590 #define FISU 360
591 #define LSSU 361
592 #define MSU 362
593 #define HFISU 363
594 #define HLSSU 364
595 #define HMSU 365
596 #define SIO 366
597 #define OPC 367
598 #define DPC 368
599 #define SLS 369
600 #define HSIO 370
601 #define HOPC 371
602 #define HDPC 372
603 #define HSLS 373
604 #define OR 374
605 #define AND 375
606 #define UMINUS 376
607
608 /* Value type. */
609 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
610
611 union YYSTYPE
612 {
613 #line 286 "grammar.y" /* yacc.c:355 */
614
615 int i;
616 bpf_u_int32 h;
617 u_char *e;
618 char *s;
619 struct stmt *stmt;
620 struct arth *a;
621 struct {
622 struct qual q;
623 int atmfieldtype;
624 int mtp3fieldtype;
625 struct block *b;
626 } blk;
627 struct block *rblk;
628
629 #line 630 "grammar.c" /* yacc.c:355 */
630 };
631
632 typedef union YYSTYPE YYSTYPE;
633 # define YYSTYPE_IS_TRIVIAL 1
634 # define YYSTYPE_IS_DECLARED 1
635 #endif
636
637
638
639 int pcap_parse (void *yyscanner, compiler_state_t *cstate);
640
641 #endif /* !YY_PCAP_GRAMMAR_H_INCLUDED */
642
643 /* Copy the second part of user declarations. */
644
645 #line 646 "grammar.c" /* yacc.c:358 */
646
647 #ifdef short
648 # undef short
649 #endif
650
651 #ifdef YYTYPE_UINT8
652 typedef YYTYPE_UINT8 yytype_uint8;
653 #else
654 typedef unsigned char yytype_uint8;
655 #endif
656
657 #ifdef YYTYPE_INT8
658 typedef YYTYPE_INT8 yytype_int8;
659 #else
660 typedef signed char yytype_int8;
661 #endif
662
663 #ifdef YYTYPE_UINT16
664 typedef YYTYPE_UINT16 yytype_uint16;
665 #else
666 typedef unsigned short int yytype_uint16;
667 #endif
668
669 #ifdef YYTYPE_INT16
670 typedef YYTYPE_INT16 yytype_int16;
671 #else
672 typedef short int yytype_int16;
673 #endif
674
675 #ifndef YYSIZE_T
676 # ifdef __SIZE_TYPE__
677 # define YYSIZE_T __SIZE_TYPE__
678 # elif defined size_t
679 # define YYSIZE_T size_t
680 # elif ! defined YYSIZE_T
681 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
682 # define YYSIZE_T size_t
683 # else
684 # define YYSIZE_T unsigned int
685 # endif
686 #endif
687
688 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
689
690 #ifndef YY_
691 # if defined YYENABLE_NLS && YYENABLE_NLS
692 # if ENABLE_NLS
693 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
694 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
695 # endif
696 # endif
697 # ifndef YY_
698 # define YY_(Msgid) Msgid
699 # endif
700 #endif
701
702 #ifndef YY_ATTRIBUTE
703 # if (defined __GNUC__ \
704 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
705 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
706 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
707 # else
708 # define YY_ATTRIBUTE(Spec) /* empty */
709 # endif
710 #endif
711
712 #ifndef YY_ATTRIBUTE_PURE
713 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
714 #endif
715
716 #ifndef YY_ATTRIBUTE_UNUSED
717 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
718 #endif
719
720 #if !defined _Noreturn \
721 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
722 # if defined _MSC_VER && 1200 <= _MSC_VER
723 # define _Noreturn __declspec (noreturn)
724 # else
725 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
726 # endif
727 #endif
728
729 /* Suppress unused-variable warnings by "using" E. */
730 #if ! defined lint || defined __GNUC__
731 # define YYUSE(E) ((void) (E))
732 #else
733 # define YYUSE(E) /* empty */
734 #endif
735
736 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
737 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
738 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
739 _Pragma ("GCC diagnostic push") \
740 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
741 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
742 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
743 _Pragma ("GCC diagnostic pop")
744 #else
745 # define YY_INITIAL_VALUE(Value) Value
746 #endif
747 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
748 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
749 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
750 #endif
751 #ifndef YY_INITIAL_VALUE
752 # define YY_INITIAL_VALUE(Value) /* Nothing. */
753 #endif
754
755
756 #if ! defined yyoverflow || YYERROR_VERBOSE
757
758 /* The parser invokes alloca or malloc; define the necessary symbols. */
759
760 # ifdef YYSTACK_USE_ALLOCA
761 # if YYSTACK_USE_ALLOCA
762 # ifdef __GNUC__
763 # define YYSTACK_ALLOC __builtin_alloca
764 # elif defined __BUILTIN_VA_ARG_INCR
765 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
766 # elif defined _AIX
767 # define YYSTACK_ALLOC __alloca
768 # elif defined _MSC_VER
769 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
770 # define alloca _alloca
771 # else
772 # define YYSTACK_ALLOC alloca
773 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
774 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
775 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
776 # ifndef EXIT_SUCCESS
777 # define EXIT_SUCCESS 0
778 # endif
779 # endif
780 # endif
781 # endif
782 # endif
783
784 # ifdef YYSTACK_ALLOC
785 /* Pacify GCC's 'empty if-body' warning. */
786 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
787 # ifndef YYSTACK_ALLOC_MAXIMUM
788 /* The OS might guarantee only one guard page at the bottom of the stack,
789 and a page size can be as small as 4096 bytes. So we cannot safely
790 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
791 to allow for a few compiler-allocated temporary stack slots. */
792 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
793 # endif
794 # else
795 # define YYSTACK_ALLOC YYMALLOC
796 # define YYSTACK_FREE YYFREE
797 # ifndef YYSTACK_ALLOC_MAXIMUM
798 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
799 # endif
800 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
801 && ! ((defined YYMALLOC || defined malloc) \
802 && (defined YYFREE || defined free)))
803 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
804 # ifndef EXIT_SUCCESS
805 # define EXIT_SUCCESS 0
806 # endif
807 # endif
808 # ifndef YYMALLOC
809 # define YYMALLOC malloc
810 # if ! defined malloc && ! defined EXIT_SUCCESS
811 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
812 # endif
813 # endif
814 # ifndef YYFREE
815 # define YYFREE free
816 # if ! defined free && ! defined EXIT_SUCCESS
817 void free (void *); /* INFRINGES ON USER NAME SPACE */
818 # endif
819 # endif
820 # endif
821 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
822
823
824 #if (! defined yyoverflow \
825 && (! defined __cplusplus \
826 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
827
828 /* A type that is properly aligned for any stack member. */
829 union yyalloc
830 {
831 yytype_int16 yyss_alloc;
832 YYSTYPE yyvs_alloc;
833 };
834
835 /* The size of the maximum gap between one aligned stack and the next. */
836 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
837
838 /* The size of an array large to enough to hold all stacks, each with
839 N elements. */
840 # define YYSTACK_BYTES(N) \
841 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
842 + YYSTACK_GAP_MAXIMUM)
843
844 # define YYCOPY_NEEDED 1
845
846 /* Relocate STACK from its old location to the new one. The
847 local variables YYSIZE and YYSTACKSIZE give the old and new number of
848 elements in the stack, and YYPTR gives the new location of the
849 stack. Advance YYPTR to a properly aligned location for the next
850 stack. */
851 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
852 do \
853 { \
854 YYSIZE_T yynewbytes; \
855 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
856 Stack = &yyptr->Stack_alloc; \
857 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
858 yyptr += yynewbytes / sizeof (*yyptr); \
859 } \
860 while (0)
861
862 #endif
863
864 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
865 /* Copy COUNT objects from SRC to DST. The source and destination do
866 not overlap. */
867 # ifndef YYCOPY
868 # if defined __GNUC__ && 1 < __GNUC__
869 # define YYCOPY(Dst, Src, Count) \
870 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
871 # else
872 # define YYCOPY(Dst, Src, Count) \
873 do \
874 { \
875 YYSIZE_T yyi; \
876 for (yyi = 0; yyi < (Count); yyi++) \
877 (Dst)[yyi] = (Src)[yyi]; \
878 } \
879 while (0)
880 # endif
881 # endif
882 #endif /* !YYCOPY_NEEDED */
883
884 /* YYFINAL -- State number of the termination state. */
885 #define YYFINAL 3
886 /* YYLAST -- Last index in YYTABLE. */
887 #define YYLAST 788
888
889 /* YYNTOKENS -- Number of terminals. */
890 #define YYNTOKENS 139
891 /* YYNNTS -- Number of nonterminals. */
892 #define YYNNTS 47
893 /* YYNRULES -- Number of rules. */
894 #define YYNRULES 220
895 /* YYNSTATES -- Number of states. */
896 #define YYNSTATES 294
897
898 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
899 by yylex, with out-of-bounds checking. */
900 #define YYUNDEFTOK 2
901 #define YYMAXUTOK 376
902
903 #define YYTRANSLATE(YYX) \
904 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
905
906 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
907 as returned by yylex, without out-of-bounds checking. */
908 static const yytype_uint8 yytranslate[] =
909 {
910 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
911 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
912 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
913 2, 2, 2, 121, 2, 2, 2, 137, 123, 2,
914 130, 129, 126, 124, 2, 125, 2, 127, 2, 2,
915 2, 2, 2, 2, 2, 2, 2, 2, 136, 2,
916 133, 132, 131, 2, 2, 2, 2, 2, 2, 2,
917 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
918 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
919 2, 134, 2, 135, 138, 2, 2, 2, 2, 2,
920 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
921 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
922 2, 2, 2, 2, 122, 2, 2, 2, 2, 2,
923 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
924 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
925 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
926 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
927 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
928 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
929 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
930 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
931 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
932 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
933 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
934 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
935 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
936 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
937 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
938 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
939 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
940 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
941 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
942 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
943 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
944 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
945 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
946 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
947 115, 116, 117, 118, 119, 120, 128
948 };
949
950 #if YYDEBUG
951 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
952 static const yytype_uint16 yyrline[] =
953 {
954 0, 360, 360, 364, 366, 368, 369, 370, 371, 372,
955 374, 376, 378, 379, 381, 383, 384, 386, 388, 401,
956 410, 419, 428, 437, 439, 441, 443, 444, 445, 447,
957 449, 451, 452, 454, 455, 456, 457, 458, 459, 461,
958 462, 463, 464, 466, 468, 469, 470, 471, 472, 473,
959 476, 477, 480, 481, 482, 483, 484, 485, 486, 487,
960 488, 489, 490, 491, 494, 495, 496, 497, 500, 502,
961 503, 504, 505, 506, 507, 508, 509, 510, 511, 512,
962 513, 514, 515, 516, 517, 518, 519, 520, 521, 522,
963 523, 524, 525, 526, 527, 528, 529, 530, 531, 532,
964 533, 534, 535, 536, 537, 538, 539, 540, 542, 543,
965 544, 545, 546, 547, 548, 549, 550, 551, 552, 553,
966 554, 555, 556, 557, 558, 559, 560, 563, 564, 565,
967 566, 567, 568, 571, 576, 579, 583, 586, 587, 593,
968 594, 614, 630, 631, 652, 655, 656, 669, 670, 673,
969 676, 677, 678, 680, 681, 682, 684, 685, 687, 688,
970 689, 690, 691, 692, 693, 694, 695, 696, 697, 698,
971 699, 700, 701, 703, 704, 705, 706, 707, 709, 710,
972 712, 713, 714, 715, 716, 717, 718, 720, 721, 722,
973 723, 726, 727, 729, 730, 731, 732, 734, 741, 742,
974 745, 746, 747, 748, 749, 750, 753, 754, 755, 756,
975 757, 758, 759, 760, 762, 763, 764, 765, 767, 780,
976 781
977 };
978 #endif
979
980 #if YYDEBUG || YYERROR_VERBOSE || 0
981 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
982 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
983 static const char *const yytname[] =
984 {
985 "$end", "error", "$undefined", "DST", "SRC", "HOST", "GATEWAY", "NET",
986 "NETMASK", "PORT", "PORTRANGE", "LESS", "GREATER", "PROTO", "PROTOCHAIN",
987 "CBYTE", "ARP", "RARP", "IP", "SCTP", "TCP", "UDP", "ICMP", "IGMP",
988 "IGRP", "PIM", "VRRP", "CARP", "ATALK", "AARP", "DECNET", "LAT", "SCA",
989 "MOPRC", "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND",
990 "OUTBOUND", "PF_IFNAME", "PF_RSET", "PF_RNR", "PF_SRNR", "PF_REASON",
991 "PF_ACTION", "TYPE", "SUBTYPE", "DIR", "ADDR1", "ADDR2", "ADDR3",
992 "ADDR4", "RA", "TA", "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID",
993 "HID6", "AID", "LSH", "RSH", "LEN", "IPV6", "ICMPV6", "AH", "ESP",
994 "VLAN", "MPLS", "PPPOED", "PPPOES", "GENEVE", "ISO", "ESIS", "CLNP",
995 "ISIS", "L1", "L2", "IIH", "LSP", "SNP", "CSNP", "PSNP", "STP", "IPX",
996 "NETBEUI", "LANE", "LLC", "METAC", "BCC", "SC", "ILMIC", "OAMF4EC",
997 "OAMF4SC", "OAM", "OAMF4", "CONNECTMSG", "METACONNECT", "VPI", "VCI",
998 "RADIO", "FISU", "LSSU", "MSU", "HFISU", "HLSSU", "HMSU", "SIO", "OPC",
999 "DPC", "SLS", "HSIO", "HOPC", "HDPC", "HSLS", "OR", "AND", "'!'", "'|'",
1000 "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS", "')'", "'('", "'>'", "'='",
1001 "'<'", "'['", "']'", "':'", "'%'", "'^'", "$accept", "prog", "null",
1002 "expr", "and", "or", "id", "nid", "not", "paren", "pid", "qid", "term",
1003 "head", "rterm", "pqual", "dqual", "aqual", "ndaqual", "pname", "other",
1004 "pfvar", "p80211", "type", "subtype", "type_subtype", "pllc", "dir",
1005 "reason", "action", "relop", "irelop", "arth", "narth", "byteop", "pnum",
1006 "atmtype", "atmmultitype", "atmfield", "atmvalue", "atmfieldvalue",
1007 "atmlistvalue", "mtp2type", "mtp3field", "mtp3value", "mtp3fieldvalue",
1008 "mtp3listvalue", YY_NULLPTR
1009 };
1010 #endif
1011
1012 # ifdef YYPRINT
1013 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
1014 (internal) symbol number NUM (which must be that of a token). */
1015 static const yytype_uint16 yytoknum[] =
1016 {
1017 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1018 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1019 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1020 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1021 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1022 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1023 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1024 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1025 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1026 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1027 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1028 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1029 375, 33, 124, 38, 43, 45, 42, 47, 376, 41,
1030 40, 62, 61, 60, 91, 93, 58, 37, 94
1031 };
1032 # endif
1033
1034 #define YYPACT_NINF -216
1035
1036 #define yypact_value_is_default(Yystate) \
1037 (!!((Yystate) == (-216)))
1038
1039 #define YYTABLE_NINF -42
1040
1041 #define yytable_value_is_error(Yytable_value) \
1042 0
1043
1044 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1045 STATE-NUM. */
1046 static const yytype_int16 yypact[] =
1047 {
1048 -216, 24, 257, -216, 0, 12, 17, -216, -216, -216,
1049 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
1050 -216, -216, -216, -216, -216, -216, -216, -216, -216, 16,
1051 25, 29, 72, -18, 55, -216, -216, -216, -216, -216,
1052 -216, -25, -25, -216, -25, -25, -216, -216, -216, -216,
1053 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
1054 -216, -24, -216, -216, -216, -216, -216, -216, -216, -216,
1055 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
1056 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
1057 604, -216, -30, 489, 489, -216, 125, -216, 734, 3,
1058 -216, -216, -216, 183, -216, -216, -216, -216, -5, -216,
1059 39, -216, -216, -54, -216, -216, -216, -216, -216, -216,
1060 -216, -216, -216, -25, -216, -216, -216, -216, -216, -216,
1061 604, -16, -108, -216, -216, 373, 373, -216, -103, -10,
1062 2, -216, -216, -7, 11, -216, -216, -216, 125, 125,
1063 -216, -3, 21, -216, -216, -216, -216, -216, -216, -216,
1064 -216, -216, -12, 77, -9, -216, -216, -216, -216, -216,
1065 -216, 78, -216, -216, -216, 604, -216, -216, -216, 604,
1066 604, 604, 604, 604, 604, 604, 604, -216, -216, -216,
1067 604, 604, 604, 604, -216, 111, 113, 114, -216, -216,
1068 -216, 115, 124, 126, -216, -216, -216, -216, -216, -216,
1069 -216, 131, 2, 575, -216, 373, 373, -216, 10, -216,
1070 -216, -216, -216, -216, 112, 137, 138, -216, -216, 47,
1071 -30, 2, 173, 176, 178, 186, -216, -216, 143, -216,
1072 -216, -216, -216, -216, -216, 127, -64, -64, 580, 598,
1073 -104, -104, -108, -108, 575, 575, 575, 575, -216, -98,
1074 -216, -216, -216, -47, -216, -216, -216, -49, -216, -216,
1075 -216, -216, 125, 125, -216, -216, -216, -216, -1, -216,
1076 156, -216, 111, -216, 115, -216, -216, -216, -216, -216,
1077 59, -216, -216, -216
1078 };
1079
1080 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
1081 Performed when YYTABLE does not specify something else to do. Zero
1082 means the default is an error. */
1083 static const yytype_uint8 yydefact[] =
1084 {
1085 4, 0, 51, 1, 0, 0, 0, 71, 72, 70,
1086 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1087 83, 84, 85, 86, 88, 87, 178, 113, 114, 0,
1088 0, 0, 0, 0, 0, 69, 172, 89, 90, 91,
1089 92, 116, 118, 119, 121, 123, 93, 94, 103, 95,
1090 96, 97, 98, 99, 100, 102, 101, 104, 105, 106,
1091 180, 142, 181, 182, 185, 186, 183, 184, 187, 188,
1092 189, 190, 191, 192, 107, 200, 201, 202, 203, 204,
1093 205, 206, 207, 208, 209, 210, 211, 212, 213, 24,
1094 0, 25, 2, 51, 51, 5, 0, 31, 0, 50,
1095 44, 124, 126, 0, 157, 156, 45, 46, 0, 48,
1096 0, 110, 111, 0, 127, 128, 129, 130, 147, 148,
1097 131, 149, 132, 0, 115, 117, 120, 122, 144, 143,
1098 0, 0, 170, 11, 10, 51, 51, 32, 0, 157,
1099 156, 15, 21, 18, 20, 22, 39, 12, 0, 0,
1100 13, 53, 52, 64, 68, 65, 66, 67, 36, 37,
1101 108, 109, 0, 0, 0, 58, 59, 60, 61, 62,
1102 63, 34, 35, 38, 125, 0, 151, 153, 155, 0,
1103 0, 0, 0, 0, 0, 0, 0, 150, 152, 154,
1104 0, 0, 0, 0, 197, 0, 0, 0, 47, 193,
1105 218, 0, 0, 0, 49, 214, 174, 173, 176, 177,
1106 175, 0, 0, 0, 7, 51, 51, 6, 156, 9,
1107 8, 40, 171, 179, 0, 0, 0, 23, 26, 30,
1108 0, 29, 0, 0, 0, 0, 137, 138, 134, 141,
1109 135, 145, 146, 136, 33, 0, 168, 169, 166, 165,
1110 160, 161, 162, 163, 164, 167, 42, 43, 198, 0,
1111 194, 195, 219, 0, 215, 216, 112, 156, 17, 16,
1112 19, 14, 0, 0, 55, 57, 54, 56, 0, 158,
1113 0, 196, 0, 217, 0, 27, 28, 139, 140, 133,
1114 0, 199, 220, 159
1115 };
1116
1117 /* YYPGOTO[NTERM-NUM]. */
1118 static const yytype_int16 yypgoto[] =
1119 {
1120 -216, -216, -216, 193, -34, -215, -90, -135, 7, -2,
1121 -216, -216, -80, -216, -216, -216, -216, 26, -216, 9,
1122 -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
1123 -43, 5, -26, -92, -216, -37, -216, -216, -216, -216,
1124 -175, -216, -216, -216, -216, -174, -216
1125 };
1126
1127 /* YYDEFGOTO[NTERM-NUM]. */
1128 static const yytype_int16 yydefgoto[] =
1129 {
1130 -1, 1, 2, 138, 135, 136, 227, 147, 148, 130,
1131 229, 230, 95, 96, 97, 98, 171, 172, 173, 131,
1132 100, 101, 174, 238, 289, 240, 102, 243, 120, 122,
1133 192, 193, 103, 104, 211, 105, 106, 107, 108, 198,
1134 199, 259, 109, 110, 204, 205, 263
1135 };
1136
1137 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
1138 positive, shift that token. If negative, reduce the rule whose
1139 number is the opposite. If YYTABLE_NINF, syntax error. */
1140 static const yytype_int16 yytable[] =
1141 {
1142 94, 224, 139, -41, 124, 125, 146, 126, 127, 93,
1143 -13, 99, 26, 137, 228, 273, 133, 134, 128, 118,
1144 258, 133, 185, 186, 3, 236, 221, 262, 241, 190,
1145 191, 281, 194, 190, 191, 129, 287, 111, 139, 123,
1146 123, 119, 123, 123, 282, 214, 219, 237, 284, 112,
1147 242, 176, 177, 178, 113, 217, 220, 140, 288, 150,
1148 183, 184, 185, 186, 132, 196, 116, 202, 206, 207,
1149 -29, -29, 133, 190, 191, 114, 200, 208, 209, 210,
1150 223, 228, 283, 153, 115, 155, 212, 156, 157, 133,
1151 134, 94, 94, 140, 149, 176, 177, 178, 218, 218,
1152 93, 93, 99, 99, 213, 91, 195, 291, 201, 117,
1153 292, 150, 231, 197, 121, 203, 232, 233, 175, 222,
1154 225, 123, -41, -41, 139, 91, 187, 188, 189, -13,
1155 -13, 223, -41, 216, 216, 137, 239, 175, 226, -13,
1156 234, 235, 215, 215, 99, 99, 149, 123, 194, 245,
1157 260, 261, 200, 246, 247, 248, 249, 250, 251, 252,
1158 253, 264, 26, 265, 254, 255, 256, 257, 266, 91,
1159 187, 188, 189, 268, 269, 270, 271, 274, 218, 267,
1160 275, 276, 285, 286, 141, 142, 143, 144, 145, 277,
1161 278, 179, 180, 290, 293, 92, 272, 244, 0, 0,
1162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1163 0, 0, 0, 216, 94, 0, 0, 0, 0, 0,
1164 0, 0, 215, 215, 99, 99, 0, 0, 0, 0,
1165 0, 0, 0, 0, 0, 150, 150, 0, 0, 176,
1166 177, 178, 0, 0, 0, 0, 89, 179, 180, 181,
1167 182, 183, 184, 185, 186, 91, 0, -3, 0, 0,
1168 0, 0, 279, 280, 190, 191, 0, 0, 4, 5,
1169 149, 149, 6, 7, 8, 9, 10, 11, 12, 13,
1170 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1171 24, 25, 0, 0, 26, 27, 28, 29, 30, 31,
1172 32, 33, 34, 0, 0, 181, 182, 183, 184, 185,
1173 186, 0, 35, 0, 187, 188, 189, 0, 0, 0,
1174 190, 191, 0, 36, 37, 38, 39, 40, 41, 42,
1175 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1176 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
1177 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1178 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1179 83, 84, 85, 86, 87, 88, 0, 0, 89, 0,
1180 0, 0, 90, 0, 4, 5, 0, 91, 6, 7,
1181 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1182 18, 19, 20, 21, 22, 23, 24, 25, 0, 0,
1183 26, 27, 28, 29, 30, 31, 32, 33, 34, 0,
1184 0, 0, 0, 0, 0, 0, 0, 0, 35, 0,
1185 0, 0, 141, 142, 143, 144, 145, 0, 0, 36,
1186 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
1187 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
1188 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1189 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1190 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1191 87, 88, 0, 0, 89, 0, 0, 0, 90, 0,
1192 4, 5, 0, 91, 6, 7, 8, 9, 10, 11,
1193 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1194 22, 23, 24, 25, 0, 0, 26, 27, 28, 29,
1195 30, 31, 32, 33, 34, 0, 0, 0, 0, 0,
1196 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
1197 0, 0, 0, 0, 0, 36, 37, 38, 39, 40,
1198 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1199 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
1200 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1201 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1202 81, 82, 83, 84, 85, 86, 87, 88, 0, 0,
1203 89, 0, 0, 0, 90, 0, 0, 0, 0, 91,
1204 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1205 17, 18, 19, 20, 21, 22, 23, 24, 25, 179,
1206 180, 26, 0, 0, 179, 180, 0, 0, 0, 0,
1207 0, 0, 0, 0, 0, 0, 0, 0, 0, 35,
1208 0, 0, 179, 180, 0, 0, 0, 0, 0, 0,
1209 36, 37, 38, 39, 40, 0, 0, 0, 0, 0,
1210 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1211 56, 57, 58, 59, 0, 0, 0, 181, 182, 183,
1212 184, 185, 186, 182, 183, 184, 185, 186, 74, 0,
1213 0, 0, 190, 191, 0, 0, 0, 190, 191, 0,
1214 0, 0, 183, 184, 185, 186, 0, 0, 0, 90,
1215 0, 0, 0, 0, 91, 190, 191, 151, 152, 153,
1216 154, 155, 0, 156, 157, 0, 0, 158, 159, 0,
1217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1218 0, 0, 0, 0, 0, 0, 0, 0, 0, 160,
1219 161, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1220 162, 163, 164, 165, 166, 167, 168, 169, 170
1221 };
1222
1223 static const yytype_int16 yycheck[] =
1224 {
1225 2, 8, 94, 0, 41, 42, 96, 44, 45, 2,
1226 0, 2, 37, 93, 149, 230, 119, 120, 42, 37,
1227 195, 119, 126, 127, 0, 37, 129, 201, 37, 137,
1228 138, 129, 37, 137, 138, 59, 37, 37, 130, 41,
1229 42, 59, 44, 45, 259, 135, 136, 59, 263, 37,
1230 59, 56, 57, 58, 37, 135, 136, 94, 59, 96,
1231 124, 125, 126, 127, 90, 108, 37, 110, 122, 123,
1232 119, 120, 119, 137, 138, 59, 37, 131, 132, 133,
1233 129, 216, 129, 5, 59, 7, 123, 9, 10, 119,
1234 120, 93, 94, 130, 96, 56, 57, 58, 135, 136,
1235 93, 94, 93, 94, 130, 130, 108, 282, 110, 37,
1236 284, 148, 149, 108, 59, 110, 119, 120, 134, 129,
1237 127, 123, 119, 120, 216, 130, 131, 132, 133, 119,
1238 120, 129, 129, 135, 136, 215, 59, 134, 127, 129,
1239 119, 120, 135, 136, 135, 136, 148, 149, 37, 175,
1240 37, 37, 37, 179, 180, 181, 182, 183, 184, 185,
1241 186, 37, 37, 37, 190, 191, 192, 193, 37, 130,
1242 131, 132, 133, 61, 37, 37, 129, 4, 215, 216,
1243 4, 3, 272, 273, 59, 60, 61, 62, 63, 3,
1244 47, 64, 65, 37, 135, 2, 230, 171, -1, -1,
1245 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1246 -1, -1, -1, 215, 216, -1, -1, -1, -1, -1,
1247 -1, -1, 215, 216, 215, 216, -1, -1, -1, -1,
1248 -1, -1, -1, -1, -1, 272, 273, -1, -1, 56,
1249 57, 58, -1, -1, -1, -1, 121, 64, 65, 122,
1250 123, 124, 125, 126, 127, 130, -1, 0, -1, -1,
1251 -1, -1, 135, 136, 137, 138, -1, -1, 11, 12,
1252 272, 273, 15, 16, 17, 18, 19, 20, 21, 22,
1253 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1254 33, 34, -1, -1, 37, 38, 39, 40, 41, 42,
1255 43, 44, 45, -1, -1, 122, 123, 124, 125, 126,
1256 127, -1, 55, -1, 131, 132, 133, -1, -1, -1,
1257 137, 138, -1, 66, 67, 68, 69, 70, 71, 72,
1258 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1259 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
1260 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1261 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
1262 113, 114, 115, 116, 117, 118, -1, -1, 121, -1,
1263 -1, -1, 125, -1, 11, 12, -1, 130, 15, 16,
1264 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1265 27, 28, 29, 30, 31, 32, 33, 34, -1, -1,
1266 37, 38, 39, 40, 41, 42, 43, 44, 45, -1,
1267 -1, -1, -1, -1, -1, -1, -1, -1, 55, -1,
1268 -1, -1, 59, 60, 61, 62, 63, -1, -1, 66,
1269 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
1270 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1271 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
1272 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
1273 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1274 117, 118, -1, -1, 121, -1, -1, -1, 125, -1,
1275 11, 12, -1, 130, 15, 16, 17, 18, 19, 20,
1276 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1277 31, 32, 33, 34, -1, -1, 37, 38, 39, 40,
1278 41, 42, 43, 44, 45, -1, -1, -1, -1, -1,
1279 -1, -1, -1, -1, 55, -1, -1, -1, -1, -1,
1280 -1, -1, -1, -1, -1, 66, 67, 68, 69, 70,
1281 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1282 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
1283 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
1284 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
1285 111, 112, 113, 114, 115, 116, 117, 118, -1, -1,
1286 121, -1, -1, -1, 125, -1, -1, -1, -1, 130,
1287 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1288 26, 27, 28, 29, 30, 31, 32, 33, 34, 64,
1289 65, 37, -1, -1, 64, 65, -1, -1, -1, -1,
1290 -1, -1, -1, -1, -1, -1, -1, -1, -1, 55,
1291 -1, -1, 64, 65, -1, -1, -1, -1, -1, -1,
1292 66, 67, 68, 69, 70, -1, -1, -1, -1, -1,
1293 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1294 86, 87, 88, 89, -1, -1, -1, 122, 123, 124,
1295 125, 126, 127, 123, 124, 125, 126, 127, 104, -1,
1296 -1, -1, 137, 138, -1, -1, -1, 137, 138, -1,
1297 -1, -1, 124, 125, 126, 127, -1, -1, -1, 125,
1298 -1, -1, -1, -1, 130, 137, 138, 3, 4, 5,
1299 6, 7, -1, 9, 10, -1, -1, 13, 14, -1,
1300 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1301 -1, -1, -1, -1, -1, -1, -1, -1, -1, 35,
1302 36, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1303 46, 47, 48, 49, 50, 51, 52, 53, 54
1304 };
1305
1306 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1307 symbol of state STATE-NUM. */
1308 static const yytype_uint8 yystos[] =
1309 {
1310 0, 140, 141, 0, 11, 12, 15, 16, 17, 18,
1311 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1312 29, 30, 31, 32, 33, 34, 37, 38, 39, 40,
1313 41, 42, 43, 44, 45, 55, 66, 67, 68, 69,
1314 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1315 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1316 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
1317 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
1318 110, 111, 112, 113, 114, 115, 116, 117, 118, 121,
1319 125, 130, 142, 147, 148, 151, 152, 153, 154, 158,
1320 159, 160, 165, 171, 172, 174, 175, 176, 177, 181,
1321 182, 37, 37, 37, 59, 59, 37, 37, 37, 59,
1322 167, 59, 168, 148, 174, 174, 174, 174, 42, 59,
1323 148, 158, 171, 119, 120, 143, 144, 151, 142, 172,
1324 174, 59, 60, 61, 62, 63, 145, 146, 147, 148,
1325 174, 3, 4, 5, 6, 7, 9, 10, 13, 14,
1326 35, 36, 46, 47, 48, 49, 50, 51, 52, 53,
1327 54, 155, 156, 157, 161, 134, 56, 57, 58, 64,
1328 65, 122, 123, 124, 125, 126, 127, 131, 132, 133,
1329 137, 138, 169, 170, 37, 148, 169, 170, 178, 179,
1330 37, 148, 169, 170, 183, 184, 122, 123, 131, 132,
1331 133, 173, 174, 171, 145, 147, 148, 151, 174, 145,
1332 151, 129, 129, 129, 8, 127, 127, 145, 146, 149,
1333 150, 174, 119, 120, 119, 120, 37, 59, 162, 59,
1334 164, 37, 59, 166, 156, 171, 171, 171, 171, 171,
1335 171, 171, 171, 171, 171, 171, 171, 171, 179, 180,
1336 37, 37, 184, 185, 37, 37, 37, 174, 61, 37,
1337 37, 129, 143, 144, 4, 4, 3, 3, 47, 135,
1338 136, 129, 144, 129, 144, 145, 145, 37, 59, 163,
1339 37, 179, 184, 135
1340 };
1341
1342 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1343 static const yytype_uint8 yyr1[] =
1344 {
1345 0, 139, 140, 140, 141, 142, 142, 142, 142, 142,
1346 143, 144, 145, 145, 145, 146, 146, 146, 146, 146,
1347 146, 146, 146, 146, 147, 148, 149, 149, 149, 150,
1348 150, 151, 151, 152, 152, 152, 152, 152, 152, 153,
1349 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
1350 154, 154, 155, 155, 155, 155, 155, 155, 155, 155,
1351 155, 155, 155, 155, 156, 156, 156, 156, 157, 158,
1352 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
1353 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
1354 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
1355 158, 158, 158, 158, 158, 158, 158, 158, 159, 159,
1356 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
1357 159, 159, 159, 159, 159, 159, 159, 160, 160, 160,
1358 160, 160, 160, 161, 161, 161, 161, 162, 162, 163,
1359 163, 164, 165, 165, 165, 166, 166, 167, 167, 168,
1360 169, 169, 169, 170, 170, 170, 171, 171, 172, 172,
1361 172, 172, 172, 172, 172, 172, 172, 172, 172, 172,
1362 172, 172, 172, 173, 173, 173, 173, 173, 174, 174,
1363 175, 175, 175, 175, 175, 175, 175, 176, 176, 176,
1364 176, 177, 177, 178, 178, 178, 178, 179, 180, 180,
1365 181, 181, 181, 181, 181, 181, 182, 182, 182, 182,
1366 182, 182, 182, 182, 183, 183, 183, 183, 184, 185,
1367 185
1368 };
1369
1370 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1371 static const yytype_uint8 yyr2[] =
1372 {
1373 0, 2, 2, 1, 0, 1, 3, 3, 3, 3,
1374 1, 1, 1, 1, 3, 1, 3, 3, 1, 3,
1375 1, 1, 1, 2, 1, 1, 1, 3, 3, 1,
1376 1, 1, 2, 3, 2, 2, 2, 2, 2, 2,
1377 3, 1, 3, 3, 1, 1, 1, 2, 1, 2,
1378 1, 0, 1, 1, 3, 3, 3, 3, 1, 1,
1379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1383 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
1384 2, 2, 4, 1, 1, 2, 1, 2, 1, 1,
1385 2, 1, 2, 1, 1, 2, 1, 2, 2, 2,
1386 2, 2, 2, 4, 2, 2, 2, 1, 1, 1,
1387 1, 1, 1, 2, 2, 1, 1, 1, 1, 1,
1388 1, 1, 1, 1, 1, 1, 1, 1, 4, 6,
1389 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1390 2, 3, 1, 1, 1, 1, 1, 1, 1, 3,
1391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1392 1, 1, 1, 1, 2, 2, 3, 1, 1, 3,
1393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1394 1, 1, 1, 1, 1, 2, 2, 3, 1, 1,
1395 3
1396 };
1397
1398
1399 #define yyerrok (yyerrstatus = 0)
1400 #define yyclearin (yychar = YYEMPTY)
1401 #define YYEMPTY (-2)
1402 #define YYEOF 0
1403
1404 #define YYACCEPT goto yyacceptlab
1405 #define YYABORT goto yyabortlab
1406 #define YYERROR goto yyerrorlab
1407
1408
1409 #define YYRECOVERING() (!!yyerrstatus)
1410
1411 #define YYBACKUP(Token, Value) \
1412 do \
1413 if (yychar == YYEMPTY) \
1414 { \
1415 yychar = (Token); \
1416 yylval = (Value); \
1417 YYPOPSTACK (yylen); \
1418 yystate = *yyssp; \
1419 goto yybackup; \
1420 } \
1421 else \
1422 { \
1423 yyerror (yyscanner, cstate, YY_("syntax error: cannot back up")); \
1424 YYERROR; \
1425 } \
1426 while (0)
1427
1428 /* Error token number */
1429 #define YYTERROR 1
1430 #define YYERRCODE 256
1431
1432
1433
1434 /* Enable debugging if requested. */
1435 #if YYDEBUG
1436
1437 # ifndef YYFPRINTF
1438 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1439 # define YYFPRINTF fprintf
1440 # endif
1441
1442 # define YYDPRINTF(Args) \
1443 do { \
1444 if (yydebug) \
1445 YYFPRINTF Args; \
1446 } while (0)
1447
1448 /* This macro is provided for backward compatibility. */
1449 #ifndef YY_LOCATION_PRINT
1450 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1451 #endif
1452
1453
1454 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1455 do { \
1456 if (yydebug) \
1457 { \
1458 YYFPRINTF (stderr, "%s ", Title); \
1459 yy_symbol_print (stderr, \
1460 Type, Value, yyscanner, cstate); \
1461 YYFPRINTF (stderr, "\n"); \
1462 } \
1463 } while (0)
1464
1465
1466 /*----------------------------------------.
1467 | Print this symbol's value on YYOUTPUT. |
1468 `----------------------------------------*/
1469
1470 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep,void * yyscanner,compiler_state_t * cstate)1471 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate)
1472 {
1473 FILE *yyo = yyoutput;
1474 YYUSE (yyo);
1475 YYUSE (yyscanner);
1476 YYUSE (cstate);
1477 if (!yyvaluep)
1478 return;
1479 # ifdef YYPRINT
1480 if (yytype < YYNTOKENS)
1481 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1482 # endif
1483 YYUSE (yytype);
1484 }
1485
1486
1487 /*--------------------------------.
1488 | Print this symbol on YYOUTPUT. |
1489 `--------------------------------*/
1490
1491 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep,void * yyscanner,compiler_state_t * cstate)1492 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *yyscanner, compiler_state_t *cstate)
1493 {
1494 YYFPRINTF (yyoutput, "%s %s (",
1495 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1496
1497 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner, cstate);
1498 YYFPRINTF (yyoutput, ")");
1499 }
1500
1501 /*------------------------------------------------------------------.
1502 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1503 | TOP (included). |
1504 `------------------------------------------------------------------*/
1505
1506 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)1507 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1508 {
1509 YYFPRINTF (stderr, "Stack now");
1510 for (; yybottom <= yytop; yybottom++)
1511 {
1512 int yybot = *yybottom;
1513 YYFPRINTF (stderr, " %d", yybot);
1514 }
1515 YYFPRINTF (stderr, "\n");
1516 }
1517
1518 # define YY_STACK_PRINT(Bottom, Top) \
1519 do { \
1520 if (yydebug) \
1521 yy_stack_print ((Bottom), (Top)); \
1522 } while (0)
1523
1524
1525 /*------------------------------------------------.
1526 | Report that the YYRULE is going to be reduced. |
1527 `------------------------------------------------*/
1528
1529 static void
yy_reduce_print(yytype_int16 * yyssp,YYSTYPE * yyvsp,int yyrule,void * yyscanner,compiler_state_t * cstate)1530 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void *yyscanner, compiler_state_t *cstate)
1531 {
1532 unsigned long int yylno = yyrline[yyrule];
1533 int yynrhs = yyr2[yyrule];
1534 int yyi;
1535 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1536 yyrule - 1, yylno);
1537 /* The symbols being reduced. */
1538 for (yyi = 0; yyi < yynrhs; yyi++)
1539 {
1540 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1541 yy_symbol_print (stderr,
1542 yystos[yyssp[yyi + 1 - yynrhs]],
1543 &(yyvsp[(yyi + 1) - (yynrhs)])
1544 , yyscanner, cstate);
1545 YYFPRINTF (stderr, "\n");
1546 }
1547 }
1548
1549 # define YY_REDUCE_PRINT(Rule) \
1550 do { \
1551 if (yydebug) \
1552 yy_reduce_print (yyssp, yyvsp, Rule, yyscanner, cstate); \
1553 } while (0)
1554
1555 /* Nonzero means print parse trace. It is left uninitialized so that
1556 multiple parsers can coexist. */
1557 int yydebug;
1558 #else /* !YYDEBUG */
1559 # define YYDPRINTF(Args)
1560 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1561 # define YY_STACK_PRINT(Bottom, Top)
1562 # define YY_REDUCE_PRINT(Rule)
1563 #endif /* !YYDEBUG */
1564
1565
1566 /* YYINITDEPTH -- initial size of the parser's stacks. */
1567 #ifndef YYINITDEPTH
1568 # define YYINITDEPTH 200
1569 #endif
1570
1571 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1572 if the built-in stack extension method is used).
1573
1574 Do not make this value too large; the results are undefined if
1575 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1576 evaluated with infinite-precision integer arithmetic. */
1577
1578 #ifndef YYMAXDEPTH
1579 # define YYMAXDEPTH 10000
1580 #endif
1581
1582
1583 #if YYERROR_VERBOSE
1584
1585 # ifndef yystrlen
1586 # if defined __GLIBC__ && defined _STRING_H
1587 # define yystrlen strlen
1588 # else
1589 /* Return the length of YYSTR. */
1590 static YYSIZE_T
yystrlen(const char * yystr)1591 yystrlen (const char *yystr)
1592 {
1593 YYSIZE_T yylen;
1594 for (yylen = 0; yystr[yylen]; yylen++)
1595 continue;
1596 return yylen;
1597 }
1598 # endif
1599 # endif
1600
1601 # ifndef yystpcpy
1602 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1603 # define yystpcpy stpcpy
1604 # else
1605 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1606 YYDEST. */
1607 static char *
yystpcpy(char * yydest,const char * yysrc)1608 yystpcpy (char *yydest, const char *yysrc)
1609 {
1610 char *yyd = yydest;
1611 const char *yys = yysrc;
1612
1613 while ((*yyd++ = *yys++) != '\0')
1614 continue;
1615
1616 return yyd - 1;
1617 }
1618 # endif
1619 # endif
1620
1621 # ifndef yytnamerr
1622 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1623 quotes and backslashes, so that it's suitable for yyerror. The
1624 heuristic is that double-quoting is unnecessary unless the string
1625 contains an apostrophe, a comma, or backslash (other than
1626 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1627 null, do not copy; instead, return the length of what the result
1628 would have been. */
1629 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1630 yytnamerr (char *yyres, const char *yystr)
1631 {
1632 if (*yystr == '"')
1633 {
1634 YYSIZE_T yyn = 0;
1635 char const *yyp = yystr;
1636
1637 for (;;)
1638 switch (*++yyp)
1639 {
1640 case '\'':
1641 case ',':
1642 goto do_not_strip_quotes;
1643
1644 case '\\':
1645 if (*++yyp != '\\')
1646 goto do_not_strip_quotes;
1647 /* Fall through. */
1648 default:
1649 if (yyres)
1650 yyres[yyn] = *yyp;
1651 yyn++;
1652 break;
1653
1654 case '"':
1655 if (yyres)
1656 yyres[yyn] = '\0';
1657 return yyn;
1658 }
1659 do_not_strip_quotes: ;
1660 }
1661
1662 if (! yyres)
1663 return yystrlen (yystr);
1664
1665 return yystpcpy (yyres, yystr) - yyres;
1666 }
1667 # endif
1668
1669 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1670 about the unexpected token YYTOKEN for the state stack whose top is
1671 YYSSP.
1672
1673 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1674 not large enough to hold the message. In that case, also set
1675 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1676 required number of bytes is too large to store. */
1677 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)1678 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1679 yytype_int16 *yyssp, int yytoken)
1680 {
1681 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1682 YYSIZE_T yysize = yysize0;
1683 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1684 /* Internationalized format string. */
1685 const char *yyformat = YY_NULLPTR;
1686 /* Arguments of yyformat. */
1687 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1688 /* Number of reported tokens (one for the "unexpected", one per
1689 "expected"). */
1690 int yycount = 0;
1691
1692 /* There are many possibilities here to consider:
1693 - If this state is a consistent state with a default action, then
1694 the only way this function was invoked is if the default action
1695 is an error action. In that case, don't check for expected
1696 tokens because there are none.
1697 - The only way there can be no lookahead present (in yychar) is if
1698 this state is a consistent state with a default action. Thus,
1699 detecting the absence of a lookahead is sufficient to determine
1700 that there is no unexpected or expected token to report. In that
1701 case, just report a simple "syntax error".
1702 - Don't assume there isn't a lookahead just because this state is a
1703 consistent state with a default action. There might have been a
1704 previous inconsistent state, consistent state with a non-default
1705 action, or user semantic action that manipulated yychar.
1706 - Of course, the expected token list depends on states to have
1707 correct lookahead information, and it depends on the parser not
1708 to perform extra reductions after fetching a lookahead from the
1709 scanner and before detecting a syntax error. Thus, state merging
1710 (from LALR or IELR) and default reductions corrupt the expected
1711 token list. However, the list is correct for canonical LR with
1712 one exception: it will still contain any token that will not be
1713 accepted due to an error action in a later state.
1714 */
1715 if (yytoken != YYEMPTY)
1716 {
1717 int yyn = yypact[*yyssp];
1718 yyarg[yycount++] = yytname[yytoken];
1719 if (!yypact_value_is_default (yyn))
1720 {
1721 /* Start YYX at -YYN if negative to avoid negative indexes in
1722 YYCHECK. In other words, skip the first -YYN actions for
1723 this state because they are default actions. */
1724 int yyxbegin = yyn < 0 ? -yyn : 0;
1725 /* Stay within bounds of both yycheck and yytname. */
1726 int yychecklim = YYLAST - yyn + 1;
1727 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1728 int yyx;
1729
1730 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1731 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1732 && !yytable_value_is_error (yytable[yyx + yyn]))
1733 {
1734 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1735 {
1736 yycount = 1;
1737 yysize = yysize0;
1738 break;
1739 }
1740 yyarg[yycount++] = yytname[yyx];
1741 {
1742 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1743 if (! (yysize <= yysize1
1744 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1745 return 2;
1746 yysize = yysize1;
1747 }
1748 }
1749 }
1750 }
1751
1752 switch (yycount)
1753 {
1754 # define YYCASE_(N, S) \
1755 case N: \
1756 yyformat = S; \
1757 break
1758 YYCASE_(0, YY_("syntax error"));
1759 YYCASE_(1, YY_("syntax error, unexpected %s"));
1760 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1761 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1762 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1763 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1764 # undef YYCASE_
1765 }
1766
1767 {
1768 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1769 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1770 return 2;
1771 yysize = yysize1;
1772 }
1773
1774 if (*yymsg_alloc < yysize)
1775 {
1776 *yymsg_alloc = 2 * yysize;
1777 if (! (yysize <= *yymsg_alloc
1778 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1779 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1780 return 1;
1781 }
1782
1783 /* Avoid sprintf, as that infringes on the user's name space.
1784 Don't have undefined behavior even if the translation
1785 produced a string with the wrong number of "%s"s. */
1786 {
1787 char *yyp = *yymsg;
1788 int yyi = 0;
1789 while ((*yyp = *yyformat) != '\0')
1790 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1791 {
1792 yyp += yytnamerr (yyp, yyarg[yyi++]);
1793 yyformat += 2;
1794 }
1795 else
1796 {
1797 yyp++;
1798 yyformat++;
1799 }
1800 }
1801 return 0;
1802 }
1803 #endif /* YYERROR_VERBOSE */
1804
1805 /*-----------------------------------------------.
1806 | Release the memory associated to this symbol. |
1807 `-----------------------------------------------*/
1808
1809 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep,void * yyscanner,compiler_state_t * cstate)1810 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *yyscanner, compiler_state_t *cstate)
1811 {
1812 YYUSE (yyvaluep);
1813 YYUSE (yyscanner);
1814 YYUSE (cstate);
1815 if (!yymsg)
1816 yymsg = "Deleting";
1817 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1818
1819 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1820 YYUSE (yytype);
1821 YY_IGNORE_MAYBE_UNINITIALIZED_END
1822 }
1823
1824
1825
1826
1827 /*----------.
1828 | yyparse. |
1829 `----------*/
1830
1831 int
yyparse(void * yyscanner,compiler_state_t * cstate)1832 yyparse (void *yyscanner, compiler_state_t *cstate)
1833 {
1834 /* The lookahead symbol. */
1835 int yychar;
1836
1837
1838 /* The semantic value of the lookahead symbol. */
1839 /* Default value used for initialization, for pacifying older GCCs
1840 or non-GCC compilers. */
1841 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1842 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1843
1844 /* Number of syntax errors so far. */
1845 int yynerrs;
1846
1847 int yystate;
1848 /* Number of tokens to shift before error messages enabled. */
1849 int yyerrstatus;
1850
1851 /* The stacks and their tools:
1852 'yyss': related to states.
1853 'yyvs': related to semantic values.
1854
1855 Refer to the stacks through separate pointers, to allow yyoverflow
1856 to reallocate them elsewhere. */
1857
1858 /* The state stack. */
1859 yytype_int16 yyssa[YYINITDEPTH];
1860 yytype_int16 *yyss;
1861 yytype_int16 *yyssp;
1862
1863 /* The semantic value stack. */
1864 YYSTYPE yyvsa[YYINITDEPTH];
1865 YYSTYPE *yyvs;
1866 YYSTYPE *yyvsp;
1867
1868 YYSIZE_T yystacksize;
1869
1870 int yyn;
1871 int yyresult;
1872 /* Lookahead token as an internal (translated) token number. */
1873 int yytoken = 0;
1874 /* The variables used to return semantic value and location from the
1875 action routines. */
1876 YYSTYPE yyval;
1877
1878 #if YYERROR_VERBOSE
1879 /* Buffer for error messages, and its allocated size. */
1880 char yymsgbuf[128];
1881 char *yymsg = yymsgbuf;
1882 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1883 #endif
1884
1885 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1886
1887 /* The number of symbols on the RHS of the reduced rule.
1888 Keep to zero when no symbol should be popped. */
1889 int yylen = 0;
1890
1891 yyssp = yyss = yyssa;
1892 yyvsp = yyvs = yyvsa;
1893 yystacksize = YYINITDEPTH;
1894
1895 YYDPRINTF ((stderr, "Starting parse\n"));
1896
1897 yystate = 0;
1898 yyerrstatus = 0;
1899 yynerrs = 0;
1900 yychar = YYEMPTY; /* Cause a token to be read. */
1901 goto yysetstate;
1902
1903 /*------------------------------------------------------------.
1904 | yynewstate -- Push a new state, which is found in yystate. |
1905 `------------------------------------------------------------*/
1906 yynewstate:
1907 /* In all cases, when you get here, the value and location stacks
1908 have just been pushed. So pushing a state here evens the stacks. */
1909 yyssp++;
1910
1911 yysetstate:
1912 *yyssp = yystate;
1913
1914 if (yyss + yystacksize - 1 <= yyssp)
1915 {
1916 /* Get the current used size of the three stacks, in elements. */
1917 YYSIZE_T yysize = yyssp - yyss + 1;
1918
1919 #ifdef yyoverflow
1920 {
1921 /* Give user a chance to reallocate the stack. Use copies of
1922 these so that the &'s don't force the real ones into
1923 memory. */
1924 YYSTYPE *yyvs1 = yyvs;
1925 yytype_int16 *yyss1 = yyss;
1926
1927 /* Each stack pointer address is followed by the size of the
1928 data in use in that stack, in bytes. This used to be a
1929 conditional around just the two extra args, but that might
1930 be undefined if yyoverflow is a macro. */
1931 yyoverflow (YY_("memory exhausted"),
1932 &yyss1, yysize * sizeof (*yyssp),
1933 &yyvs1, yysize * sizeof (*yyvsp),
1934 &yystacksize);
1935
1936 yyss = yyss1;
1937 yyvs = yyvs1;
1938 }
1939 #else /* no yyoverflow */
1940 # ifndef YYSTACK_RELOCATE
1941 goto yyexhaustedlab;
1942 # else
1943 /* Extend the stack our own way. */
1944 if (YYMAXDEPTH <= yystacksize)
1945 goto yyexhaustedlab;
1946 yystacksize *= 2;
1947 if (YYMAXDEPTH < yystacksize)
1948 yystacksize = YYMAXDEPTH;
1949
1950 {
1951 yytype_int16 *yyss1 = yyss;
1952 union yyalloc *yyptr =
1953 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1954 if (! yyptr)
1955 goto yyexhaustedlab;
1956 YYSTACK_RELOCATE (yyss_alloc, yyss);
1957 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1958 # undef YYSTACK_RELOCATE
1959 if (yyss1 != yyssa)
1960 YYSTACK_FREE (yyss1);
1961 }
1962 # endif
1963 #endif /* no yyoverflow */
1964
1965 yyssp = yyss + yysize - 1;
1966 yyvsp = yyvs + yysize - 1;
1967
1968 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1969 (unsigned long int) yystacksize));
1970
1971 if (yyss + yystacksize - 1 <= yyssp)
1972 YYABORT;
1973 }
1974
1975 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1976
1977 if (yystate == YYFINAL)
1978 YYACCEPT;
1979
1980 goto yybackup;
1981
1982 /*-----------.
1983 | yybackup. |
1984 `-----------*/
1985 yybackup:
1986
1987 /* Do appropriate processing given the current state. Read a
1988 lookahead token if we need one and don't already have one. */
1989
1990 /* First try to decide what to do without reference to lookahead token. */
1991 yyn = yypact[yystate];
1992 if (yypact_value_is_default (yyn))
1993 goto yydefault;
1994
1995 /* Not known => get a lookahead token if don't already have one. */
1996
1997 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1998 if (yychar == YYEMPTY)
1999 {
2000 YYDPRINTF ((stderr, "Reading a token: "));
2001 yychar = yylex (&yylval, yyscanner);
2002 }
2003
2004 if (yychar <= YYEOF)
2005 {
2006 yychar = yytoken = YYEOF;
2007 YYDPRINTF ((stderr, "Now at end of input.\n"));
2008 }
2009 else
2010 {
2011 yytoken = YYTRANSLATE (yychar);
2012 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2013 }
2014
2015 /* If the proper action on seeing token YYTOKEN is to reduce or to
2016 detect an error, take that action. */
2017 yyn += yytoken;
2018 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2019 goto yydefault;
2020 yyn = yytable[yyn];
2021 if (yyn <= 0)
2022 {
2023 if (yytable_value_is_error (yyn))
2024 goto yyerrlab;
2025 yyn = -yyn;
2026 goto yyreduce;
2027 }
2028
2029 /* Count tokens shifted since error; after three, turn off error
2030 status. */
2031 if (yyerrstatus)
2032 yyerrstatus--;
2033
2034 /* Shift the lookahead token. */
2035 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2036
2037 /* Discard the shifted token. */
2038 yychar = YYEMPTY;
2039
2040 yystate = yyn;
2041 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2042 *++yyvsp = yylval;
2043 YY_IGNORE_MAYBE_UNINITIALIZED_END
2044
2045 goto yynewstate;
2046
2047
2048 /*-----------------------------------------------------------.
2049 | yydefault -- do the default action for the current state. |
2050 `-----------------------------------------------------------*/
2051 yydefault:
2052 yyn = yydefact[yystate];
2053 if (yyn == 0)
2054 goto yyerrlab;
2055 goto yyreduce;
2056
2057
2058 /*-----------------------------.
2059 | yyreduce -- Do a reduction. |
2060 `-----------------------------*/
2061 yyreduce:
2062 /* yyn is the number of a rule to reduce with. */
2063 yylen = yyr2[yyn];
2064
2065 /* If YYLEN is nonzero, implement the default value of the action:
2066 '$$ = $1'.
2067
2068 Otherwise, the following line sets YYVAL to garbage.
2069 This behavior is undocumented and Bison
2070 users should not rely upon it. Assigning to YYVAL
2071 unconditionally makes the parser a bit smaller, and it avoids a
2072 GCC warning that YYVAL may be used uninitialized. */
2073 yyval = yyvsp[1-yylen];
2074
2075
2076 YY_REDUCE_PRINT (yyn);
2077 switch (yyn)
2078 {
2079 case 2:
2080 #line 361 "grammar.y" /* yacc.c:1646 */
2081 {
2082 finish_parse(cstate, (yyvsp[0].blk).b);
2083 }
2084 #line 2085 "grammar.c" /* yacc.c:1646 */
2085 break;
2086
2087 case 4:
2088 #line 366 "grammar.y" /* yacc.c:1646 */
2089 { (yyval.blk).q = qerr; }
2090 #line 2091 "grammar.c" /* yacc.c:1646 */
2091 break;
2092
2093 case 6:
2094 #line 369 "grammar.y" /* yacc.c:1646 */
2095 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2096 #line 2097 "grammar.c" /* yacc.c:1646 */
2097 break;
2098
2099 case 7:
2100 #line 370 "grammar.y" /* yacc.c:1646 */
2101 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2102 #line 2103 "grammar.c" /* yacc.c:1646 */
2103 break;
2104
2105 case 8:
2106 #line 371 "grammar.y" /* yacc.c:1646 */
2107 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2108 #line 2109 "grammar.c" /* yacc.c:1646 */
2109 break;
2110
2111 case 9:
2112 #line 372 "grammar.y" /* yacc.c:1646 */
2113 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2114 #line 2115 "grammar.c" /* yacc.c:1646 */
2115 break;
2116
2117 case 10:
2118 #line 374 "grammar.y" /* yacc.c:1646 */
2119 { (yyval.blk) = (yyvsp[-1].blk); }
2120 #line 2121 "grammar.c" /* yacc.c:1646 */
2121 break;
2122
2123 case 11:
2124 #line 376 "grammar.y" /* yacc.c:1646 */
2125 { (yyval.blk) = (yyvsp[-1].blk); }
2126 #line 2127 "grammar.c" /* yacc.c:1646 */
2127 break;
2128
2129 case 13:
2130 #line 379 "grammar.y" /* yacc.c:1646 */
2131 { (yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i),
2132 (yyval.blk).q = (yyvsp[-1].blk).q); }
2133 #line 2134 "grammar.c" /* yacc.c:1646 */
2134 break;
2135
2136 case 14:
2137 #line 381 "grammar.y" /* yacc.c:1646 */
2138 { (yyval.blk) = (yyvsp[-1].blk); }
2139 #line 2140 "grammar.c" /* yacc.c:1646 */
2140 break;
2141
2142 case 15:
2143 #line 383 "grammar.y" /* yacc.c:1646 */
2144 { (yyval.blk).b = gen_scode(cstate, (yyvsp[0].s), (yyval.blk).q = (yyvsp[-1].blk).q); }
2145 #line 2146 "grammar.c" /* yacc.c:1646 */
2146 break;
2147
2148 case 16:
2149 #line 384 "grammar.y" /* yacc.c:1646 */
2150 { (yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i),
2151 (yyval.blk).q = (yyvsp[-3].blk).q); }
2152 #line 2153 "grammar.c" /* yacc.c:1646 */
2153 break;
2154
2155 case 17:
2156 #line 386 "grammar.y" /* yacc.c:1646 */
2157 { (yyval.blk).b = gen_mcode(cstate, (yyvsp[-2].s), (yyvsp[0].s), 0,
2158 (yyval.blk).q = (yyvsp[-3].blk).q); }
2159 #line 2160 "grammar.c" /* yacc.c:1646 */
2160 break;
2161
2162 case 18:
2163 #line 388 "grammar.y" /* yacc.c:1646 */
2164 {
2165 /* Decide how to parse HID based on proto */
2166 (yyval.blk).q = (yyvsp[-1].blk).q;
2167 if ((yyval.blk).q.addr == Q_PORT)
2168 bpf_error(cstate, "'port' modifier applied to ip host");
2169 else if ((yyval.blk).q.addr == Q_PORTRANGE)
2170 bpf_error(cstate, "'portrange' modifier applied to ip host");
2171 else if ((yyval.blk).q.addr == Q_PROTO)
2172 bpf_error(cstate, "'proto' modifier applied to ip host");
2173 else if ((yyval.blk).q.addr == Q_PROTOCHAIN)
2174 bpf_error(cstate, "'protochain' modifier applied to ip host");
2175 (yyval.blk).b = gen_ncode(cstate, (yyvsp[0].s), 0, (yyval.blk).q);
2176 }
2177 #line 2178 "grammar.c" /* yacc.c:1646 */
2178 break;
2179
2180 case 19:
2181 #line 401 "grammar.y" /* yacc.c:1646 */
2182 {
2183 #ifdef INET6
2184 (yyval.blk).b = gen_mcode6(cstate, (yyvsp[-2].s), NULL, (yyvsp[0].i),
2185 (yyval.blk).q = (yyvsp[-3].blk).q);
2186 #else
2187 bpf_error(cstate, "'ip6addr/prefixlen' not supported "
2188 "in this configuration");
2189 #endif /*INET6*/
2190 }
2191 #line 2192 "grammar.c" /* yacc.c:1646 */
2192 break;
2193
2194 case 20:
2195 #line 410 "grammar.y" /* yacc.c:1646 */
2196 {
2197 #ifdef INET6
2198 (yyval.blk).b = gen_mcode6(cstate, (yyvsp[0].s), 0, 128,
2199 (yyval.blk).q = (yyvsp[-1].blk).q);
2200 #else
2201 bpf_error(cstate, "'ip6addr' not supported "
2202 "in this configuration");
2203 #endif /*INET6*/
2204 }
2205 #line 2206 "grammar.c" /* yacc.c:1646 */
2206 break;
2207
2208 case 21:
2209 #line 419 "grammar.y" /* yacc.c:1646 */
2210 {
2211 (yyval.blk).b = gen_ecode(cstate, (yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q);
2212 /*
2213 * $1 was allocated by "pcap_ether_aton()",
2214 * so we must free it now that we're done
2215 * with it.
2216 */
2217 free((yyvsp[0].e));
2218 }
2219 #line 2220 "grammar.c" /* yacc.c:1646 */
2220 break;
2221
2222 case 22:
2223 #line 428 "grammar.y" /* yacc.c:1646 */
2224 {
2225 (yyval.blk).b = gen_acode(cstate, (yyvsp[0].e), (yyval.blk).q = (yyvsp[-1].blk).q);
2226 /*
2227 * $1 was allocated by "pcap_ether_aton()",
2228 * so we must free it now that we're done
2229 * with it.
2230 */
2231 free((yyvsp[0].e));
2232 }
2233 #line 2234 "grammar.c" /* yacc.c:1646 */
2234 break;
2235
2236 case 23:
2237 #line 437 "grammar.y" /* yacc.c:1646 */
2238 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2239 #line 2240 "grammar.c" /* yacc.c:1646 */
2240 break;
2241
2242 case 24:
2243 #line 439 "grammar.y" /* yacc.c:1646 */
2244 { (yyval.blk) = (yyvsp[-1].blk); }
2245 #line 2246 "grammar.c" /* yacc.c:1646 */
2246 break;
2247
2248 case 25:
2249 #line 441 "grammar.y" /* yacc.c:1646 */
2250 { (yyval.blk) = (yyvsp[-1].blk); }
2251 #line 2252 "grammar.c" /* yacc.c:1646 */
2252 break;
2253
2254 case 27:
2255 #line 444 "grammar.y" /* yacc.c:1646 */
2256 { gen_and((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2257 #line 2258 "grammar.c" /* yacc.c:1646 */
2258 break;
2259
2260 case 28:
2261 #line 445 "grammar.y" /* yacc.c:1646 */
2262 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2263 #line 2264 "grammar.c" /* yacc.c:1646 */
2264 break;
2265
2266 case 29:
2267 #line 447 "grammar.y" /* yacc.c:1646 */
2268 { (yyval.blk).b = gen_ncode(cstate, NULL, (bpf_u_int32)(yyvsp[0].i),
2269 (yyval.blk).q = (yyvsp[-1].blk).q); }
2270 #line 2271 "grammar.c" /* yacc.c:1646 */
2271 break;
2272
2273 case 32:
2274 #line 452 "grammar.y" /* yacc.c:1646 */
2275 { gen_not((yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
2276 #line 2277 "grammar.c" /* yacc.c:1646 */
2277 break;
2278
2279 case 33:
2280 #line 454 "grammar.y" /* yacc.c:1646 */
2281 { QSET((yyval.blk).q, (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i)); }
2282 #line 2283 "grammar.c" /* yacc.c:1646 */
2283 break;
2284
2285 case 34:
2286 #line 455 "grammar.y" /* yacc.c:1646 */
2287 { QSET((yyval.blk).q, (yyvsp[-1].i), (yyvsp[0].i), Q_DEFAULT); }
2288 #line 2289 "grammar.c" /* yacc.c:1646 */
2289 break;
2290
2291 case 35:
2292 #line 456 "grammar.y" /* yacc.c:1646 */
2293 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); }
2294 #line 2295 "grammar.c" /* yacc.c:1646 */
2295 break;
2296
2297 case 36:
2298 #line 457 "grammar.y" /* yacc.c:1646 */
2299 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTO); }
2300 #line 2301 "grammar.c" /* yacc.c:1646 */
2301 break;
2302
2303 case 37:
2304 #line 458 "grammar.y" /* yacc.c:1646 */
2305 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, Q_PROTOCHAIN); }
2306 #line 2307 "grammar.c" /* yacc.c:1646 */
2307 break;
2308
2309 case 38:
2310 #line 459 "grammar.y" /* yacc.c:1646 */
2311 { QSET((yyval.blk).q, (yyvsp[-1].i), Q_DEFAULT, (yyvsp[0].i)); }
2312 #line 2313 "grammar.c" /* yacc.c:1646 */
2313 break;
2314
2315 case 39:
2316 #line 461 "grammar.y" /* yacc.c:1646 */
2317 { (yyval.blk) = (yyvsp[0].blk); }
2318 #line 2319 "grammar.c" /* yacc.c:1646 */
2319 break;
2320
2321 case 40:
2322 #line 462 "grammar.y" /* yacc.c:1646 */
2323 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = (yyvsp[-2].blk).q; }
2324 #line 2325 "grammar.c" /* yacc.c:1646 */
2325 break;
2326
2327 case 41:
2328 #line 463 "grammar.y" /* yacc.c:1646 */
2329 { (yyval.blk).b = gen_proto_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; }
2330 #line 2331 "grammar.c" /* yacc.c:1646 */
2331 break;
2332
2333 case 42:
2334 #line 464 "grammar.y" /* yacc.c:1646 */
2335 { (yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 0);
2336 (yyval.blk).q = qerr; }
2337 #line 2338 "grammar.c" /* yacc.c:1646 */
2338 break;
2339
2340 case 43:
2341 #line 466 "grammar.y" /* yacc.c:1646 */
2342 { (yyval.blk).b = gen_relation(cstate, (yyvsp[-1].i), (yyvsp[-2].a), (yyvsp[0].a), 1);
2343 (yyval.blk).q = qerr; }
2344 #line 2345 "grammar.c" /* yacc.c:1646 */
2345 break;
2346
2347 case 44:
2348 #line 468 "grammar.y" /* yacc.c:1646 */
2349 { (yyval.blk).b = (yyvsp[0].rblk); (yyval.blk).q = qerr; }
2350 #line 2351 "grammar.c" /* yacc.c:1646 */
2351 break;
2352
2353 case 45:
2354 #line 469 "grammar.y" /* yacc.c:1646 */
2355 { (yyval.blk).b = gen_atmtype_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; }
2356 #line 2357 "grammar.c" /* yacc.c:1646 */
2357 break;
2358
2359 case 46:
2360 #line 470 "grammar.y" /* yacc.c:1646 */
2361 { (yyval.blk).b = gen_atmmulti_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; }
2362 #line 2363 "grammar.c" /* yacc.c:1646 */
2363 break;
2364
2365 case 47:
2366 #line 471 "grammar.y" /* yacc.c:1646 */
2367 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; }
2368 #line 2369 "grammar.c" /* yacc.c:1646 */
2369 break;
2370
2371 case 48:
2372 #line 472 "grammar.y" /* yacc.c:1646 */
2373 { (yyval.blk).b = gen_mtp2type_abbrev(cstate, (yyvsp[0].i)); (yyval.blk).q = qerr; }
2374 #line 2375 "grammar.c" /* yacc.c:1646 */
2375 break;
2376
2377 case 49:
2378 #line 473 "grammar.y" /* yacc.c:1646 */
2379 { (yyval.blk).b = (yyvsp[0].blk).b; (yyval.blk).q = qerr; }
2380 #line 2381 "grammar.c" /* yacc.c:1646 */
2381 break;
2382
2383 case 51:
2384 #line 477 "grammar.y" /* yacc.c:1646 */
2385 { (yyval.i) = Q_DEFAULT; }
2386 #line 2387 "grammar.c" /* yacc.c:1646 */
2387 break;
2388
2389 case 52:
2390 #line 480 "grammar.y" /* yacc.c:1646 */
2391 { (yyval.i) = Q_SRC; }
2392 #line 2393 "grammar.c" /* yacc.c:1646 */
2393 break;
2394
2395 case 53:
2396 #line 481 "grammar.y" /* yacc.c:1646 */
2397 { (yyval.i) = Q_DST; }
2398 #line 2399 "grammar.c" /* yacc.c:1646 */
2399 break;
2400
2401 case 54:
2402 #line 482 "grammar.y" /* yacc.c:1646 */
2403 { (yyval.i) = Q_OR; }
2404 #line 2405 "grammar.c" /* yacc.c:1646 */
2405 break;
2406
2407 case 55:
2408 #line 483 "grammar.y" /* yacc.c:1646 */
2409 { (yyval.i) = Q_OR; }
2410 #line 2411 "grammar.c" /* yacc.c:1646 */
2411 break;
2412
2413 case 56:
2414 #line 484 "grammar.y" /* yacc.c:1646 */
2415 { (yyval.i) = Q_AND; }
2416 #line 2417 "grammar.c" /* yacc.c:1646 */
2417 break;
2418
2419 case 57:
2420 #line 485 "grammar.y" /* yacc.c:1646 */
2421 { (yyval.i) = Q_AND; }
2422 #line 2423 "grammar.c" /* yacc.c:1646 */
2423 break;
2424
2425 case 58:
2426 #line 486 "grammar.y" /* yacc.c:1646 */
2427 { (yyval.i) = Q_ADDR1; }
2428 #line 2429 "grammar.c" /* yacc.c:1646 */
2429 break;
2430
2431 case 59:
2432 #line 487 "grammar.y" /* yacc.c:1646 */
2433 { (yyval.i) = Q_ADDR2; }
2434 #line 2435 "grammar.c" /* yacc.c:1646 */
2435 break;
2436
2437 case 60:
2438 #line 488 "grammar.y" /* yacc.c:1646 */
2439 { (yyval.i) = Q_ADDR3; }
2440 #line 2441 "grammar.c" /* yacc.c:1646 */
2441 break;
2442
2443 case 61:
2444 #line 489 "grammar.y" /* yacc.c:1646 */
2445 { (yyval.i) = Q_ADDR4; }
2446 #line 2447 "grammar.c" /* yacc.c:1646 */
2447 break;
2448
2449 case 62:
2450 #line 490 "grammar.y" /* yacc.c:1646 */
2451 { (yyval.i) = Q_RA; }
2452 #line 2453 "grammar.c" /* yacc.c:1646 */
2453 break;
2454
2455 case 63:
2456 #line 491 "grammar.y" /* yacc.c:1646 */
2457 { (yyval.i) = Q_TA; }
2458 #line 2459 "grammar.c" /* yacc.c:1646 */
2459 break;
2460
2461 case 64:
2462 #line 494 "grammar.y" /* yacc.c:1646 */
2463 { (yyval.i) = Q_HOST; }
2464 #line 2465 "grammar.c" /* yacc.c:1646 */
2465 break;
2466
2467 case 65:
2468 #line 495 "grammar.y" /* yacc.c:1646 */
2469 { (yyval.i) = Q_NET; }
2470 #line 2471 "grammar.c" /* yacc.c:1646 */
2471 break;
2472
2473 case 66:
2474 #line 496 "grammar.y" /* yacc.c:1646 */
2475 { (yyval.i) = Q_PORT; }
2476 #line 2477 "grammar.c" /* yacc.c:1646 */
2477 break;
2478
2479 case 67:
2480 #line 497 "grammar.y" /* yacc.c:1646 */
2481 { (yyval.i) = Q_PORTRANGE; }
2482 #line 2483 "grammar.c" /* yacc.c:1646 */
2483 break;
2484
2485 case 68:
2486 #line 500 "grammar.y" /* yacc.c:1646 */
2487 { (yyval.i) = Q_GATEWAY; }
2488 #line 2489 "grammar.c" /* yacc.c:1646 */
2489 break;
2490
2491 case 69:
2492 #line 502 "grammar.y" /* yacc.c:1646 */
2493 { (yyval.i) = Q_LINK; }
2494 #line 2495 "grammar.c" /* yacc.c:1646 */
2495 break;
2496
2497 case 70:
2498 #line 503 "grammar.y" /* yacc.c:1646 */
2499 { (yyval.i) = Q_IP; }
2500 #line 2501 "grammar.c" /* yacc.c:1646 */
2501 break;
2502
2503 case 71:
2504 #line 504 "grammar.y" /* yacc.c:1646 */
2505 { (yyval.i) = Q_ARP; }
2506 #line 2507 "grammar.c" /* yacc.c:1646 */
2507 break;
2508
2509 case 72:
2510 #line 505 "grammar.y" /* yacc.c:1646 */
2511 { (yyval.i) = Q_RARP; }
2512 #line 2513 "grammar.c" /* yacc.c:1646 */
2513 break;
2514
2515 case 73:
2516 #line 506 "grammar.y" /* yacc.c:1646 */
2517 { (yyval.i) = Q_SCTP; }
2518 #line 2519 "grammar.c" /* yacc.c:1646 */
2519 break;
2520
2521 case 74:
2522 #line 507 "grammar.y" /* yacc.c:1646 */
2523 { (yyval.i) = Q_TCP; }
2524 #line 2525 "grammar.c" /* yacc.c:1646 */
2525 break;
2526
2527 case 75:
2528 #line 508 "grammar.y" /* yacc.c:1646 */
2529 { (yyval.i) = Q_UDP; }
2530 #line 2531 "grammar.c" /* yacc.c:1646 */
2531 break;
2532
2533 case 76:
2534 #line 509 "grammar.y" /* yacc.c:1646 */
2535 { (yyval.i) = Q_ICMP; }
2536 #line 2537 "grammar.c" /* yacc.c:1646 */
2537 break;
2538
2539 case 77:
2540 #line 510 "grammar.y" /* yacc.c:1646 */
2541 { (yyval.i) = Q_IGMP; }
2542 #line 2543 "grammar.c" /* yacc.c:1646 */
2543 break;
2544
2545 case 78:
2546 #line 511 "grammar.y" /* yacc.c:1646 */
2547 { (yyval.i) = Q_IGRP; }
2548 #line 2549 "grammar.c" /* yacc.c:1646 */
2549 break;
2550
2551 case 79:
2552 #line 512 "grammar.y" /* yacc.c:1646 */
2553 { (yyval.i) = Q_PIM; }
2554 #line 2555 "grammar.c" /* yacc.c:1646 */
2555 break;
2556
2557 case 80:
2558 #line 513 "grammar.y" /* yacc.c:1646 */
2559 { (yyval.i) = Q_VRRP; }
2560 #line 2561 "grammar.c" /* yacc.c:1646 */
2561 break;
2562
2563 case 81:
2564 #line 514 "grammar.y" /* yacc.c:1646 */
2565 { (yyval.i) = Q_CARP; }
2566 #line 2567 "grammar.c" /* yacc.c:1646 */
2567 break;
2568
2569 case 82:
2570 #line 515 "grammar.y" /* yacc.c:1646 */
2571 { (yyval.i) = Q_ATALK; }
2572 #line 2573 "grammar.c" /* yacc.c:1646 */
2573 break;
2574
2575 case 83:
2576 #line 516 "grammar.y" /* yacc.c:1646 */
2577 { (yyval.i) = Q_AARP; }
2578 #line 2579 "grammar.c" /* yacc.c:1646 */
2579 break;
2580
2581 case 84:
2582 #line 517 "grammar.y" /* yacc.c:1646 */
2583 { (yyval.i) = Q_DECNET; }
2584 #line 2585 "grammar.c" /* yacc.c:1646 */
2585 break;
2586
2587 case 85:
2588 #line 518 "grammar.y" /* yacc.c:1646 */
2589 { (yyval.i) = Q_LAT; }
2590 #line 2591 "grammar.c" /* yacc.c:1646 */
2591 break;
2592
2593 case 86:
2594 #line 519 "grammar.y" /* yacc.c:1646 */
2595 { (yyval.i) = Q_SCA; }
2596 #line 2597 "grammar.c" /* yacc.c:1646 */
2597 break;
2598
2599 case 87:
2600 #line 520 "grammar.y" /* yacc.c:1646 */
2601 { (yyval.i) = Q_MOPDL; }
2602 #line 2603 "grammar.c" /* yacc.c:1646 */
2603 break;
2604
2605 case 88:
2606 #line 521 "grammar.y" /* yacc.c:1646 */
2607 { (yyval.i) = Q_MOPRC; }
2608 #line 2609 "grammar.c" /* yacc.c:1646 */
2609 break;
2610
2611 case 89:
2612 #line 522 "grammar.y" /* yacc.c:1646 */
2613 { (yyval.i) = Q_IPV6; }
2614 #line 2615 "grammar.c" /* yacc.c:1646 */
2615 break;
2616
2617 case 90:
2618 #line 523 "grammar.y" /* yacc.c:1646 */
2619 { (yyval.i) = Q_ICMPV6; }
2620 #line 2621 "grammar.c" /* yacc.c:1646 */
2621 break;
2622
2623 case 91:
2624 #line 524 "grammar.y" /* yacc.c:1646 */
2625 { (yyval.i) = Q_AH; }
2626 #line 2627 "grammar.c" /* yacc.c:1646 */
2627 break;
2628
2629 case 92:
2630 #line 525 "grammar.y" /* yacc.c:1646 */
2631 { (yyval.i) = Q_ESP; }
2632 #line 2633 "grammar.c" /* yacc.c:1646 */
2633 break;
2634
2635 case 93:
2636 #line 526 "grammar.y" /* yacc.c:1646 */
2637 { (yyval.i) = Q_ISO; }
2638 #line 2639 "grammar.c" /* yacc.c:1646 */
2639 break;
2640
2641 case 94:
2642 #line 527 "grammar.y" /* yacc.c:1646 */
2643 { (yyval.i) = Q_ESIS; }
2644 #line 2645 "grammar.c" /* yacc.c:1646 */
2645 break;
2646
2647 case 95:
2648 #line 528 "grammar.y" /* yacc.c:1646 */
2649 { (yyval.i) = Q_ISIS; }
2650 #line 2651 "grammar.c" /* yacc.c:1646 */
2651 break;
2652
2653 case 96:
2654 #line 529 "grammar.y" /* yacc.c:1646 */
2655 { (yyval.i) = Q_ISIS_L1; }
2656 #line 2657 "grammar.c" /* yacc.c:1646 */
2657 break;
2658
2659 case 97:
2660 #line 530 "grammar.y" /* yacc.c:1646 */
2661 { (yyval.i) = Q_ISIS_L2; }
2662 #line 2663 "grammar.c" /* yacc.c:1646 */
2663 break;
2664
2665 case 98:
2666 #line 531 "grammar.y" /* yacc.c:1646 */
2667 { (yyval.i) = Q_ISIS_IIH; }
2668 #line 2669 "grammar.c" /* yacc.c:1646 */
2669 break;
2670
2671 case 99:
2672 #line 532 "grammar.y" /* yacc.c:1646 */
2673 { (yyval.i) = Q_ISIS_LSP; }
2674 #line 2675 "grammar.c" /* yacc.c:1646 */
2675 break;
2676
2677 case 100:
2678 #line 533 "grammar.y" /* yacc.c:1646 */
2679 { (yyval.i) = Q_ISIS_SNP; }
2680 #line 2681 "grammar.c" /* yacc.c:1646 */
2681 break;
2682
2683 case 101:
2684 #line 534 "grammar.y" /* yacc.c:1646 */
2685 { (yyval.i) = Q_ISIS_PSNP; }
2686 #line 2687 "grammar.c" /* yacc.c:1646 */
2687 break;
2688
2689 case 102:
2690 #line 535 "grammar.y" /* yacc.c:1646 */
2691 { (yyval.i) = Q_ISIS_CSNP; }
2692 #line 2693 "grammar.c" /* yacc.c:1646 */
2693 break;
2694
2695 case 103:
2696 #line 536 "grammar.y" /* yacc.c:1646 */
2697 { (yyval.i) = Q_CLNP; }
2698 #line 2699 "grammar.c" /* yacc.c:1646 */
2699 break;
2700
2701 case 104:
2702 #line 537 "grammar.y" /* yacc.c:1646 */
2703 { (yyval.i) = Q_STP; }
2704 #line 2705 "grammar.c" /* yacc.c:1646 */
2705 break;
2706
2707 case 105:
2708 #line 538 "grammar.y" /* yacc.c:1646 */
2709 { (yyval.i) = Q_IPX; }
2710 #line 2711 "grammar.c" /* yacc.c:1646 */
2711 break;
2712
2713 case 106:
2714 #line 539 "grammar.y" /* yacc.c:1646 */
2715 { (yyval.i) = Q_NETBEUI; }
2716 #line 2717 "grammar.c" /* yacc.c:1646 */
2717 break;
2718
2719 case 107:
2720 #line 540 "grammar.y" /* yacc.c:1646 */
2721 { (yyval.i) = Q_RADIO; }
2722 #line 2723 "grammar.c" /* yacc.c:1646 */
2723 break;
2724
2725 case 108:
2726 #line 542 "grammar.y" /* yacc.c:1646 */
2727 { (yyval.rblk) = gen_broadcast(cstate, (yyvsp[-1].i)); }
2728 #line 2729 "grammar.c" /* yacc.c:1646 */
2729 break;
2730
2731 case 109:
2732 #line 543 "grammar.y" /* yacc.c:1646 */
2733 { (yyval.rblk) = gen_multicast(cstate, (yyvsp[-1].i)); }
2734 #line 2735 "grammar.c" /* yacc.c:1646 */
2735 break;
2736
2737 case 110:
2738 #line 544 "grammar.y" /* yacc.c:1646 */
2739 { (yyval.rblk) = gen_less(cstate, (yyvsp[0].i)); }
2740 #line 2741 "grammar.c" /* yacc.c:1646 */
2741 break;
2742
2743 case 111:
2744 #line 545 "grammar.y" /* yacc.c:1646 */
2745 { (yyval.rblk) = gen_greater(cstate, (yyvsp[0].i)); }
2746 #line 2747 "grammar.c" /* yacc.c:1646 */
2747 break;
2748
2749 case 112:
2750 #line 546 "grammar.y" /* yacc.c:1646 */
2751 { (yyval.rblk) = gen_byteop(cstate, (yyvsp[-1].i), (yyvsp[-2].i), (yyvsp[0].i)); }
2752 #line 2753 "grammar.c" /* yacc.c:1646 */
2753 break;
2754
2755 case 113:
2756 #line 547 "grammar.y" /* yacc.c:1646 */
2757 { (yyval.rblk) = gen_inbound(cstate, 0); }
2758 #line 2759 "grammar.c" /* yacc.c:1646 */
2759 break;
2760
2761 case 114:
2762 #line 548 "grammar.y" /* yacc.c:1646 */
2763 { (yyval.rblk) = gen_inbound(cstate, 1); }
2764 #line 2765 "grammar.c" /* yacc.c:1646 */
2765 break;
2766
2767 case 115:
2768 #line 549 "grammar.y" /* yacc.c:1646 */
2769 { (yyval.rblk) = gen_vlan(cstate, (yyvsp[0].i)); }
2770 #line 2771 "grammar.c" /* yacc.c:1646 */
2771 break;
2772
2773 case 116:
2774 #line 550 "grammar.y" /* yacc.c:1646 */
2775 { (yyval.rblk) = gen_vlan(cstate, -1); }
2776 #line 2777 "grammar.c" /* yacc.c:1646 */
2777 break;
2778
2779 case 117:
2780 #line 551 "grammar.y" /* yacc.c:1646 */
2781 { (yyval.rblk) = gen_mpls(cstate, (yyvsp[0].i)); }
2782 #line 2783 "grammar.c" /* yacc.c:1646 */
2783 break;
2784
2785 case 118:
2786 #line 552 "grammar.y" /* yacc.c:1646 */
2787 { (yyval.rblk) = gen_mpls(cstate, -1); }
2788 #line 2789 "grammar.c" /* yacc.c:1646 */
2789 break;
2790
2791 case 119:
2792 #line 553 "grammar.y" /* yacc.c:1646 */
2793 { (yyval.rblk) = gen_pppoed(cstate); }
2794 #line 2795 "grammar.c" /* yacc.c:1646 */
2795 break;
2796
2797 case 120:
2798 #line 554 "grammar.y" /* yacc.c:1646 */
2799 { (yyval.rblk) = gen_pppoes(cstate, (yyvsp[0].i)); }
2800 #line 2801 "grammar.c" /* yacc.c:1646 */
2801 break;
2802
2803 case 121:
2804 #line 555 "grammar.y" /* yacc.c:1646 */
2805 { (yyval.rblk) = gen_pppoes(cstate, -1); }
2806 #line 2807 "grammar.c" /* yacc.c:1646 */
2807 break;
2808
2809 case 122:
2810 #line 556 "grammar.y" /* yacc.c:1646 */
2811 { (yyval.rblk) = gen_geneve(cstate, (yyvsp[0].i)); }
2812 #line 2813 "grammar.c" /* yacc.c:1646 */
2813 break;
2814
2815 case 123:
2816 #line 557 "grammar.y" /* yacc.c:1646 */
2817 { (yyval.rblk) = gen_geneve(cstate, -1); }
2818 #line 2819 "grammar.c" /* yacc.c:1646 */
2819 break;
2820
2821 case 124:
2822 #line 558 "grammar.y" /* yacc.c:1646 */
2823 { (yyval.rblk) = (yyvsp[0].rblk); }
2824 #line 2825 "grammar.c" /* yacc.c:1646 */
2825 break;
2826
2827 case 125:
2828 #line 559 "grammar.y" /* yacc.c:1646 */
2829 { (yyval.rblk) = (yyvsp[0].rblk); }
2830 #line 2831 "grammar.c" /* yacc.c:1646 */
2831 break;
2832
2833 case 126:
2834 #line 560 "grammar.y" /* yacc.c:1646 */
2835 { (yyval.rblk) = (yyvsp[0].rblk); }
2836 #line 2837 "grammar.c" /* yacc.c:1646 */
2837 break;
2838
2839 case 127:
2840 #line 563 "grammar.y" /* yacc.c:1646 */
2841 { (yyval.rblk) = gen_pf_ifname(cstate, (yyvsp[0].s)); }
2842 #line 2843 "grammar.c" /* yacc.c:1646 */
2843 break;
2844
2845 case 128:
2846 #line 564 "grammar.y" /* yacc.c:1646 */
2847 { (yyval.rblk) = gen_pf_ruleset(cstate, (yyvsp[0].s)); }
2848 #line 2849 "grammar.c" /* yacc.c:1646 */
2849 break;
2850
2851 case 129:
2852 #line 565 "grammar.y" /* yacc.c:1646 */
2853 { (yyval.rblk) = gen_pf_rnr(cstate, (yyvsp[0].i)); }
2854 #line 2855 "grammar.c" /* yacc.c:1646 */
2855 break;
2856
2857 case 130:
2858 #line 566 "grammar.y" /* yacc.c:1646 */
2859 { (yyval.rblk) = gen_pf_srnr(cstate, (yyvsp[0].i)); }
2860 #line 2861 "grammar.c" /* yacc.c:1646 */
2861 break;
2862
2863 case 131:
2864 #line 567 "grammar.y" /* yacc.c:1646 */
2865 { (yyval.rblk) = gen_pf_reason(cstate, (yyvsp[0].i)); }
2866 #line 2867 "grammar.c" /* yacc.c:1646 */
2867 break;
2868
2869 case 132:
2870 #line 568 "grammar.y" /* yacc.c:1646 */
2871 { (yyval.rblk) = gen_pf_action(cstate, (yyvsp[0].i)); }
2872 #line 2873 "grammar.c" /* yacc.c:1646 */
2873 break;
2874
2875 case 133:
2876 #line 572 "grammar.y" /* yacc.c:1646 */
2877 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[-2].i) | (yyvsp[0].i),
2878 IEEE80211_FC0_TYPE_MASK |
2879 IEEE80211_FC0_SUBTYPE_MASK);
2880 }
2881 #line 2882 "grammar.c" /* yacc.c:1646 */
2882 break;
2883
2884 case 134:
2885 #line 576 "grammar.y" /* yacc.c:1646 */
2886 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i),
2887 IEEE80211_FC0_TYPE_MASK);
2888 }
2889 #line 2890 "grammar.c" /* yacc.c:1646 */
2890 break;
2891
2892 case 135:
2893 #line 579 "grammar.y" /* yacc.c:1646 */
2894 { (yyval.rblk) = gen_p80211_type(cstate, (yyvsp[0].i),
2895 IEEE80211_FC0_TYPE_MASK |
2896 IEEE80211_FC0_SUBTYPE_MASK);
2897 }
2898 #line 2899 "grammar.c" /* yacc.c:1646 */
2899 break;
2900
2901 case 136:
2902 #line 583 "grammar.y" /* yacc.c:1646 */
2903 { (yyval.rblk) = gen_p80211_fcdir(cstate, (yyvsp[0].i)); }
2904 #line 2905 "grammar.c" /* yacc.c:1646 */
2905 break;
2906
2907 case 138:
2908 #line 587 "grammar.y" /* yacc.c:1646 */
2909 { (yyval.i) = str2tok((yyvsp[0].s), ieee80211_types);
2910 if ((yyval.i) == -1)
2911 bpf_error(cstate, "unknown 802.11 type name");
2912 }
2913 #line 2914 "grammar.c" /* yacc.c:1646 */
2914 break;
2915
2916 case 140:
2917 #line 594 "grammar.y" /* yacc.c:1646 */
2918 { const struct tok *types = NULL;
2919 int i;
2920 for (i = 0;; i++) {
2921 if (ieee80211_type_subtypes[i].tok == NULL) {
2922 /* Ran out of types */
2923 bpf_error(cstate, "unknown 802.11 type");
2924 break;
2925 }
2926 if ((yyvsp[(-1) - (1)].i) == ieee80211_type_subtypes[i].type) {
2927 types = ieee80211_type_subtypes[i].tok;
2928 break;
2929 }
2930 }
2931
2932 (yyval.i) = str2tok((yyvsp[0].s), types);
2933 if ((yyval.i) == -1)
2934 bpf_error(cstate, "unknown 802.11 subtype name");
2935 }
2936 #line 2937 "grammar.c" /* yacc.c:1646 */
2937 break;
2938
2939 case 141:
2940 #line 614 "grammar.y" /* yacc.c:1646 */
2941 { int i;
2942 for (i = 0;; i++) {
2943 if (ieee80211_type_subtypes[i].tok == NULL) {
2944 /* Ran out of types */
2945 bpf_error(cstate, "unknown 802.11 type name");
2946 break;
2947 }
2948 (yyval.i) = str2tok((yyvsp[0].s), ieee80211_type_subtypes[i].tok);
2949 if ((yyval.i) != -1) {
2950 (yyval.i) |= ieee80211_type_subtypes[i].type;
2951 break;
2952 }
2953 }
2954 }
2955 #line 2956 "grammar.c" /* yacc.c:1646 */
2956 break;
2957
2958 case 142:
2959 #line 630 "grammar.y" /* yacc.c:1646 */
2960 { (yyval.rblk) = gen_llc(cstate); }
2961 #line 2962 "grammar.c" /* yacc.c:1646 */
2962 break;
2963
2964 case 143:
2965 #line 631 "grammar.y" /* yacc.c:1646 */
2966 { if (pcap_strcasecmp((yyvsp[0].s), "i") == 0)
2967 (yyval.rblk) = gen_llc_i(cstate);
2968 else if (pcap_strcasecmp((yyvsp[0].s), "s") == 0)
2969 (yyval.rblk) = gen_llc_s(cstate);
2970 else if (pcap_strcasecmp((yyvsp[0].s), "u") == 0)
2971 (yyval.rblk) = gen_llc_u(cstate);
2972 else {
2973 int subtype;
2974
2975 subtype = str2tok((yyvsp[0].s), llc_s_subtypes);
2976 if (subtype != -1)
2977 (yyval.rblk) = gen_llc_s_subtype(cstate, subtype);
2978 else {
2979 subtype = str2tok((yyvsp[0].s), llc_u_subtypes);
2980 if (subtype == -1)
2981 bpf_error(cstate, "unknown LLC type name \"%s\"", (yyvsp[0].s));
2982 (yyval.rblk) = gen_llc_u_subtype(cstate, subtype);
2983 }
2984 }
2985 }
2986 #line 2987 "grammar.c" /* yacc.c:1646 */
2987 break;
2988
2989 case 144:
2990 #line 652 "grammar.y" /* yacc.c:1646 */
2991 { (yyval.rblk) = gen_llc_s_subtype(cstate, LLC_RNR); }
2992 #line 2993 "grammar.c" /* yacc.c:1646 */
2993 break;
2994
2995 case 146:
2996 #line 656 "grammar.y" /* yacc.c:1646 */
2997 { if (pcap_strcasecmp((yyvsp[0].s), "nods") == 0)
2998 (yyval.i) = IEEE80211_FC1_DIR_NODS;
2999 else if (pcap_strcasecmp((yyvsp[0].s), "tods") == 0)
3000 (yyval.i) = IEEE80211_FC1_DIR_TODS;
3001 else if (pcap_strcasecmp((yyvsp[0].s), "fromds") == 0)
3002 (yyval.i) = IEEE80211_FC1_DIR_FROMDS;
3003 else if (pcap_strcasecmp((yyvsp[0].s), "dstods") == 0)
3004 (yyval.i) = IEEE80211_FC1_DIR_DSTODS;
3005 else
3006 bpf_error(cstate, "unknown 802.11 direction");
3007 }
3008 #line 3009 "grammar.c" /* yacc.c:1646 */
3009 break;
3010
3011 case 147:
3012 #line 669 "grammar.y" /* yacc.c:1646 */
3013 { (yyval.i) = (yyvsp[0].i); }
3014 #line 3015 "grammar.c" /* yacc.c:1646 */
3015 break;
3016
3017 case 148:
3018 #line 670 "grammar.y" /* yacc.c:1646 */
3019 { (yyval.i) = pfreason_to_num(cstate, (yyvsp[0].s)); }
3020 #line 3021 "grammar.c" /* yacc.c:1646 */
3021 break;
3022
3023 case 149:
3024 #line 673 "grammar.y" /* yacc.c:1646 */
3025 { (yyval.i) = pfaction_to_num(cstate, (yyvsp[0].s)); }
3026 #line 3027 "grammar.c" /* yacc.c:1646 */
3027 break;
3028
3029 case 150:
3030 #line 676 "grammar.y" /* yacc.c:1646 */
3031 { (yyval.i) = BPF_JGT; }
3032 #line 3033 "grammar.c" /* yacc.c:1646 */
3033 break;
3034
3035 case 151:
3036 #line 677 "grammar.y" /* yacc.c:1646 */
3037 { (yyval.i) = BPF_JGE; }
3038 #line 3039 "grammar.c" /* yacc.c:1646 */
3039 break;
3040
3041 case 152:
3042 #line 678 "grammar.y" /* yacc.c:1646 */
3043 { (yyval.i) = BPF_JEQ; }
3044 #line 3045 "grammar.c" /* yacc.c:1646 */
3045 break;
3046
3047 case 153:
3048 #line 680 "grammar.y" /* yacc.c:1646 */
3049 { (yyval.i) = BPF_JGT; }
3050 #line 3051 "grammar.c" /* yacc.c:1646 */
3051 break;
3052
3053 case 154:
3054 #line 681 "grammar.y" /* yacc.c:1646 */
3055 { (yyval.i) = BPF_JGE; }
3056 #line 3057 "grammar.c" /* yacc.c:1646 */
3057 break;
3058
3059 case 155:
3060 #line 682 "grammar.y" /* yacc.c:1646 */
3061 { (yyval.i) = BPF_JEQ; }
3062 #line 3063 "grammar.c" /* yacc.c:1646 */
3063 break;
3064
3065 case 156:
3066 #line 684 "grammar.y" /* yacc.c:1646 */
3067 { (yyval.a) = gen_loadi(cstate, (yyvsp[0].i)); }
3068 #line 3069 "grammar.c" /* yacc.c:1646 */
3069 break;
3070
3071 case 158:
3072 #line 687 "grammar.y" /* yacc.c:1646 */
3073 { (yyval.a) = gen_load(cstate, (yyvsp[-3].i), (yyvsp[-1].a), 1); }
3074 #line 3075 "grammar.c" /* yacc.c:1646 */
3075 break;
3076
3077 case 159:
3078 #line 688 "grammar.y" /* yacc.c:1646 */
3079 { (yyval.a) = gen_load(cstate, (yyvsp[-5].i), (yyvsp[-3].a), (yyvsp[-1].i)); }
3080 #line 3081 "grammar.c" /* yacc.c:1646 */
3081 break;
3082
3083 case 160:
3084 #line 689 "grammar.y" /* yacc.c:1646 */
3085 { (yyval.a) = gen_arth(cstate, BPF_ADD, (yyvsp[-2].a), (yyvsp[0].a)); }
3086 #line 3087 "grammar.c" /* yacc.c:1646 */
3087 break;
3088
3089 case 161:
3090 #line 690 "grammar.y" /* yacc.c:1646 */
3091 { (yyval.a) = gen_arth(cstate, BPF_SUB, (yyvsp[-2].a), (yyvsp[0].a)); }
3092 #line 3093 "grammar.c" /* yacc.c:1646 */
3093 break;
3094
3095 case 162:
3096 #line 691 "grammar.y" /* yacc.c:1646 */
3097 { (yyval.a) = gen_arth(cstate, BPF_MUL, (yyvsp[-2].a), (yyvsp[0].a)); }
3098 #line 3099 "grammar.c" /* yacc.c:1646 */
3099 break;
3100
3101 case 163:
3102 #line 692 "grammar.y" /* yacc.c:1646 */
3103 { (yyval.a) = gen_arth(cstate, BPF_DIV, (yyvsp[-2].a), (yyvsp[0].a)); }
3104 #line 3105 "grammar.c" /* yacc.c:1646 */
3105 break;
3106
3107 case 164:
3108 #line 693 "grammar.y" /* yacc.c:1646 */
3109 { (yyval.a) = gen_arth(cstate, BPF_MOD, (yyvsp[-2].a), (yyvsp[0].a)); }
3110 #line 3111 "grammar.c" /* yacc.c:1646 */
3111 break;
3112
3113 case 165:
3114 #line 694 "grammar.y" /* yacc.c:1646 */
3115 { (yyval.a) = gen_arth(cstate, BPF_AND, (yyvsp[-2].a), (yyvsp[0].a)); }
3116 #line 3117 "grammar.c" /* yacc.c:1646 */
3117 break;
3118
3119 case 166:
3120 #line 695 "grammar.y" /* yacc.c:1646 */
3121 { (yyval.a) = gen_arth(cstate, BPF_OR, (yyvsp[-2].a), (yyvsp[0].a)); }
3122 #line 3123 "grammar.c" /* yacc.c:1646 */
3123 break;
3124
3125 case 167:
3126 #line 696 "grammar.y" /* yacc.c:1646 */
3127 { (yyval.a) = gen_arth(cstate, BPF_XOR, (yyvsp[-2].a), (yyvsp[0].a)); }
3128 #line 3129 "grammar.c" /* yacc.c:1646 */
3129 break;
3130
3131 case 168:
3132 #line 697 "grammar.y" /* yacc.c:1646 */
3133 { (yyval.a) = gen_arth(cstate, BPF_LSH, (yyvsp[-2].a), (yyvsp[0].a)); }
3134 #line 3135 "grammar.c" /* yacc.c:1646 */
3135 break;
3136
3137 case 169:
3138 #line 698 "grammar.y" /* yacc.c:1646 */
3139 { (yyval.a) = gen_arth(cstate, BPF_RSH, (yyvsp[-2].a), (yyvsp[0].a)); }
3140 #line 3141 "grammar.c" /* yacc.c:1646 */
3141 break;
3142
3143 case 170:
3144 #line 699 "grammar.y" /* yacc.c:1646 */
3145 { (yyval.a) = gen_neg(cstate, (yyvsp[0].a)); }
3146 #line 3147 "grammar.c" /* yacc.c:1646 */
3147 break;
3148
3149 case 171:
3150 #line 700 "grammar.y" /* yacc.c:1646 */
3151 { (yyval.a) = (yyvsp[-1].a); }
3152 #line 3153 "grammar.c" /* yacc.c:1646 */
3153 break;
3154
3155 case 172:
3156 #line 701 "grammar.y" /* yacc.c:1646 */
3157 { (yyval.a) = gen_loadlen(cstate); }
3158 #line 3159 "grammar.c" /* yacc.c:1646 */
3159 break;
3160
3161 case 173:
3162 #line 703 "grammar.y" /* yacc.c:1646 */
3163 { (yyval.i) = '&'; }
3164 #line 3165 "grammar.c" /* yacc.c:1646 */
3165 break;
3166
3167 case 174:
3168 #line 704 "grammar.y" /* yacc.c:1646 */
3169 { (yyval.i) = '|'; }
3170 #line 3171 "grammar.c" /* yacc.c:1646 */
3171 break;
3172
3173 case 175:
3174 #line 705 "grammar.y" /* yacc.c:1646 */
3175 { (yyval.i) = '<'; }
3176 #line 3177 "grammar.c" /* yacc.c:1646 */
3177 break;
3178
3179 case 176:
3180 #line 706 "grammar.y" /* yacc.c:1646 */
3181 { (yyval.i) = '>'; }
3182 #line 3183 "grammar.c" /* yacc.c:1646 */
3183 break;
3184
3185 case 177:
3186 #line 707 "grammar.y" /* yacc.c:1646 */
3187 { (yyval.i) = '='; }
3188 #line 3189 "grammar.c" /* yacc.c:1646 */
3189 break;
3190
3191 case 179:
3192 #line 710 "grammar.y" /* yacc.c:1646 */
3193 { (yyval.i) = (yyvsp[-1].i); }
3194 #line 3195 "grammar.c" /* yacc.c:1646 */
3195 break;
3196
3197 case 180:
3198 #line 712 "grammar.y" /* yacc.c:1646 */
3199 { (yyval.i) = A_LANE; }
3200 #line 3201 "grammar.c" /* yacc.c:1646 */
3201 break;
3202
3203 case 181:
3204 #line 713 "grammar.y" /* yacc.c:1646 */
3205 { (yyval.i) = A_METAC; }
3206 #line 3207 "grammar.c" /* yacc.c:1646 */
3207 break;
3208
3209 case 182:
3210 #line 714 "grammar.y" /* yacc.c:1646 */
3211 { (yyval.i) = A_BCC; }
3212 #line 3213 "grammar.c" /* yacc.c:1646 */
3213 break;
3214
3215 case 183:
3216 #line 715 "grammar.y" /* yacc.c:1646 */
3217 { (yyval.i) = A_OAMF4EC; }
3218 #line 3219 "grammar.c" /* yacc.c:1646 */
3219 break;
3220
3221 case 184:
3222 #line 716 "grammar.y" /* yacc.c:1646 */
3223 { (yyval.i) = A_OAMF4SC; }
3224 #line 3225 "grammar.c" /* yacc.c:1646 */
3225 break;
3226
3227 case 185:
3228 #line 717 "grammar.y" /* yacc.c:1646 */
3229 { (yyval.i) = A_SC; }
3230 #line 3231 "grammar.c" /* yacc.c:1646 */
3231 break;
3232
3233 case 186:
3234 #line 718 "grammar.y" /* yacc.c:1646 */
3235 { (yyval.i) = A_ILMIC; }
3236 #line 3237 "grammar.c" /* yacc.c:1646 */
3237 break;
3238
3239 case 187:
3240 #line 720 "grammar.y" /* yacc.c:1646 */
3241 { (yyval.i) = A_OAM; }
3242 #line 3243 "grammar.c" /* yacc.c:1646 */
3243 break;
3244
3245 case 188:
3246 #line 721 "grammar.y" /* yacc.c:1646 */
3247 { (yyval.i) = A_OAMF4; }
3248 #line 3249 "grammar.c" /* yacc.c:1646 */
3249 break;
3250
3251 case 189:
3252 #line 722 "grammar.y" /* yacc.c:1646 */
3253 { (yyval.i) = A_CONNECTMSG; }
3254 #line 3255 "grammar.c" /* yacc.c:1646 */
3255 break;
3256
3257 case 190:
3258 #line 723 "grammar.y" /* yacc.c:1646 */
3259 { (yyval.i) = A_METACONNECT; }
3260 #line 3261 "grammar.c" /* yacc.c:1646 */
3261 break;
3262
3263 case 191:
3264 #line 726 "grammar.y" /* yacc.c:1646 */
3265 { (yyval.blk).atmfieldtype = A_VPI; }
3266 #line 3267 "grammar.c" /* yacc.c:1646 */
3267 break;
3268
3269 case 192:
3270 #line 727 "grammar.y" /* yacc.c:1646 */
3271 { (yyval.blk).atmfieldtype = A_VCI; }
3272 #line 3273 "grammar.c" /* yacc.c:1646 */
3273 break;
3274
3275 case 194:
3276 #line 730 "grammar.y" /* yacc.c:1646 */
3277 { (yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 0); }
3278 #line 3279 "grammar.c" /* yacc.c:1646 */
3279 break;
3280
3281 case 195:
3282 #line 731 "grammar.y" /* yacc.c:1646 */
3283 { (yyval.blk).b = gen_atmfield_code(cstate, (yyvsp[-2].blk).atmfieldtype, (bpf_int32)(yyvsp[0].i), (bpf_u_int32)(yyvsp[-1].i), 1); }
3284 #line 3285 "grammar.c" /* yacc.c:1646 */
3285 break;
3286
3287 case 196:
3288 #line 732 "grammar.y" /* yacc.c:1646 */
3289 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; }
3290 #line 3291 "grammar.c" /* yacc.c:1646 */
3291 break;
3292
3293 case 197:
3294 #line 734 "grammar.y" /* yacc.c:1646 */
3295 {
3296 (yyval.blk).atmfieldtype = (yyvsp[-1].blk).atmfieldtype;
3297 if ((yyval.blk).atmfieldtype == A_VPI ||
3298 (yyval.blk).atmfieldtype == A_VCI)
3299 (yyval.blk).b = gen_atmfield_code(cstate, (yyval.blk).atmfieldtype, (bpf_int32) (yyvsp[0].i), BPF_JEQ, 0);
3300 }
3301 #line 3302 "grammar.c" /* yacc.c:1646 */
3302 break;
3303
3304 case 199:
3305 #line 742 "grammar.y" /* yacc.c:1646 */
3306 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
3307 #line 3308 "grammar.c" /* yacc.c:1646 */
3308 break;
3309
3310 case 200:
3311 #line 745 "grammar.y" /* yacc.c:1646 */
3312 { (yyval.i) = M_FISU; }
3313 #line 3314 "grammar.c" /* yacc.c:1646 */
3314 break;
3315
3316 case 201:
3317 #line 746 "grammar.y" /* yacc.c:1646 */
3318 { (yyval.i) = M_LSSU; }
3319 #line 3320 "grammar.c" /* yacc.c:1646 */
3320 break;
3321
3322 case 202:
3323 #line 747 "grammar.y" /* yacc.c:1646 */
3324 { (yyval.i) = M_MSU; }
3325 #line 3326 "grammar.c" /* yacc.c:1646 */
3326 break;
3327
3328 case 203:
3329 #line 748 "grammar.y" /* yacc.c:1646 */
3330 { (yyval.i) = MH_FISU; }
3331 #line 3332 "grammar.c" /* yacc.c:1646 */
3332 break;
3333
3334 case 204:
3335 #line 749 "grammar.y" /* yacc.c:1646 */
3336 { (yyval.i) = MH_LSSU; }
3337 #line 3338 "grammar.c" /* yacc.c:1646 */
3338 break;
3339
3340 case 205:
3341 #line 750 "grammar.y" /* yacc.c:1646 */
3342 { (yyval.i) = MH_MSU; }
3343 #line 3344 "grammar.c" /* yacc.c:1646 */
3344 break;
3345
3346 case 206:
3347 #line 753 "grammar.y" /* yacc.c:1646 */
3348 { (yyval.blk).mtp3fieldtype = M_SIO; }
3349 #line 3350 "grammar.c" /* yacc.c:1646 */
3350 break;
3351
3352 case 207:
3353 #line 754 "grammar.y" /* yacc.c:1646 */
3354 { (yyval.blk).mtp3fieldtype = M_OPC; }
3355 #line 3356 "grammar.c" /* yacc.c:1646 */
3356 break;
3357
3358 case 208:
3359 #line 755 "grammar.y" /* yacc.c:1646 */
3360 { (yyval.blk).mtp3fieldtype = M_DPC; }
3361 #line 3362 "grammar.c" /* yacc.c:1646 */
3362 break;
3363
3364 case 209:
3365 #line 756 "grammar.y" /* yacc.c:1646 */
3366 { (yyval.blk).mtp3fieldtype = M_SLS; }
3367 #line 3368 "grammar.c" /* yacc.c:1646 */
3368 break;
3369
3370 case 210:
3371 #line 757 "grammar.y" /* yacc.c:1646 */
3372 { (yyval.blk).mtp3fieldtype = MH_SIO; }
3373 #line 3374 "grammar.c" /* yacc.c:1646 */
3374 break;
3375
3376 case 211:
3377 #line 758 "grammar.y" /* yacc.c:1646 */
3378 { (yyval.blk).mtp3fieldtype = MH_OPC; }
3379 #line 3380 "grammar.c" /* yacc.c:1646 */
3380 break;
3381
3382 case 212:
3383 #line 759 "grammar.y" /* yacc.c:1646 */
3384 { (yyval.blk).mtp3fieldtype = MH_DPC; }
3385 #line 3386 "grammar.c" /* yacc.c:1646 */
3386 break;
3387
3388 case 213:
3389 #line 760 "grammar.y" /* yacc.c:1646 */
3390 { (yyval.blk).mtp3fieldtype = MH_SLS; }
3391 #line 3392 "grammar.c" /* yacc.c:1646 */
3392 break;
3393
3394 case 215:
3395 #line 763 "grammar.y" /* yacc.c:1646 */
3396 { (yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 0); }
3397 #line 3398 "grammar.c" /* yacc.c:1646 */
3398 break;
3399
3400 case 216:
3401 #line 764 "grammar.y" /* yacc.c:1646 */
3402 { (yyval.blk).b = gen_mtp3field_code(cstate, (yyvsp[-2].blk).mtp3fieldtype, (u_int)(yyvsp[0].i), (u_int)(yyvsp[-1].i), 1); }
3403 #line 3404 "grammar.c" /* yacc.c:1646 */
3404 break;
3405
3406 case 217:
3407 #line 765 "grammar.y" /* yacc.c:1646 */
3408 { (yyval.blk).b = (yyvsp[-1].blk).b; (yyval.blk).q = qerr; }
3409 #line 3410 "grammar.c" /* yacc.c:1646 */
3410 break;
3411
3412 case 218:
3413 #line 767 "grammar.y" /* yacc.c:1646 */
3414 {
3415 (yyval.blk).mtp3fieldtype = (yyvsp[-1].blk).mtp3fieldtype;
3416 if ((yyval.blk).mtp3fieldtype == M_SIO ||
3417 (yyval.blk).mtp3fieldtype == M_OPC ||
3418 (yyval.blk).mtp3fieldtype == M_DPC ||
3419 (yyval.blk).mtp3fieldtype == M_SLS ||
3420 (yyval.blk).mtp3fieldtype == MH_SIO ||
3421 (yyval.blk).mtp3fieldtype == MH_OPC ||
3422 (yyval.blk).mtp3fieldtype == MH_DPC ||
3423 (yyval.blk).mtp3fieldtype == MH_SLS)
3424 (yyval.blk).b = gen_mtp3field_code(cstate, (yyval.blk).mtp3fieldtype, (u_int) (yyvsp[0].i), BPF_JEQ, 0);
3425 }
3426 #line 3427 "grammar.c" /* yacc.c:1646 */
3427 break;
3428
3429 case 220:
3430 #line 781 "grammar.y" /* yacc.c:1646 */
3431 { gen_or((yyvsp[-2].blk).b, (yyvsp[0].blk).b); (yyval.blk) = (yyvsp[0].blk); }
3432 #line 3433 "grammar.c" /* yacc.c:1646 */
3433 break;
3434
3435
3436 #line 3437 "grammar.c" /* yacc.c:1646 */
3437 default: break;
3438 }
3439 /* User semantic actions sometimes alter yychar, and that requires
3440 that yytoken be updated with the new translation. We take the
3441 approach of translating immediately before every use of yytoken.
3442 One alternative is translating here after every semantic action,
3443 but that translation would be missed if the semantic action invokes
3444 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3445 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3446 incorrect destructor might then be invoked immediately. In the
3447 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3448 to an incorrect destructor call or verbose syntax error message
3449 before the lookahead is translated. */
3450 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3451
3452 YYPOPSTACK (yylen);
3453 yylen = 0;
3454 YY_STACK_PRINT (yyss, yyssp);
3455
3456 *++yyvsp = yyval;
3457
3458 /* Now 'shift' the result of the reduction. Determine what state
3459 that goes to, based on the state we popped back to and the rule
3460 number reduced by. */
3461
3462 yyn = yyr1[yyn];
3463
3464 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3465 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3466 yystate = yytable[yystate];
3467 else
3468 yystate = yydefgoto[yyn - YYNTOKENS];
3469
3470 goto yynewstate;
3471
3472
3473 /*--------------------------------------.
3474 | yyerrlab -- here on detecting error. |
3475 `--------------------------------------*/
3476 yyerrlab:
3477 /* Make sure we have latest lookahead translation. See comments at
3478 user semantic actions for why this is necessary. */
3479 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3480
3481 /* If not already recovering from an error, report this error. */
3482 if (!yyerrstatus)
3483 {
3484 ++yynerrs;
3485 #if ! YYERROR_VERBOSE
3486 yyerror (yyscanner, cstate, YY_("syntax error"));
3487 #else
3488 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3489 yyssp, yytoken)
3490 {
3491 char const *yymsgp = YY_("syntax error");
3492 int yysyntax_error_status;
3493 yysyntax_error_status = YYSYNTAX_ERROR;
3494 if (yysyntax_error_status == 0)
3495 yymsgp = yymsg;
3496 else if (yysyntax_error_status == 1)
3497 {
3498 if (yymsg != yymsgbuf)
3499 YYSTACK_FREE (yymsg);
3500 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3501 if (!yymsg)
3502 {
3503 yymsg = yymsgbuf;
3504 yymsg_alloc = sizeof yymsgbuf;
3505 yysyntax_error_status = 2;
3506 }
3507 else
3508 {
3509 yysyntax_error_status = YYSYNTAX_ERROR;
3510 yymsgp = yymsg;
3511 }
3512 }
3513 yyerror (yyscanner, cstate, yymsgp);
3514 if (yysyntax_error_status == 2)
3515 goto yyexhaustedlab;
3516 }
3517 # undef YYSYNTAX_ERROR
3518 #endif
3519 }
3520
3521
3522
3523 if (yyerrstatus == 3)
3524 {
3525 /* If just tried and failed to reuse lookahead token after an
3526 error, discard it. */
3527
3528 if (yychar <= YYEOF)
3529 {
3530 /* Return failure if at end of input. */
3531 if (yychar == YYEOF)
3532 YYABORT;
3533 }
3534 else
3535 {
3536 yydestruct ("Error: discarding",
3537 yytoken, &yylval, yyscanner, cstate);
3538 yychar = YYEMPTY;
3539 }
3540 }
3541
3542 /* Else will try to reuse lookahead token after shifting the error
3543 token. */
3544 goto yyerrlab1;
3545
3546
3547 /*---------------------------------------------------.
3548 | yyerrorlab -- error raised explicitly by YYERROR. |
3549 `---------------------------------------------------*/
3550 yyerrorlab:
3551
3552 /* Pacify compilers like GCC when the user code never invokes
3553 YYERROR and the label yyerrorlab therefore never appears in user
3554 code. */
3555 if (/*CONSTCOND*/ 0)
3556 goto yyerrorlab;
3557
3558 /* Do not reclaim the symbols of the rule whose action triggered
3559 this YYERROR. */
3560 YYPOPSTACK (yylen);
3561 yylen = 0;
3562 YY_STACK_PRINT (yyss, yyssp);
3563 yystate = *yyssp;
3564 goto yyerrlab1;
3565
3566
3567 /*-------------------------------------------------------------.
3568 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3569 `-------------------------------------------------------------*/
3570 yyerrlab1:
3571 yyerrstatus = 3; /* Each real token shifted decrements this. */
3572
3573 for (;;)
3574 {
3575 yyn = yypact[yystate];
3576 if (!yypact_value_is_default (yyn))
3577 {
3578 yyn += YYTERROR;
3579 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3580 {
3581 yyn = yytable[yyn];
3582 if (0 < yyn)
3583 break;
3584 }
3585 }
3586
3587 /* Pop the current state because it cannot handle the error token. */
3588 if (yyssp == yyss)
3589 YYABORT;
3590
3591
3592 yydestruct ("Error: popping",
3593 yystos[yystate], yyvsp, yyscanner, cstate);
3594 YYPOPSTACK (1);
3595 yystate = *yyssp;
3596 YY_STACK_PRINT (yyss, yyssp);
3597 }
3598
3599 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3600 *++yyvsp = yylval;
3601 YY_IGNORE_MAYBE_UNINITIALIZED_END
3602
3603
3604 /* Shift the error token. */
3605 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3606
3607 yystate = yyn;
3608 goto yynewstate;
3609
3610
3611 /*-------------------------------------.
3612 | yyacceptlab -- YYACCEPT comes here. |
3613 `-------------------------------------*/
3614 yyacceptlab:
3615 yyresult = 0;
3616 goto yyreturn;
3617
3618 /*-----------------------------------.
3619 | yyabortlab -- YYABORT comes here. |
3620 `-----------------------------------*/
3621 yyabortlab:
3622 yyresult = 1;
3623 goto yyreturn;
3624
3625 #if !defined yyoverflow || YYERROR_VERBOSE
3626 /*-------------------------------------------------.
3627 | yyexhaustedlab -- memory exhaustion comes here. |
3628 `-------------------------------------------------*/
3629 yyexhaustedlab:
3630 yyerror (yyscanner, cstate, YY_("memory exhausted"));
3631 yyresult = 2;
3632 /* Fall through. */
3633 #endif
3634
3635 yyreturn:
3636 if (yychar != YYEMPTY)
3637 {
3638 /* Make sure we have latest lookahead translation. See comments at
3639 user semantic actions for why this is necessary. */
3640 yytoken = YYTRANSLATE (yychar);
3641 yydestruct ("Cleanup: discarding lookahead",
3642 yytoken, &yylval, yyscanner, cstate);
3643 }
3644 /* Do not reclaim the symbols of the rule whose action triggered
3645 this YYABORT or YYACCEPT. */
3646 YYPOPSTACK (yylen);
3647 YY_STACK_PRINT (yyss, yyssp);
3648 while (yyssp != yyss)
3649 {
3650 yydestruct ("Cleanup: popping",
3651 yystos[*yyssp], yyvsp, yyscanner, cstate);
3652 YYPOPSTACK (1);
3653 }
3654 #ifndef yyoverflow
3655 if (yyss != yyssa)
3656 YYSTACK_FREE (yyss);
3657 #endif
3658 #if YYERROR_VERBOSE
3659 if (yymsg != yymsgbuf)
3660 YYSTACK_FREE (yymsg);
3661 #endif
3662 return yyresult;
3663 }
3664 #line 783 "grammar.y" /* yacc.c:1906 */
3665
3666