stevedlawrence commented on a change in pull request #214: Sequences and
Separators Refactoring and Rewrite
URL: https://github.com/apache/incubator-daffodil/pull/214#discussion_r285142128
##########
File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/Term.scala
##########
@@ -434,51 +454,105 @@ trait Term
*/
def isVariableOccurrences: Boolean = false
+ /**
+ * True when a term's immediately enclosing model group is a Sequence.
+ */
+ final lazy val isSequenceChild: Boolean =
+ immediatelyEnclosingModelGroup.map { _.isInstanceOf[SequenceTermBase]
}.getOrElse(false)
+
/**
* The concept of potentially trailing is defined in the DFDL specification.
*
- * It means that the term could have instances that are the last thing in
the sequence group
- * and that are potentially also not present, so the issue of extra
separators being present/absent for
- * instances of the term is relevant.
+ * This concept applies to terms that are direct children of a sequence only.
+ *
+ * It is true for terms that may be absent from the representation, but
furthermore, may be last
+ * in a sequence, so that the notion of whether they are trailing, and so
their separator may not be
+ * present, is a relevant issue.
+ *
+ * If an element is an array, and has some required instances, then it is
not potentially trailing, as some
+ * instances will have to appear, with separators.
+ *
+ * This concept applies only to elements and model groups that have
representation in the data stream.
+ *
+ * Previously there was a misguided notion that since only DFDL elements can
have minOccurs/maxOccurs
+ * that this notion of potentially trailing didn't apply to model groups.
(Sequences and Choices, the other
+ * kind of Term). But this is not the case.
+ *
Review comment:
This sounds like a change without Daffodil works now. Is this a backward
incompatable change? Do the added tunables allow for backwards compatability?
We could also argue that this was a bug, and that we shouldn't try to
maintain backwards comatability with bugs.
----------------------------------------------------------------
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