mbeckerle commented on a change in pull request #214: Sequences and Separators 
Refactoring and Rewrite
URL: https://github.com/apache/incubator-daffodil/pull/214#discussion_r284796903
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/Term.scala
 ##########
 @@ -803,4 +877,87 @@ trait Term
     }
   }
 
+  /**
+   * A zeroLengthDetector is a runtime device used by the unparser to
+   * determine whether a term could unparse to zero length or not.
+   *
+   * Computed statically, because sometimes we know that it is not possible
+   * for the representation to be zero length (e.g., non-nillable ahd 
non-defaultable
+   * int always has to have at least one digit.)
+   *
+   * Used by unparsing algorithms that involve separator suppression for
+   * zero-length data.
 
 Review comment:
   Add that the point of this is to avoid the overhead of unparser uncertainty 
about a separator being needed or not. If you can examine the value with a 
zero-length-detector and it gives you a positive answer one way or the other, 
you can avoid a great deal of unparser overhead where it has to suspend whether 
to emit a separator. If the ZL detector tells you the representation will be 
greater than zero length, you can just emit a separator and move on. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to