mbeckerle commented on a change in pull request #422:
URL: https://github.com/apache/incubator-daffodil/pull/422#discussion_r499785309



##########
File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/ElementCombinator.scala
##########
@@ -328,9 +351,21 @@ class ElementParseAndUnspecifiedLength(context: 
ElementBase, eBeforeGram: Gram,
       new ElementUnparserNoRep(context.erd, uSetVar)
     }
   }
+
+  override def generateCode(cgState: CodeGeneratorState): Unit = {
+    context.schemaDefinitionWhen(context.inputValueCalcOption.isDefined, 
"Elements with inputValueCalc are not supported.")
+    context.schemaDefinitionWhen(context.outputValueCalcOption.isDefined, 
"Elements with outputValueCalc are not supported.")
+    context.schemaDefinitionUnless(eBeforeGram.isEmpty, "Statements associated 
with elements are not supported.")
+    context.schemaDefinitionUnless(eAfterGram.isEmpty, "Statements associated 
with elements are not supported.")
+    context.schemaDefinitionUnless(repTypeElementGram.isEmpty, "dfdlx:repType 
is not supported.")
+
+    val elementContentGenerator = eGram // a Gram isA ParserGenerator
+    val e = new ElementParserGenerator(context, elementContentGenerator)
+    e.generateCode(cgState)
+  }

Review comment:
       I would get a clean commit, stick down a branch, then try it. Honestly I 
think it will be pretty simple given that only a few things have generateCode 
methods on them currently. Several are no-ops, the default that "errors out" 
becomes the default case of a match case in the one-true 
CCodeGenerator.generate(g: Gram, cgs: CodeGeneratorState): Unit Function.




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


Reply via email to