You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/02/18 13:29:20 UTC

[GitHub] [incubator-daffodil] stevedlawrence commented on a change in pull request #324: DAFFODIL-1444 Schema Compiler Space/Speed

stevedlawrence commented on a change in pull request #324: DAFFODIL-1444 Schema Compiler Space/Speed
URL: https://github.com/apache/incubator-daffodil/pull/324#discussion_r380652685
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/AnnotatedSchemaComponent.scala
 ##########
 @@ -200,6 +202,66 @@ abstract class AnnotatedSchemaComponentImpl(
     this(xml, Option(lexicalParent))
 }
 
+/**
+ * Identifies the property environment of a term.
+ *
+ * If two terms have the same propEnv and same def/decl, then some things can be shared
+ * about their implementation.
+ *
+ * If they have different propEnv, then all bets are off.
+ *
+ * Can be used as a key for whether to create new instance in a factory, or whether one
+ * can be re-used because the property environment is the same.
+ *
+ * The trick is that the regular objects which carry properties have location information
+ * unique to where they originate (for diagnostic messaging purposes).
+ *
+ * What we want is pure value based - depends on the properties and their values only.
+ *
+ * The components are of type Seq[Set[String, String]] because the machinery below has
+ * alredy converted dfdl:ref="q:name" format references into references to objects having
+ * property resolvers. It is easiest just to extract the string-to-string information rather than
+ * trying to reuse the named format objects directly.
+ *
+ * optNext is the optional next schema component. So for an element reference, it is the
+ * global element declaration. For a group reference, it is the group definition. It is the
+ * next place we would get properties from (and defaults from) for property resolution.
+ */
+case class PropEnv(localProps: Seq[Set[(String, String)]], defaultPropSource: Seq[Set[(String, String)]], optNext: Option[scala.xml.Node]) {
 
 Review comment:
   Can you newline/indent the parameters? It's a bit long. Same with commett below.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services