Need help organizing my project.

The goal of my project is ultimately to create a way to describe binary data structures, and a way read those data-structures from some input source.

I'm trying to be as modular as I can, but maybe I'm being to modular.  If that really is the case, I'm definitely open to other ways to organize it.

What I've got right now:

  • BinaryTypes langauge: Mostly a framework, mostly abstract concepts or interface concepts. Things like BinaryType (the type in the type system), IBinaryTypeDefinition (the definition of the type, provided by other languages.
  • Reader language: Provides concepts for describing how to read data of BinaryType types, and expressions/statements for the end-user to use for reading the data from the input. (I'll probably split this into two at some point, if I can)
  • Primitives language: Extends BinaryTypes, and Reader, and provides the concept PrimitiveTypeDefinition,
  • Primitives.default model: (not sure where I want this to live. I've tried both a Solution, or an Accessory model of Primitives language, neither of which made a difference)
  • Primitives readers@generator generator: Generator that is supposed to create ReaderDefinition from PrimitiveTypeDefinition.
  • Various runtime solutions, providing library/framework code for the various languages above.
  • A sandbox solution

Yes, I know that this much can be done with just ByteBuffers, but this is only laying the foundation for more complex stuff.

So, the Reader language has a root mapping rule from ReaderDefinition->ClassConcept, and that seems to work well. It also has a reduction rule for ReadExpression, and that works well.  

The trouble I'm running into is how to generate the ReaderDefinition nodes from the PrimitiveTypeDefinition nodes,

If I use the generator on the Primitives.default model, I'll get a transient result that has the readers in them, but no mapping anywhere, and they aren't referenceable from the sandbox anyway.

If I attempt to build the sandbox with all the languages, the generators don't pick up the imported Primitive.defaults. I tried both accessory model and stand-alone Solution for that model. 

Thanks for reading. Any help would be greatly appreciated.

1 comment

For posterity: My approach was mostly good. I just needed a Pre-Processor-Script to add my PrimitiveDeclarations into the model to be translated.

I had tried that once or twice, and thought it failed, but turns out some sort of cache or class-loading problem made it appear to not work.

0

Please sign in to leave a comment.