This is a static archive of the previous Open Grid Forum Redmine content management system saved from host redmine.ogf.org file /boards/21/topics/421 at Thu, 03 Nov 2022 15:39:00 GMT New DFDL bitOrder is needed for binary format whose field order is specified right to left. - Public Comments Archive - Open Grid Forum

New DFDL bitOrder is needed for binary format whose field order is specified right to left.

Added by russ hawkins about 8 years ago

I am responsible for parsing and unparsing binary formats whose specification lists the fields from right to left, and whose fields are rarely on byte boundaries, often many fields being contained within a single byte. Although within a given field the MSBit is on the left, within a given byte and across byte boundaries the first field to be parsed is to the right (toward the LSBit side) of the second field to parse, and so forth from beginning to end.

In a data stream for this protocol (serial or socket) the content bytes are presented least-significant byte first, which approximates the first to last field order but the approximation is insufficient. The inverted intra-byte and cross-byte field order presents a problem - it is not parsable with normal MSB first interpretation.

This problem is much different from and not solvable by a simple endian byte order specification.

The new 'bitOrder=leastSignificantBitFirst' enhancement addresses this need. Without the 'LSB first' feature we cannot parse this type of content with DFDL processors and must resort to custom solutions. There are several legacy formats whose specifications follow this reverse-field-order presentation whose parse and unparse will be facilitated by the new feature.


Replies (1)

(1-1/1)

This is a static archive of the previous Open Grid Forum Redmine content management system saved from host redmine.ogf.org file /boards/21/topics/421 at Thu, 03 Nov 2022 15:39:00 GMT