Length information comes after the usage of the actual length. Is it even possible to use it in Grammar?

0 votes
asked Aug 14, 2020 by phate (120 points)
The image format is the following:
data0 | fillerbytes | header | data1 | fillerbytes

The data is of variable length and the information how long it is can be found in the header. The header is at a fixed position so it can be read. I can use the extracted length for data1 but it does not seem to work for data0. Any ideas?

Don't ask why it is like that. I guess the engineers in TW had a good reason for that.

1 Answer

0 votes
answered Feb 17, 2023 by guruadmin (680 points)

Probably something like in the ZIP grammar could work: a simple script continues parsing at header, then another script let data0 be parsed.