mbeckerle commented on code in PR #1604:
URL: https://github.com/apache/daffodil/pull/1604#discussion_r2678078983


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/AlignedMixin.scala:
##########
@@ -321,23 +476,24 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
           case LengthKind.Delimited => encodingLengthApprox
           case LengthKind.Pattern => encodingLengthApprox
           case LengthKind.EndOfParent => LengthMultipleOf(1) // NYI
-          case LengthKind.Prefixed => LengthMultipleOf(1) // NYI
+          case LengthKind.Prefixed => {
+            val prefixElem = eb.prefixedLengthElementDecl
+            if (prefixElem.lengthKind == Explicit) {
+              LengthExact(
+                prefixElem.elementLengthInBitsEv.optConstant.get.get
+              ) + prefixLengthElementLength
+            } else {
+              getEncodingLengthApprox(prefixElem)

Review Comment:
   This sort of "stuff" really does happen. TLOG format is a published schema 
on DFDLSchemas site. It is a binary format with character delimiters here and 
there. It does sort of help if looking at text dumps of the data. The binary 
numbers come through as [mojibake](https://en.wikipedia.org/wiki/Mojibake), but 
you can pick out the delimiters often and figure the data out via a combination 
of text and hex dumps. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to