[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing '\x00' -- appears to be the only thing preventing parsing bi
From: |
Stephen Taylor |
Subject: |
Re: Parsing '\x00' -- appears to be the only thing preventing parsing binary data |
Date: |
Thu, 1 Apr 2021 11:30:00 -0400 |
Thanks John, but the whole point is to try to leverage the internal tables and
mechanisms that exist in Bison …. In particular the yytranslate[] table…. And
to be able to write rules that use *all* the hex codes which flex -8 is
supposed to pass along e.g.
R : ‘\x9f’ ‘\xfe’ | ‘\xff’ | ‘\x00’ ;
As well as succinctly express notions such as “any byte” — without listing
every possible 8-bit value and having to check against them to accept a byte.
> On Apr 1, 2021, at 11:05, John P. Hartmann <jphartmann@gmail.com> wrote:
>
> Write your own scanner in C.
>
> On 4/1/21 16:28, Stephen Taylor via Users list for the GNU Bison parser
> generator wrote:
>> Thanks, that seems to get around \x00 -- unfortunately, the same issue then
>> reappears with the values \x80 - \xff … I could special case every single
>> value e.g.
>> \x00 {return ZERO; }
>> \x80 { return X80; }
>> \x81 { return X81; }
>> :
>> \xff { return XFF; }
>> . | \n { return *yytext; }
>> But seems a bit clumsy. Any thoughts?
smime.p7s
Description: S/MIME cryptographic signature