Treat a bunch of digits followed by a newline differently from a bunch

of digits followed by a blank or tab, so that we recognize the newline
as an end-of-line.

svn path=/trunk/; revision=4249
This commit is contained in:
Guy Harris 2001-11-24 02:13:34 +00:00
parent b7420272e7
commit 0bc13df91e
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@
* *
* (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com> * (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
* *
* $Id: text2pcap-scanner.l,v 1.1 2001/05/16 21:32:04 ashokn Exp $ * $Id: text2pcap-scanner.l,v 1.2 2001/11/24 02:13:34 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -46,7 +46,8 @@ directive #TEXT2PCAP.*
comment #[^W].* comment #[^W].*
byte [0-9A-Fa-f][0-9A-Fa-f][ \t] byte [0-9A-Fa-f][0-9A-Fa-f][ \t]
byte_eol [0-9A-Fa-f][0-9A-Fa-f]\n byte_eol [0-9A-Fa-f][0-9A-Fa-f]\n
offset [0-9A-Fa-f]+[ \t\n] offset [0-9A-Fa-f]+[ \t]
offset_eol [0-9A-Fa-f]+\n
text [^ \n\t]+ text [^ \n\t]+
mailfwd > mailfwd >
eol \r?\n\r? eol \r?\n\r?
@ -56,6 +57,7 @@ eol \r?\n\r?
{byte} { parse_token(T_BYTE, yytext); } {byte} { parse_token(T_BYTE, yytext); }
{byte_eol} { parse_token(T_BYTE, yytext); parse_token(T_EOL, NULL); } {byte_eol} { parse_token(T_BYTE, yytext); parse_token(T_EOL, NULL); }
{offset} { parse_token(T_OFFSET, yytext); } {offset} { parse_token(T_OFFSET, yytext); }
{offset_eol} { parse_token(T_OFFSET, yytext); parse_token(T_EOL, NULL); }
{mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); } {mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); }
{eol} { parse_token(T_EOL, NULL); } {eol} { parse_token(T_EOL, NULL); }
[ \t] ; /* ignore whitespace */ [ \t] ; /* ignore whitespace */