Work on a generic file format description format + tools
Friedrich W. H. Kossebau
kossebau at kde.org
Mon Feb 13 09:42:48 GMT 2012
Hi,
a (troublesome in real life) habit of mine is to try to generalize/abstract
things a little, distracting from the initial task :) To turn this into
something productive still, hereby I want to give you a heads-up about my
current work on a generic file format description and related tools, as
another by-product of my work to create a CDR parser, following the RIFF-
parsing lib Koralle (or is that what they call separation of concern? :P )
Perhaps some of you might want to give comments or join the work? The
sidewinder import/export filter e.g. are quite related, I have yet to fully
understand how those are constructed.
My CDR (v4) filter reads complete RIFF chunks one-by-one and maps
pointer/references of the proper structs onto the chunk to access the
elements. Those structs with nice getter-methods are generated from an XML-
based format description, which shall also serve as base for some nice-to-read
auto-generated textdocument (HTML/ODF) describing the format. And currently I
am also seeing to use the very same file also as base for an as-well auto-
generated description which can be used to browse the file structure in Okteta
(but that is only in planning and will need some work on the Structures tool
sources).
So one source object to automatically generate code, docs and more from.
I am beating the data format describing file more and more, to make it
generally useful. ATM I am creating also a DTD, to help others understanding
it, not yet commited to the repo. See the current state of the file for the
CDRv4 format, which is the proof-of-concept, here:
https://projects.kde.org/projects/calligra/repository/revisions/filters-
karbon-cdr/changes/filters/karbon/cdr/cdr4structs.format
The left-over <method> tags there are just temporary helpers and need to
disappear, currently fighting to solve that.
And the tool to generate (so far just) the cpp header is here:
https://projects.kde.org/projects/calligra/repository/revisions/filters-
karbon-cdr/show/filters/karbon/cdr/generator
The tool should become pluggable what to generate, so people could generate
source files in other languages, docs in other formats and whatever they want
to.
So, as said above, any comments and hints welcome while I hack along :)
Cheers
Friedrich
More information about the calligra-devel
mailing list