You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2017/12/06 15:58:40 UTC
[GitHub] jadams-tresys commented on a change in pull request #16: Implemented packed binary formats
jadams-tresys commented on a change in pull request #16: Implemented packed binary formats
URL: https://github.com/apache/incubator-daffodil/pull/16#discussion_r155278192
##########
File path: daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/ElementBaseGrammarMixin.scala
##########
@@ -700,10 +718,19 @@ trait ElementBaseGrammarMixin
binaryNumberKnownLengthInBits > 8)) {
byteOrderRaw // must be defined or SDE
}
- Assert.invariant(binaryIntRep == bin)
- binaryNumberKnownLengthInBits match {
- case -1 => new BinaryIntegerRuntimeLength(this, isSigned)
- case _ => new BinaryIntegerKnownLength(this, isSigned, binaryNumberKnownLengthInBits)
+ (binaryNumberRep, lengthKind, binaryNumberKnownLengthInBits) match {
+ case (BinaryNumberRep.Binary, _, -1) => new BinaryIntegerRuntimeLength(this, isSigned)
+ case (BinaryNumberRep.Binary, _, _) => new BinaryIntegerKnownLength(this, isSigned, binaryNumberKnownLengthInBits)
+ case (BinaryNumberRep.Packed, LengthKind.Delimited, -1) => new PackedIntegerDelimitedEndOfData(this, isSigned)
+ case (BinaryNumberRep.Packed, _, -1) => new PackedIntegerRuntimeLength(this, isSigned)
+ case (BinaryNumberRep.Packed, _, _) => new PackedIntegerKnownLength(this, isSigned, binaryNumberKnownLengthInBits)
+ case (BinaryNumberRep.Bcd, LengthKind.Delimited, -1) => new BCDIntegerDelimitedEndOfData(this)
+ case (BinaryNumberRep.Bcd, _, -1) => new BCDIntegerRuntimeLength(this)
+ case (BinaryNumberRep.Bcd, _, _) => new BCDIntegerKnownLength(this, binaryNumberKnownLengthInBits)
Review comment:
No, BCD is always unsigned
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services