4 * We don't use unput, so don't generate code for it.
10 /********************************************************************************
14 * Utility to convert an ASCII hexdump into a libpcap-format capture file
16 * (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
20 * Wireshark - Network traffic analyzer
21 * By Gerald Combs <gerald@wireshark.org>
22 * Copyright 1998 Gerald Combs
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation; either version 2
27 * of the License, or (at your option) any later version.
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with this program; if not, write to the Free Software
36 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
38 *******************************************************************************/
43 #include "text2pcap.h"
46 * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h
49 #define YY_NO_UNISTD_H
53 /* disable Windows VC compiler warning "signed/unsigned mismatch" associated */
54 /* with YY_INPUT code generated by flex versions such as 2.5.35. */
55 #pragma warning (disable:4018)
61 directive #TEXT2PCAP.*
63 byte [0-9A-Fa-f][0-9A-Fa-f][ \t]
64 byte_eol [0-9A-Fa-f][0-9A-Fa-f]\n
65 offset [0-9A-Fa-f]+[: \t]
66 offset_eol [0-9A-Fa-f]+\n
73 {byte} { parse_token(T_BYTE, yytext); }
74 {byte_eol} { parse_token(T_BYTE, yytext); parse_token(T_EOL, NULL); }
75 {offset} { parse_token(T_OFFSET, yytext); }
76 {offset_eol} { parse_token(T_OFFSET, yytext); parse_token(T_EOL, NULL); }
77 {mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); }
78 {eol} { parse_token(T_EOL, NULL); }
79 [ \t] ; /* ignore whitespace */
80 {directive} { parse_token(T_DIRECTIVE, yytext); }
81 {comment} ; /* ignore comments */
82 {text} { parse_token(T_TEXT, yytext); }