Re: Parsing '\x00' -- appears to be the only thing preventing parsing binary data

2021-04-01 Thread Stephen Taylor via Users list for the GNU Bison parser generator
’ ; 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 wrote: > > Write your own scanner in C. > > On 4/1/21 16:28, Stephen Taylor via

Re: Parsing '\x00' -- appears to be the only thing preventing parsing binary data

2021-04-01 Thread Stephen Taylor via Users list for the GNU Bison parser generator
lex return each character as a token? Can >>> you special-case 0 to not have the token value 0? That is, flex does this: >>> >>> \x00 { return ZERO; } >>> >>> And then in your grammar: >>> >>> %token ZERO >>> >>> an

Re: Parsing '\x00' -- appears to be the only thing preventing parsing binary data

2021-03-30 Thread Stephen Taylor via Users list for the GNU Bison parser generator
n a phone..not 100% sure the syntax is right.) > > -Chris > > >> On Mar 30, 2021, at 12:37 PM, Stephen Taylor via Users list for the GNU >> Bison parser generator wrote: >> >> I am trying to parse binary files and obviously need to write rules that >>

Parsing '\x00' -- appears to be the only thing preventing parsing binary data

2021-03-30 Thread Stephen Taylor via Users list for the GNU Bison parser generator
I am trying to parse binary files and obviously need to write rules that include the 8-bit value 0x00 — flex appears to allow me to obtain an 8-bit scanner using the -8 option. I seem to be able to use ‘\x01’ to ‘\xFF’ for individual terminal symbols in Bison rules. Unfortunately, ‘\x00’ is used