jadams-tresys commented on a change in pull request #262: Unordered sequences
URL: https://github.com/apache/incubator-daffodil/pull/262#discussion_r320272102
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/SequenceParserBases.scala
 ##########
 @@ -44,6 +49,23 @@ abstract class SequenceParserBase(
   override lazy val childProcessors = childParsers
 }
 
+abstract class UnorderedSequenceParserBase(
+  srd: SequenceRuntimeData,
+  choiceParser: ChoiceParser,
+  childParsersArg: Vector[Parser])
+  extends SequenceParserBase(srd, childParsersArg) {
+
+  override protected def parse(pstate: PState) = {
+
+    do {
+      choiceParser.parse(pstate)
+    } while (pstate.processorStatus eq Success)
+
+    pstate.setSuccess()
 
 Review comment:
   I have added validation code for min/max occurs, although it ended up being 
more complex than originally expected.  Given that arrays within unordered 
sequences do not need to be contiguous, we were creating multiple DIArrays for 
the same element.  I was originally going to prevent the creation of multiple 
arrays, but that had issues if we backtracked.  So, in order to get a proper 
count we had to combine the arrays.

----------------------------------------------------------------
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