[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Binary scanner not matching character ranges
From: |
Hans Aberg |
Subject: |
Re: Binary scanner not matching character ranges |
Date: |
Sat, 18 Dec 2004 00:22:16 +0100 |
User-agent: |
Microsoft-Outlook-Express-Macintosh-Edition/5.0.6 |
Should your rules be "\xff\xfb." or "\xff\xfb". (etc.)? Is the 8-bit scanner
option on?
On 2004/12/17 21:42, Shaun Jackman at address@hidden wrote:
> I'm writing a binary scanner for the Telnet protocol, which is deadly
> simple. The escape sequence 0xff preceeds a two or three byte command,
> and everything else is a normal character. The rule explicit
> "\xff\xec" is matching, but all the rules with a '.' in them are not
> matching. For example, the input sequence 0xff 0xfd 0x03 is being
> matched by the last rule three times, rather than the fourth rule,
> "\xff\xfd.". I've tried using character ranges instead, like
> [\x00-\xff], but I'm not having any luck.
>
> "\xff\xec" return xEOF;
> "\xff\xfb." yylval = yytext[2]; return WILL;
> "\xff\xfc." yylval = yytext[2]; return WONT;
> "\xff\xfd." yylval = yytext[2]; return DO;
> "\xff\xfe." yylval = yytext[2]; return DONT;
> "\xff\xff" return 255;
> "\xff." yylval = yytext[1]; return IAC;
> . return yytext[0];
>
> Please cc me in your reply. Thanks,
> Shaun
>
>
> _______________________________________________
> Help-flex mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-flex