Giter Club home page Giter Club logo

a-binary-parser-generator's People

Contributors

pomax avatar tshinnic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a-binary-parser-generator's Issues

Opentype.spec missing ClassDef tables

The test/Opentype/validator.html page blew up on my favorite wonky TTF font file, but I finally tracked it down to missing tables in the .spec file. Saw console.log's of:

    VM462:101 reading undefined structure at GLOBAL offset 1043482.
    VM462:125   readStructure(): f is 'undefined'
    VM462:128 Yes, we saw f get returned as 'undefined'
    VM462:131 Uncaught TypeError: undefined is not a function

where I had added the "Yes, we saw" logging. It might be nice if readStructure() could better handle bad returns from the "new Function()" call.

After laboriously tracking down what data was being worked on, found that Opentype.spec referenced an undefined collection, viz.

890: RELATIVE USHORT OFFSET ClassDef TO _ClassDefTable FROM START

In lieu of (or until) a PR, here's the fix that got me past that point:

--- OpenType.spec.original      2014-11-27 13:33:39.357960200 -0600
+++ OpenType.spec       2014-11-28 00:08:11.807579700 -0600
@@ -767,6 +767,25 @@
           }
         }

+        // used ????
+        Collection _ClassDefTable {
+          USHORT ClassFormat
+          if(ClassFormat==1) {
+            USHORT StartGlyph
+            USHORT GlyphCount
+            USHORT[GlyphCount] ClassValueArray
+          }
+          if(ClassFormat==2) {
+            USHORT ClassRangeCount
+            Collection _ClassRangeRecord {
+              USHORT Start
+              USHORT End
+              USHORT Class
+            }
+            _ClassRangeRecord[RangeCount] ClassRangeRecord
+          }
+        }
+
         // ==========================================
         // LookupType 1: Single Substitution Subtable
         // ==========================================

I can well believe the collection definition ought to go somewhere else...

parse error for TYPE[something / 2] recordname

The RegExp for this is currently

search = "([ \\t]*)([\\w_]+)\\[([^\\.\\s]+(\\s*[\\+\\-\\*\\/]\\s*[^)]+)*)\\]\\s*(\\w+)($|\s*[^O])";

but this should be

search = "([ \\t]*)([\\w_]+)\\[([^\\.\\s]+(\\s*[\\+\\-\\*\\/]\\s*[^\\]]+)*)\\]\\s*(\\w+)($|\s*[^O])";

difference is in matching until ^] rather than ^)

add Endian indicators

not all data types are created equal, and some binary files have a strict endian policy, whereas others do not. This needs some kind of spec indicator, probably the easiest being:

[BIG|LITTLE] ENDIAN

with 'machine ordering' if left off.

figure out how to add custom decoders

CFF and PNG required additional data unpacking, using more than just byte sequence reading. Find out what a good way is to get this to work without introducing a specific programming language

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.