A-binary-parser-generator icon indicating copy to clipboard operation
A-binary-parser-generator copied to clipboard

Thank you for making this + suggestion to make parser output more human-understandable

Open jsharf opened this issue 9 years ago • 1 comments

Hey,

this tool is awesome, thanks for making this.

One suggestion would be to make the file illustrations self-describing. So allow each field in the file spec to have a comment explaining what it is. That could then optionally show up in the parser output, so a programmer unfamiliar with that file spec could even intuitively understand the file just by looking at the output of the parser.

I guess this is more of a feature request than a bug... sorry if I filed this in the wrong spot.

jsharf avatar Nov 05 '16 07:11 jsharf

oh man, I've not worked on this thing in years - having specs be self descriptive, and yield code that can be queried for this descriptions, sounds like a great idea! Although I don't know if I'm (ever?) going to have time to add that in. That said, with JavaScript having been significantly revised since I wrote this code, it might be interesting to revisit the generator and see if the new syntax makes a rewrite easier.

For something like the OpenType spec though having just the local description tends to break down fairly quickly: for the metadata fields a local description makes sense ("the maximum glyph ascent", "the number of name records in this table") but for real data things get much harder to unravel without the actual guiding documentation that determines the spec. (just knowing that a USHORT in a FeatureRecordData struct is an offset value in a LookupRecord, for instance, does not tell us much more than only that, we still need the proper documentation to figure out what that means =)

Pomax avatar Nov 05 '16 18:11 Pomax