📄 grammar.c
字号:
/* A Bison parser, made from ../libpcap/grammar.y by GNU bison 1.35. */#define YYBISON 1 /* Identify Bison output. */#define yyparse pcap_parse#define yylex pcap_lex#define yyerror pcap_error#define yylval pcap_lval#define yychar pcap_char#define yydebug pcap_debug#define yynerrs pcap_nerrs# define DST 257# define SRC 258# define HOST 259# define GATEWAY 260# define NET 261# define MASK 262# define PORT 263# define LESS 264# define GREATER 265# define PROTO 266# define PROTOCHAIN 267# define CBYTE 268# define ARP 269# define RARP 270# define IP 271# define SCTP 272# define TCP 273# define UDP 274# define ICMP 275# define IGMP 276# define IGRP 277# define PIM 278# define VRRP 279# define ATALK 280# define AARP 281# define DECNET 282# define LAT 283# define SCA 284# define MOPRC 285# define MOPDL 286# define TK_BROADCAST 287# define TK_MULTICAST 288# define NUM 289# define INBOUND 290# define OUTBOUND 291# define LINK 292# define GEQ 293# define LEQ 294# define NEQ 295# define ID 296# define EID 297# define HID 298# define HID6 299# define AID 300# define LSH 301# define RSH 302# define LEN 303# define IPV6 304# define ICMPV6 305# define AH 306# define ESP 307# define VLAN 308# define ISO 309# define ESIS 310# define CLNP 311# define ISIS 312# define L1 313# define L2 314# define IIH 315# define LSP 316# define SNP 317# define CSNP 318# define PSNP 319# define STP 320# define IPX 321# define NETBEUI 322# define LANE 323# define LLC 324# define METAC 325# define BCC 326# define SC 327# define ILMIC 328# define OAMF4EC 329# define OAMF4SC 330# define OAM 331# define OAMF4 332# define CONNECTMSG 333# define METACONNECT 334# define VPI 335# define VCI 336# define OR 337# define AND 338# define UMINUS 339#line 1 "../libpcap/grammar.y"/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * */#ifndef lintstatic const char rcsid[] = "@(#) $Header: /tcpdump/master/libpcap/grammar.y,v 1.78 2002/12/06 00:01:34 hannes Exp $ (LBL)";#endif#ifdef HAVE_CONFIG_H#include "config.h"#endif#ifdef WIN32#include <pcap-stdinc.h>#else /* WIN32 */#include <sys/types.h>#include <sys/time.h>#include <sys/socket.h>#endif /* WIN32 */#include <stdlib.h>#ifndef WIN32#if __STDC__struct mbuf;struct rtentry;#endif#include <netinet/in.h>#endif /* WIN32 */#include <stdio.h>#include "pcap-int.h"#include "gencode.h"#include <pcap-namedb.h>#ifdef HAVE_OS_PROTO_H#include "os-proto.h"#endif#define QSET(q, p, d, a) (q).proto = (p),\ (q).dir = (d),\ (q).addr = (a)int n_errors = 0;static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };static voidyyerror(char *msg){ ++n_errors; bpf_error("%s", msg); /* NOTREACHED */}#ifndef YYBISONint yyparse(void);intpcap_parse(){ return (yyparse());}#endif#line 90 "../libpcap/grammar.y"#ifndef YYSTYPEtypedef union { int i; bpf_u_int32 h; u_char *e; char *s; struct stmt *stmt; struct arth *a; struct { struct qual q; int atmfieldtype; struct block *b; } blk; struct block *rblk;} yystype;# define YYSTYPE yystype# define YYSTYPE_IS_TRIVIAL 1#endif#ifndef YYDEBUG# define YYDEBUG 0#endif#define YYFINAL 210#define YYFLAG -32768#define YYNTBASE 101/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 133)/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */static const char yytranslate[] ={ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 85, 2, 2, 2, 2, 87, 2, 94, 93, 90, 88, 2, 89, 2, 91, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 100, 2, 97, 96, 95, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 98, 2, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 86, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 92};#if YYDEBUGstatic const short yyprhs[] ={ 0, 0, 3, 5, 6, 8, 12, 16, 20, 24, 26, 28, 30, 32, 36, 38, 42, 46, 48, 52, 54, 56, 58, 61, 63, 65, 67, 71, 75, 77, 79, 81, 84, 88, 91, 94, 97, 100, 103, 106, 110, 112, 116, 120, 122, 124, 126, 129, 131, 132, 134, 136, 140, 144, 148, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 237, 240, 243, 246, 251, 253, 255, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 281, 288, 292, 296, 300, 304, 308, 312, 316, 320, 323, 327, 329, 331, 333, 335, 337, 339, 341, 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 378, 381, 385, 387, 389};static const short yyrhs[] ={ 102, 103, 0, 102, 0, 0, 112, 0, 103, 104, 112, 0, 103, 104, 106, 0, 103, 105, 112, 0, 103, 105, 106, 0, 84, 0, 83, 0, 107, 0, 126, 0, 109, 110, 93, 0, 42, 0, 44, 91, 35, 0, 44, 8, 44, 0, 44, 0, 45, 91, 35, 0, 45, 0, 43, 0, 46, 0, 108, 106, 0, 85, 0, 94, 0, 107, 0, 111, 104, 106, 0, 111, 105, 106, 0, 126, 0, 110, 0, 114, 0, 108, 112, 0, 115, 116, 117, 0, 115, 116, 0, 115, 117, 0, 115, 12, 0, 115, 13, 0, 115, 118, 0, 113, 106, 0, 109, 103, 93, 0, 119, 0, 123, 121, 123, 0, 123, 122, 123, 0, 120, 0, 127, 0, 128, 0, 129, 130, 0, 119, 0, 0, 4, 0, 3, 0, 4, 83, 3, 0, 3, 83, 4, 0, 4, 84, 3, 0, 3, 84, 4, 0, 5, 0, 7, 0, 9, 0, 6, 0, 38, 0, 17, 0, 15, 0, 16, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 32, 0, 31, 0, 50, 0, 51, 0, 52, 0, 53, 0, 55, 0, 56, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 63, 0, 65, 0, 64, 0, 57, 0, 66, 0, 67, 0, 68, 0, 115, 33, 0, 115, 34, 0, 10, 35, 0, 11, 35, 0, 14, 35, 125, 35, 0, 36, 0, 37, 0, 54, 126, 0, 54, 0, 95, 0, 39, 0, 96, 0, 40, 0, 97, 0, 41, 0, 126, 0, 124, 0, 119, 98, 123, 99, 0, 119, 98, 123, 100, 35, 99, 0, 123, 88, 123, 0, 123, 89, 123, 0, 123, 90, 123, 0, 123, 91, 123, 0, 123, 87, 123, 0, 123, 86, 123, 0, 123, 47, 123, 0, 123, 48, 123, 0, 89, 123, 0, 109, 124, 93, 0, 49, 0, 87, 0, 86, 0, 97, 0, 95, 0, 96, 0, 35, 0, 109, 126, 93, 0, 69, 0, 70, 0, 71, 0, 72, 0, 75, 0, 76, 0, 73, 0, 74, 0, 77, 0, 78, 0, 79, 0, 80, 0, 81, 0, 82, 0, 131, 0, 121, 35, 0, 122, 35, 0, 109, 132, 93, 0, 35, 0, 131, 0, 132, 105, 131, 0};#endif#if YYDEBUG/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const short yyrline[] ={ 0, 152, 156, 158, 160, 161, 162, 163, 164, 166, 168, 170, 171, 173, 175, 176, 178, 180, 185, 194, 203, 212, 221, 223, 225, 227, 228, 229, 231, 233, 235, 236, 238, 239, 240, 241, 242, 243, 245, 246, 247, 248, 250, 252, 253, 254, 255, 258, 259, 262, 263, 264, 265, 266, 267, 270, 271, 272, 275, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 315, 316, 317, 318, 319, 320, 321, 322, 323, 325, 326, 327, 329, 330, 331, 333, 334, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 353, 354, 356, 357, 359, 360, 361, 362, 363, 364, 365, 366, 368, 369, 370, 371, 374, 375, 377, 378, 379, 380, 382, 389, 390};#endif#if (YYDEBUG) || defined YYERROR_VERBOSE/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */static const char *const yytname[] ={ "$", "error", "$undefined.", "DST", "SRC", "HOST", "GATEWAY", "NET", "MASK", "PORT", "LESS", "GREATER", "PROTO", "PROTOCHAIN", "CBYTE", "ARP", "RARP", "IP", "SCTP", "TCP", "UDP", "ICMP", "IGMP", "IGRP", "PIM", "VRRP", "ATALK", "AARP", "DECNET", "LAT", "SCA", "MOPRC", "MOPDL", "TK_BROADCAST", "TK_MULTICAST", "NUM", "INBOUND", "OUTBOUND", "LINK", "GEQ", "LEQ", "NEQ", "ID", "EID", "HID", "HID6", "AID", "LSH", "RSH", "LEN", "IPV6", "ICMPV6", "AH", "ESP", "VLAN", "ISO", "ESIS", "CLNP", "ISIS", "L1", "L2", "IIH", "LSP", "SNP", "CSNP", "PSNP", "STP", "IPX", "NETBEUI", "LANE", "LLC", "METAC", "BCC", "SC", "ILMIC", "OAMF4EC", "OAMF4SC", "OAM", "OAMF4", "CONNECTMSG", "METACONNECT", "VPI", "VCI", "OR", "AND", "'!'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS", "')'", "'('", "'>'", "'='", "'<'", "'['", "']'", "':'", "prog", "null", "expr", "and", "or", "id", "nid", "not", "paren", "pid", "qid", "term", "head", "rterm", "pqual", "dqual", "aqual", "ndaqual", "pname", "other", "relop", "irelop", "arth", "narth", "byteop", "pnum", "atmtype", "atmmultitype", "atmfield", "atmvalue", "atmfieldvalue", "atmlistvalue", 0};#endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const short yyr1[] ={ 0, 101, 101, 102, 103, 103, 103, 103, 103, 104, 105, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 109, 110, 110, 110, 111, 111, 112, 112, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 116, 116, 116, 116, 116, 116, 117, 117, 117, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 122, 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 129, 129, 130, 130, 130, 130, 131, 132, 132};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const short yyr2[] ={ 0, 2, 1, 0, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 2, 3, 2, 2, 2, 2, 2, 2, 3, 1, 3, 3, 1, 1, 1, 2, 1, 0, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 6, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 3};/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */static const short yydefact[] ={ 3, 48, 0, 0, 0, 61, 62, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 76, 131, 101, 102, 59, 125, 78, 79, 80, 81, 104, 82, 83, 92, 84, 85, 86, 87, 88, 89, 91, 90, 93, 94, 95, 133, 134, 135,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -