Embeddable Parser for binary data?

stidolph@leland.Stanford.EDU (Wayne Stidolph)
Fri, 25 Mar 1994 16:14:13 GMT

          From comp.compilers

Related articles
Embeddable Parser for binary data? stidolph@leland.Stanford.EDU (1994-03-25)
Re: Embeddable Parser for binary data? ph@anweald.exnet.co.uk (Patrick Herring) (1994-03-26)
| List of all articles for this month |

Newsgroups: comp.compilers
From: stidolph@leland.Stanford.EDU (Wayne Stidolph)
Keywords: question
Organization: Stanford University, CA 94305, USA
Date: Fri, 25 Mar 1994 16:14:13 GMT

I'm tasked to build a browser of binary data: the data (bus dumps) is to
be shown to human users in meaningful forms. I have collected the data,
and we can groups the data into the meaningful blocks (a message from Unit
A to the host, for example). Now I need to show the block contents to the
user... that is, I need to compile the binary crud into English (or
graphics, or ...) thus, I'm asking for a bit of guidance from the
compiler-knowledgable!


I need to take the blocks of data and present the contents (in various
ways) to the user. There are many, many data block formats and I don't
want to be recompiling and hardcoding the formats all the time. I'd like
to let users define their own formats, and fields of interest in the
data...let the program pick up utility as it is used and extended *by
users* (not me).


I propose the program read in the data block, read some headers in the
data, and then decide which "format file" is appropriate. The program
would then read in the "format file" and convert the data into strings for
presentation. In essence, I need an interpreter where the "format file" is
the program being interpreted, acting on the data block.


I need some hints on how to tackle this - I've had only one compiler
course, and implemented only one other interpreter (it had only a dozen or
so actions, so we just stuffed them into embedded actions in a YACC
grammer) so don't assume I've thought of and discarded "the obvious!"


The environment is IBM PC-clones, under DOS, Windows, or OS/2. I have most
of the popular C/C++ compilers available, but am willing to switch
environments if some super-tool is available :) I can't see letting the
parser drive the whole program (a la default YACC behavior) as I'd like to
be able to operate inside the main event loop of an OS/2 PM program.


So - any pointers to embedding binary data interpreters? Please?


    Wayne Stidolph
--
Wayne.Stidolph@mtv.gtegsc.com or stidolph@leland.stanford.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.