mbeckerle commented on a change in pull request #228: Incremental progress on 
Daffodil 1444 schema compiler space/speed issue.
URL: https://github.com/apache/incubator-daffodil/pull/228#discussion_r291750159
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SchemaComponent.scala
 ##########
 @@ -143,16 +144,65 @@ trait SchemaComponent
     et
   }
 
+  final lazy val enclosingTerms: Seq[Term] = {
+    val ec = enclosingComponents.map { _._1 }
+    val et = ec.flatMap { sc =>
+      sc match {
+        case t: Term => Seq(t)
+        case ct: ComplexTypeBase => ct.enclosingTerms
+        case gedf: GlobalElementDeclFactory => gedf.enclosingComponents.map { 
_._1 }.flatMap { _.enclosingTerms }
+        case _ => Assert.invariantFailed("Should only be Term or ComplexType")
+      }
+    }
+    et
+  }
+
   /**
    * path is used in diagnostic messages and code debug
    * messages; hence, it is very important that it be
    * very dependable.
    */
   override lazy val path = {
-    val p = scPath.map { _.diagnosticDebugName }.mkString("::")
+    val list = scPath.filter { isComponentForSSCD(_) }
+    val p = list.map { _.diagnosticDebugName }.mkString("::")
     p
   }
 
+  private def isComponentForSSCD(sc: SchemaComponent) = {
+    sc match {
+      case _: SchemaDocument => false
+      case _: XMLSchemaDocument => false
+      case _: DFDLSchemaFile => false
+      case _: Schema => false
+      case _: SchemaSet => false
+      case _ => true
+    }
+  }
+
+  lazy val sscd: String = {
 
 Review comment:
   rename, or scaladoc. SSCD is ShortSchemaComponentDesignator

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