how to do a dynamic parser in X3?

Richard <[email protected]> Tue, 29 Aug 2023 21:48:39 -0600
Newsgroups gmane.comp.parsers.spirit.general
Organization multi-cellular, biological
Message-ID <[email protected]>
Hi,

So the symbols parser is an example of a dynamic parser in X3.  I am trying to
write a parser for a GIF image file.  A GIF file is a series of chunks.  Chunks
are prefixed with a length indicating the number of bytes in the chunk.  Many
binary formats have the length of a binary block encoded in the stream followed
by <length> bytes (or words or whatever unit) representing the block.

How do we parse this using X3 spirit?

Do we use a success handler for the length to record it in the context and then
somehow use a repeat parser that grabs the repeat count from the context?
What, exactly, does that look like?

I'm hoping to figure this out in time for a presentation on X3 to Utah C++
Programmers on Sept. 13th.

Thanks,

-- Richard
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
             The Terminals Wiki <http://terminals-wiki.org>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>