Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changes between Version 12 and Version 13 of StructuredBinaryData


Ignore:
Timestamp:
2012-07-20T00:31:49Z (7 years ago)
Author:
Sean Bartell
Comment:

add some detail about parameters

Legend:

Unmodified
Added
Removed
Modified
  • StructuredBinaryData

    v12 v13  
    133133||= name =||= input =||= output =||= description =||= example =||
    134134||ascii           ||blob node        ||string       ||decodes some bytes as ASCII characters ||  `hex:6869` becomes `"hi"` ||
     135||uint8           ||1‐byte blob node ||integer node ||decodes a 1‐byte unsigned integer ||  `hex:11` becomes `17` ||
     136||uint16be        ||2‐byte blob node ||integer node ||decodes a 2‐byte big‐endian unsigned integer ||  `hex:0201` becomes `513` ||
     137||uint16le        ||2‐byte blob node ||integer node ||decodes a 2‐byte little‐endian unsigned integer ||  `hex:0101` becomes `257` ||
    135138||uint32be        ||4‐byte blob node ||integer node ||decodes a 4‐byte big‐endian unsigned integer ||  `hex:00000201` becomes `513` ||
    136139||uint32le        ||4‐byte blob node ||integer node ||decodes a 4‐byte little‐endian unsigned integer ||  `hex:01010000` becomes `257` ||
     140||uint64be        ||8‐byte blob node ||integer node ||decodes a 8‐byte big‐endian unsigned integer ||  `hex:0000000000000201` becomes `513` ||
     141||uint64le        ||8‐byte blob node ||integer node ||decodes a 8‐byte little‐endian unsigned integer ||  `hex:0101000000000000` becomes `257` ||
    137142||zero_terminated ||blob node        ||blob node    ||takes bytes up until the first `00` ||  `hex:7f0400` becomes `hex:7f04` ||
    138143
     
    201206In approximate order of priority.
    202207
    203  Transform parameters:: Currently, a transform can only have one input. This
    204    makes various things impossible, particularly cases where the way a field is
    205    decoded depends on previous fields. Parameters will allow a transform to use
    206    multiple inputs, allowing things like
    207    `.len <- uint32le; .str <- ascii <- known_length(.len);`. It still needs to
    208    be determined whether parameters should be named or just positional.
    209  Simple expressions:: These are needed to determine the value of parameters.
    210    Simple expressions will allow transforms like `known_length(.len)` or
    211    `known_length(8)`; more complicated arithmetic expressions will be developed
    212    later.
     208=== Transform parameters ===
     209
     210Currently, a transform can only have one input. Parameters will allow a
     211transform to use multiple inputs: `transform strings(len) = struct { .str1 <-
     212ascii <- known_length(len); .str2 <- ascii <- known_length(len); };`.
     213
     214At first the only expressions will be parameters, as above, previously decoded
     215fields, as in `.len <- uint32le; .data <- known_length(.len);`, or integer
     216literals.
     217
     218=== Other ideas ===
     219
    213220 Conditional transforms:: A way to apply different transforms depending on an
    214221   expression. For example, something like:
     
    222229   This is essential for non‐sequential blobs like filesystems.
    223230 Bitfields:: `struct` will be extended to work with bits instead of just bytes.
     231 Complex expressions:: Expressions that use operators or call transforms.
    224232 Assertions:: These could be implemented as transforms that don't actually
    225233   change the input. There could be multiple levels, ranging from “warning” to