mbeckerle commented on a change in pull request #223: Daffodil 1444 schema comp 
simple types
URL: https://github.com/apache/incubator-daffodil/pull/223#discussion_r289986059
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
 ##########
 @@ -315,9 +313,8 @@ class Compiler(var validateDFDLSchemas: Boolean = true)
    */
   def compileSource(schemaSource: DaffodilSchemaSource): ProcessorFactory =
     Compiler.synchronized {
-      val noParent = null // null indicates this is the root, and has no parent
-      val sset = new SchemaSet(rootSpec, externalDFDLVariables, 
Seq(schemaSource), validateDFDLSchemas, checkAllTopLevel, noParent, tunablesObj)
-      val pf = new ProcessorFactory(sset)
+      lazy val sset: SchemaSet = new SchemaSet(Some(pf), rootSpec, 
externalDFDLVariables, Seq(schemaSource), validateDFDLSchemas, 
checkAllTopLevel, tunablesObj)
+      lazy val pf: ProcessorFactory = new ProcessorFactory(sset)
       val err = pf.isError
 
 Review comment:
   The two objects, schemaSet, and PF, probably should just be merged at some 
point. But right now the SchemaSet gets responsibility for combining the 
various ways that the root element can be specified - which is explicitly on 
the compiler, explicitly on the PF, or implicitly by way of the schema's first 
schema document's first element.  The PF creates the SchemaSet, but the logic 
for root determination is in the SchemaSet. 

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