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