[Flex-help] Handle NULL-NULL in input stream.
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Allen B. <Al...@ep...> - 2014-12-12 14:35:05
|
Is there a way to get the parser to handle more than one consecutive NULL in the input stream? Currently the parser generated by flex recognizes the consecutive NULLs as an EOF which I do not want, I would like to be able to tell the parser when the end of file is reached explicitly through one of my rules calling yyterminate(). For instance say I had a blob of binary data in my input file that may contain a sequence of NULL characters. Luckily I know the length of the binary data because the preceding token contains the following binary length. With this information is it possible to tell the parser, move forward by N bytes and not scan them? Allen Blaylock |