You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/01/16 20:31:03 UTC

[GitHub] mbeckerle closed pull request #26: Daffodil 1773 - ambiguous names rebase changes - extension of PR 23

mbeckerle closed pull request #26: Daffodil 1773 - ambiguous names rebase changes - extension of PR 23
URL: https://github.com/apache/incubator-daffodil/pull/26
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DFDLExpressionParser.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DFDLExpressionParser.scala
index 3867074e0..241340d27 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DFDLExpressionParser.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DFDLExpressionParser.scala
@@ -37,9 +37,9 @@ import edu.illinois.ncsa.daffodil.dsom._
 import scala.xml.NamespaceBinding
 import edu.illinois.ncsa.daffodil.xml._
 import scala.util.parsing.input.CharSequenceReader
-import edu.illinois.ncsa.daffodil.oolag.ErrorsNotYetRecorded
 import scala.util.parsing.combinator.RegexParsers
 import java.math.{ BigDecimal => JBigDecimal, BigInteger => JBigInt }
+import edu.illinois.ncsa.daffodil.oolag.OOLAG._
 
 /**
  * Parses DPath expressions. Most real analysis is done later. This is
@@ -59,14 +59,11 @@ class DFDLPathExpressionParser[T <: AnyRef](qn: NamedQName,
   nodeInfoKind: NodeInfo.Kind,
   namespaces: NamespaceBinding,
   context: DPathCompileInfo,
-  isEvaluatedAbove: Boolean) extends RegexParsers {
+  isEvaluatedAbove: Boolean,
+  host: OOLAGHost) extends RegexParsers {
 
   def compile(expr: String): CompiledExpression[T] = {
-    val tree = getExpressionTree(expr)
-
-    if (tree.isError) {
-      throw new ErrorsNotYetRecorded(tree.getDiagnostics)
-    }
+    val tree = getExpressionTree(expr, host)
 
     val recipe = tree.compiledDPath // if we cannot get one this will fail by throwing out of here.
 
@@ -131,7 +128,7 @@ class DFDLPathExpressionParser[T <: AnyRef](qn: NamedQName,
       r
     }
 
-  def getExpressionTree(expr: String): WholeExpression = {
+  def getExpressionTree(expr: String, host: OOLAGHost): WholeExpression = {
     // This wrapping of phrase() prevents a memory leak in the scala parser
     // combinators in scala 2.10. See the following bug for more information:
     //
@@ -212,7 +209,7 @@ class DFDLPathExpressionParser[T <: AnyRef](qn: NamedQName,
   //
   // we don't care if it has braces around it or not.
   def TopLevel: Parser[WholeExpression] = ("{" ~> Expr <~ "}" | Expr) ^^ { xpr =>
-    WholeExpression(nodeInfoKind, xpr, namespaces, context)
+    WholeExpression(nodeInfoKind, xpr, namespaces, context, host)
   }
 
   val SuccessAtEnd = Parser { in => Success(in, new CharSequenceReader("")) }
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/Expression.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/Expression.scala
index ce0125bc7..2d0cb6b74 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/Expression.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dpath/Expression.scala
@@ -576,11 +576,12 @@ case class WholeExpression(
   nodeInfoKind: NodeInfo.Kind,
   ifor: Expression,
   nsBindingForPrefixResolution: NamespaceBinding,
-  ci: DPathCompileInfo)
+  ci: DPathCompileInfo,
+  host: OOLAGHost)
   extends Expression {
 
   def init() {
-    this.setOOLAGContext(null) // we are the root.
+    this.setOOLAGContext(host) // we are the root of expression, but we propagate diagnostics further.
     this.setContextsForChildren()
   }
 
@@ -1102,14 +1103,14 @@ case class NamedStep(s: String, predArg: Option[PredicateExpression])
     val stepElem = if (isFirstStep) {
       if (isAbsolutePath) {
         // has to be the root element, but we have to make sure the name matches.
-        rootElement.findRoot(stepQName)
+        rootElement.findRoot(stepQName, this)
         rootElement
       } else {
         // since we're first we start from the element, or nearest enclosing
         val nc = compileInfo.elementCompileInfo.getOrElse {
           // happens for example if you have defaultValue="false" since false looks like a path step, but is really illegal. should be fn:false().
           compileInfo.SDE("The expression path step '%s' has no defined enclosing element.", s)
-        }.findNamedChild(stepQName)
+        }.findNamedChild(stepQName, this)
         nc
       }
     } else {
@@ -1118,12 +1119,11 @@ case class NamedStep(s: String, predArg: Option[PredicateExpression])
         val psse = ps.stepElement
         psse
       }.map { se =>
-        val nc = se.findNamedChild(stepQName)
+        val nc = se.findNamedChild(stepQName, this)
         nc
       }.getOrElse(die)
       e
     }
-    stepElem.isReferencedByExpressions = true
     stepElem
   }
 }
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ChoiceGroup.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ChoiceGroup.scala
index f7916ae3d..271146ba6 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ChoiceGroup.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ChoiceGroup.scala
@@ -142,9 +142,7 @@ abstract class ChoiceTermBase( final override val xml: Node,
 
   final protected lazy val choiceDispatchKeyExpr = {
     val qn = this.qNameForProperty("choiceDispatchKey")
-    val typeIfStaticallyKnown = NodeInfo.NonEmptyString
-    val typeIfRuntimeKnown = NodeInfo.NonEmptyString
-    ExpressionCompilers.String.compile(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, choiceDispatchKeyRaw)
+    ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, choiceDispatchKeyRaw, this)
   }
 
   final lazy val choiceDispatchKeyEv = {
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression.scala
index 7513a6ce3..084a4e3fa 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression.scala
@@ -37,6 +37,7 @@ import scala.xml.NamespaceBinding
 import edu.illinois.ncsa.daffodil.xml.NamedQName
 import java.lang.{ Long => JLong, Boolean => JBoolean }
 import edu.illinois.ncsa.daffodil.schema.annotation.props.Found
+import edu.illinois.ncsa.daffodil.oolag.OOLAG._
 
 object ExpressionCompilers extends ExpressionCompilerClass {
   override val String = new ExpressionCompiler[String]
@@ -48,7 +49,28 @@ object ExpressionCompilers extends ExpressionCompilerClass {
 class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T] {
 
   /**
-   * For expressions that are the values of DFDL properties
+   * Compiles the expression.
+   *
+   * This method available at compilation and also at runtime for use by the debuggger.
+   *
+   * Expression may or may not have braces around it. It could still be a constant as in
+   * { 5 } or { "California" }, and in that case this should return a ConstantExpression
+   * object.
+   */
+  def compileExpression(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, exprWithBracesMaybe: String, namespaces: NamespaceBinding,
+    compileInfoWherePropertyWasLocated: DPathCompileInfo,
+    isEvaluatedAbove: Boolean, host: OOLAGHost): CompiledExpression[T] = {
+    val (exprForCompiling, isRealExpression) = exprOrLiteral(exprWithBracesMaybe, nodeInfoKind, compileInfoWherePropertyWasLocated)
+    compileExpression1(qn, nodeInfoKind, exprForCompiling, namespaces, compileInfoWherePropertyWasLocated, isEvaluatedAbove, host,
+      isRealExpression)
+  }
+
+  /**
+   * Compile a potentially runtime-valued property.
+   *
+   * The property value can be an expression or a literal constant.
+   *
+   * This form for expressions that are the values of most DFDL properties
    *
    * The isEvaluatedAbove argument is used for properties like occursCount
    * which are evaluated before the element whose declaration carries it, exists.
@@ -56,61 +78,43 @@ class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T] {
    * written. This doesn't matter unless the expression contains relative
    * paths. In that case those relative paths will all have to be adjusted
    * so they work in the context of one node above.
-   *
-   * There are two nodeInfokind args as a hack for dealing with delimiters
-   * where they can be empty string if a literal constant, but cannot be empty
-   * string if returned.
-   */
-  /*
-   * This form for most properties
    */
-  def compile(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, property: Found, isEvaluatedAbove: Boolean = false): CompiledExpression[T] =
-    compile(qn, nodeInfoKind, nodeInfoKind, property, isEvaluatedAbove)
-
-  /*
-     * This form for delimiters and escapeEscapeCharacter since they
-     * can have empty string if statically known, but if an evaluated expression,
-     * it must be non-empty string.
-     *
-     * You can have an empty string, but only statically.
-     * That turns off separators entirely.
-     * If you have an expression (that is not trivially an empty string),
-     * then it must be a non-empty string as the compiled parser will be
-     * generated assuming there will be a concrete separator that is part of
-     * the data syntax and serves as any delimiter to anchor the parse algorithm.
-     *
-     * We don't want to allow turning on/off whether a format is delimited or
-     * not based on runtime expressions, only what the delimiters are.
-     */
-  def compile(qn: NamedQName, staticNodeInfoKind: NodeInfo.Kind, runtimeNodeInfoKind: NodeInfo.Kind, property: Found): CompiledExpression[T] =
-    compile(qn, staticNodeInfoKind, runtimeNodeInfoKind, property, false)
-
-  private def compile(qn: NamedQName, staticNodeInfoKind: NodeInfo.Kind, runtimeNodeInfoKind: NodeInfo.Kind,
-    property: Found, isEvaluatedAbove: Boolean): CompiledExpression[T] = {
-    val expr: String = property.value
-    val namespacesForNamespaceResolution = property.location.namespaces
-    val compileInfoWherePropertyWasLocated = {
-      property.location match {
-        case sc: SchemaComponent => sc.dpathCompileInfo
-        case di: DPathCompileInfo => di
-      }
-    }
-
-    compile(qn, staticNodeInfoKind, runtimeNodeInfoKind, expr, namespacesForNamespaceResolution, compileInfoWherePropertyWasLocated, isEvaluatedAbove)
-  }
+  def compileProperty(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, property: Found, host: OOLAGHost, isEvaluatedAbove: Boolean = false): CompiledExpression[T] =
+    compileExpression(qn,
+      nodeInfoKind,
+      property.value,
+      property.location.namespaces,
+      propertyCompileInfo(property),
+      isEvaluatedAbove, host)
 
   /**
-   * This is the fully general case.
+   * Compile a potentially runtime-valued delimiter property
+   *
+   * The property value can be an expression or a literal constant.
+   *
+   * This form for delimiters and escapeEscapeCharacter since they
+   * can have empty string if statically known, but if an evaluated expression,
+   * it must be non-empty string.
+   *
+   * You can have an empty string, but only statically.
+   * That turns off separators entirely.
+   * If you have an expression (that is not trivially an empty string),
+   * then it must be a non-empty string as the compiled parser will be
+   * generated assuming there will be a concrete separator that is part of
+   * the data syntax and serves as any delimiter to anchor the parse algorithm.
+   *
+   * We don't want to allow turning on/off whether a format is delimited or
+   * not based on runtime expressions, only what the delimiters are.
    */
-  def compile(qn: NamedQName,
-    staticNodeInfoKind: NodeInfo.Kind,
-    runtimeNodeInfoKind: NodeInfo.Kind,
-    expr: String,
-    namespaces: NamespaceBinding,
-    compileInfoWherePropertyWasLocated: DPathCompileInfo,
-    isEvaluatedAbove: Boolean): CompiledExpression[T] = {
-    val compiled1 = compile(qn, staticNodeInfoKind, expr, namespaces, compileInfoWherePropertyWasLocated,
-      isEvaluatedAbove)
+  def compileDelimiter(qn: NamedQName, staticNodeInfoKind: NodeInfo.Kind, runtimeNodeInfoKind: NodeInfo.Kind, property: Found,
+    host: OOLAGHost): CompiledExpression[T] = {
+    val isEvaluatedAbove = false
+    val expr = property.value
+    val namespacesForNamespaceResolution = property.location.namespaces
+    val compileInfoWherePropertyWasLocated = propertyCompileInfo(property)
+    val (exprForCompiling, isRealExpression) = exprOrLiteral(expr, staticNodeInfoKind, compileInfoWherePropertyWasLocated)
+    val compiled1 = compileExpression1(qn, staticNodeInfoKind, exprForCompiling, namespacesForNamespaceResolution, compileInfoWherePropertyWasLocated, isEvaluatedAbove, host,
+      isRealExpression)
     if (compiled1.isConstant) return compiled1
     if (staticNodeInfoKind == runtimeNodeInfoKind) return compiled1
     //
@@ -119,22 +123,39 @@ class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T] {
 
     // This is, this nodeInfo.Kind is used as the target type in the DPath expression compiler, and
     //
-    val compiled2 = compile(qn, runtimeNodeInfoKind, expr, namespaces, compileInfoWherePropertyWasLocated,
-      isEvaluatedAbove)
+    val compiled2 = compileExpression1(qn, runtimeNodeInfoKind, exprForCompiling, namespacesForNamespaceResolution, compileInfoWherePropertyWasLocated,
+      isEvaluatedAbove, host, isRealExpression)
     compiled2
   }
 
   /**
-   * compiles the expression.
+   * Returns compile info of property regardless of origin.
    *
-   * If it happens to be a literal constant (i.e.,
-   * no braces, then this handles that case directly. Otherwise it calls
-   * the method to actually compile the expression.
+   * Needed because before serialization of the runtime data
+   * objects, the location of a property may be the associated schema
+   * component. Once serialized, at runtime when we're compiling expressions
+   * we have only the DPathCompileInfo.
+   */
+  private def propertyCompileInfo(property: Found) = {
+    val compileInfoWherePropertyWasLocated = {
+      property.location match {
+        case sc: SchemaComponent => sc.dpathCompileInfo
+        case di: DPathCompileInfo => di
+      }
+    }
+    compileInfoWherePropertyWasLocated
+  }
+
+  /**
+   * Returns expression and flag as to whether it must be compiled.
    *
+   * If the 2nd return value, 'isRealExpression' is true then we need to compile
+   * the expression, and the expression *will* have curly braces around it.
+   * If the 2nd return value is false, then the expression is a string literal
+   * being evaluated for a string, so we can directly construct a constant
+   * expression object.
    */
-  def compile(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, exprWithBracesMaybe: String, namespaces: NamespaceBinding,
-    compileInfoWherePropertyWasLocated: DPathCompileInfo,
-    isEvaluatedAbove: Boolean) = {
+  private def exprOrLiteral(exprWithBracesMaybe: String, nodeInfoKind: NodeInfo.Kind, compileInfoWherePropertyWasLocated: DPathCompileInfo) = {
     var compile: Boolean = true
     val expr = exprWithBracesMaybe
     //
@@ -161,10 +182,11 @@ class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T] {
         }
         expr1
       }
+
     // If we get here then now it's something we can compile. It might be trivial
     // to compile (e.g, '5' compiles to Literal(5)) but we no longer uniformly
-    // compile everything.  Due to the performance optimization (DFDL-1775), 
-    // we will NOT compile constant strings (constant values whose target type 
+    // compile everything.  As a performance optimization (DFDL-1775),
+    // we will NOT compile constant strings (constant values whose target type
     // is String).
 
     /* Question: If something starts with {{, e.g.
@@ -181,42 +203,29 @@ class ExpressionCompiler[T <: AnyRef] extends ExpressionCompilerBase[T] {
      * If we try to do this outside the expression compiler we'd be replicating
      * some of this type-infer/check logic.
      */
-    val res = if (compile) {
-      compileExpression(qn, nodeInfoKind, exprForCompiling, namespaces,
-        compileInfoWherePropertyWasLocated, isEvaluatedAbove)
-    } else {
-      // Don't compile, meaning this is a constant string
-      val res = new ConstantExpression[T](qn, nodeInfoKind, exprForCompiling.asInstanceOf[T])
-      res
-    }
-    res
+    (exprForCompiling, compile)
   }
 
   /**
-   * Compile the expression.
-   *
-   * Expression may or may not have braces around it. It could still be a constant as in
-   * { 5 } or { "California" }, and in that case this should return a ConstantExpression
-   * object.
+   * Compile the expression or construct a constant expression from it.
    */
-  private def compileExpression(
-    qn: NamedQName,
-    nodeInfoKind: NodeInfo.Kind,
-    expr: String,
-    // Why this additional namespaceBinding argument?
-    // how is this different from the namespace resolution that the
-    // next argument provides? Ans: Point of use versus point of definition.
-    namespaces: NamespaceBinding,
+  private def compileExpression1(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, exprForCompiling: String, namespaces: NamespaceBinding,
     compileInfoWherePropertyWasLocated: DPathCompileInfo,
-    isEvaluatedAbove: Boolean): CompiledExpression[T] = {
-    // This is important. The namespace bindings we use must be
-    // those from the object where the property carrying the expression
-    // was written, not those of the edecl object where the property
-    // value is being used/compiled. JIRA DFDL-407
-    //
-    val compiler = new DFDLPathExpressionParser[T](qn,
-      nodeInfoKind, namespaces, compileInfoWherePropertyWasLocated, isEvaluatedAbove)
-    val compiledDPath = compiler.compile(expr)
-    compiledDPath
+    isEvaluatedAbove: Boolean, host: OOLAGHost, isRealExpression: Boolean): CompiledExpression[T] = {
+    val res = if (isRealExpression) {
+      // This is important. The namespace bindings we use must be
+      // those from the object where the property carrying the expression
+      // was written, not those of the edecl object where the property
+      // value is being used/compiled. JIRA DFDL-407
+      //
+      val compiler = new DFDLPathExpressionParser[T](qn,
+        nodeInfoKind, namespaces, compileInfoWherePropertyWasLocated, isEvaluatedAbove, host)
+      val compiledDPath = compiler.compile(exprForCompiling)
+      compiledDPath
+    } else {
+      // Don't compile, meaning this is a constant string
+      new ConstantExpression[T](qn, nodeInfoKind, exprForCompiling.asInstanceOf[T])
+    }
+    res
   }
 }
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLDefineVariable.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLDefineVariable.scala
index cdbcf4af9..b77af5766 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLDefineVariable.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLDefineVariable.scala
@@ -88,7 +88,7 @@ class DFDLDefineVariable(node: Node, doc: SchemaDocument)
     val compilationTargetType = primType
     val qn = this.qNameForProperty("defaultValue", XMLUtils.dafintURI)
     val defaultValExpr = defaultValue.map { e =>
-      ExpressionCompilers.AnyRef.compile(qn, compilationTargetType, Found(e, this.dpathCompileInfo, "defaultValue", false))
+      ExpressionCompilers.AnyRef.compileProperty(qn, compilationTargetType, Found(e, this.dpathCompileInfo, "defaultValue", false), this)
     }
 
     Maybe.toMaybe(defaultValExpr)
@@ -109,7 +109,7 @@ class DFDLDefineVariable(node: Node, doc: SchemaDocument)
 
 abstract class VariableReference(node: Node, decl: AnnotatedSchemaComponent)
   extends DFDLStatement(node, decl) {
-  
+
   final lazy val ref = getAttributeRequired("ref")
   final lazy val varQName = resolveQName(ref)
 
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLEscapeScheme.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLEscapeScheme.scala
index ab68d774b..846b8c88e 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLEscapeScheme.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/DFDLEscapeScheme.scala
@@ -85,7 +85,7 @@ final class DFDLEscapeScheme(node: Node, decl: AnnotatedSchemaComponent, defES:
 
   final def escapeCharacterEv = LV('escapeCharacterEv) {
     val qn = this.qNameForProperty("escapeCharacter")
-    val expr = ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, escapeCharacterRaw)
+    val expr = ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, escapeCharacterRaw, this)
     val ev = new EscapeCharEv(expr, runtimeData)
     ev.compile()
     ev
@@ -98,7 +98,7 @@ final class DFDLEscapeScheme(node: Node, decl: AnnotatedSchemaComponent, defES:
       case found @ Found(v, loc, _, _) => {
         val typeIfStaticallyKnown = NodeInfo.String
         val typeIfRuntimeKnown = NodeInfo.NonEmptyString
-        val expr = ExpressionCompilers.String.compile(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, found)
+        val expr = ExpressionCompilers.String.compileDelimiter(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, found, this)
         val ev = new EscapeEscapeCharEv(expr, runtimeData)
         ev.compile()
         One(ev)
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/RuntimePropertyMixins.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/RuntimePropertyMixins.scala
index 984b22ad7..4d4fb6cf2 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/RuntimePropertyMixins.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/RuntimePropertyMixins.scala
@@ -108,7 +108,7 @@ trait TermRuntimeValuedPropertiesMixin
         val exp = ConstantExpression(qn, PrimType.HexBinary, "iso-8859-1")
         exp
       }
-      case _ => ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, encodingRaw)
+      case _ => ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, encodingRaw, decl)
     }
   }.value
 
@@ -154,7 +154,7 @@ trait TermRuntimeValuedPropertiesMixin
   lazy val outputNewLineEv = {
     val outputNewLineExpr = {
       val qn = this.qNameForProperty("outputNewLine")
-      ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, outputNewLineRaw)
+      ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, outputNewLineRaw, decl)
     }
     val ev = new OutputNewLineEv(outputNewLineExpr, termRuntimeData)
     ev.compile()
@@ -203,7 +203,7 @@ trait DelimitedRuntimeValuedPropertiesMixin
     val qn = this.qNameForProperty("initiator")
     val typeIfStaticallyKnown = NodeInfo.String
     val typeIfRuntimeKnown = NodeInfo.NonEmptyString
-    ExpressionCompilers.String.compile(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, initiatorRaw)
+    ExpressionCompilers.String.compileDelimiter(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, initiatorRaw, decl)
   }
 
   lazy val initiatorParseEv = {
@@ -224,7 +224,7 @@ trait DelimitedRuntimeValuedPropertiesMixin
     val typeIfStaticallyKnown = NodeInfo.String
     val typeIfRuntimeKnown = NodeInfo.NonEmptyString
     val raw = terminatorRaw
-    ExpressionCompilers.String.compile(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, raw)
+    ExpressionCompilers.String.compileDelimiter(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, raw, decl)
   }.value
 
   final def terminatorLoc = (this.diagnosticDebugName, this.path)
@@ -258,7 +258,7 @@ trait ElementRuntimeValuedPropertiesMixin
 
   private lazy val byteOrderExpr = LV('byteOrder) {
     val qn = this.qNameForProperty("byteOrder")
-    ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, byteOrderRaw)
+    ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, byteOrderRaw, decl)
   }.value
 
   final lazy val byteOrderEv = {
@@ -278,7 +278,7 @@ trait ElementRuntimeValuedPropertiesMixin
 
   protected final lazy val lengthExpr = {
     val qn = this.qNameForProperty("length")
-    ExpressionCompilers.JLong.compile(qn, NodeInfo.Long, lengthRaw)
+    ExpressionCompilers.JLong.compileProperty(qn, NodeInfo.Long, lengthRaw, decl)
   }
 
   private lazy val explicitLengthEv: ExplicitLengthEv = {
@@ -467,7 +467,7 @@ trait ElementRuntimeValuedPropertiesMixin
   private lazy val occursCountExpr = LV('occursCount) {
     val qn = this.qNameForProperty("occursCount")
     val isEvaluatedAbove = true
-    ExpressionCompilers.JLong.compile(qn, NodeInfo.Long, occursCountRaw, isEvaluatedAbove)
+    ExpressionCompilers.JLong.compileProperty(qn, NodeInfo.Long, occursCountRaw, decl, isEvaluatedAbove)
   }.value
 
   lazy val occursCountEv = {
@@ -550,7 +550,7 @@ trait SequenceRuntimeValuedPropertiesMixin
     val qn = this.qNameForProperty("separator")
     val typeIfStaticallyKnown = NodeInfo.String
     val typeIfRuntimeKnown = NodeInfo.NonEmptyString
-    ExpressionCompilers.String.compile(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, separatorRaw)
+    ExpressionCompilers.String.compileDelimiter(qn, typeIfStaticallyKnown, typeIfRuntimeKnown, separatorRaw, decl)
   }
 
   lazy val separatorParseEv = {
@@ -588,7 +588,7 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   private lazy val textStandardDecimalSeparatorExpr = LV('textStandardDecimalSeparator) {
     val qn = this.qNameForProperty("textStandardDecimalSeparator")
-    val c = ExpressionCompilers.String.compile(qn, NodeInfo.String, textStandardDecimalSeparatorRaw)
+    val c = ExpressionCompilers.String.compileProperty(qn, NodeInfo.String, textStandardDecimalSeparatorRaw, decl)
     c
   }.value
 
@@ -600,7 +600,7 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   private lazy val textStandardGroupingSeparatorExpr = LV('textStandardGroupingSeparator) {
     val qn = this.qNameForProperty("textStandardGroupingSeparator")
-    val c = ExpressionCompilers.String.compile(qn, NodeInfo.String, textStandardGroupingSeparatorRaw)
+    val c = ExpressionCompilers.String.compileProperty(qn, NodeInfo.String, textStandardGroupingSeparatorRaw, decl)
     c
   }.value
 
@@ -612,7 +612,7 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   private lazy val textStandardExponentRepExpr = LV('textStandardExponentRep) {
     val qn = this.qNameForProperty("textStandardExponentRep")
-    val c = ExpressionCompilers.String.compile(qn, NodeInfo.String, textStandardExponentRepRaw)
+    val c = ExpressionCompilers.String.compileProperty(qn, NodeInfo.String, textStandardExponentRepRaw, decl)
     c
   }.value
 
@@ -624,7 +624,7 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   private lazy val binaryFloatRepExpr = LV('binaryFloatRep) {
     val qn = this.qNameForProperty("binaryFloatRep")
-    ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, binaryFloatRepRaw)
+    ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, binaryFloatRepRaw, decl)
   }.value
 
   final lazy val binaryFloatRepEv = {
@@ -644,12 +644,12 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   private lazy val textBooleanTrueRepExpr = LV('textBooleanTrueRep) {
     val qn = this.qNameForProperty("textBooleanTrueRep")
-    ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, textBooleanTrueRepRaw)
+    ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, textBooleanTrueRepRaw, decl)
   }.value
 
   private lazy val textBooleanFalseRepExpr = LV('textBooleanFalseRep) {
     val qn = this.qNameForProperty("textBooleanFalseRep")
-    ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, textBooleanFalseRepRaw)
+    ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, textBooleanFalseRepRaw, decl)
   }.value
 
   final lazy val textBooleanTrueRepEv = {
@@ -668,7 +668,7 @@ trait SimpleTypeRuntimeValuedPropertiesMixin
 
   final lazy val calendarLanguage = LV('calendarLanguage) {
     val qn = this.qNameForProperty("calendarLanguage")
-    val c = ExpressionCompilers.String.compile(qn, NodeInfo.NonEmptyString, calendarLanguageRaw)
+    val c = ExpressionCompilers.String.compileProperty(qn, NodeInfo.NonEmptyString, calendarLanguageRaw, decl)
     c
   }.value
 }
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/ElementBaseGrammarMixin.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/ElementBaseGrammarMixin.scala
index 5172c2f53..153b04e31 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/ElementBaseGrammarMixin.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/ElementBaseGrammarMixin.scala
@@ -1060,8 +1060,8 @@ trait ElementBaseGrammarMixin
     val exprText = exprProp.value
     val exprNamespaces = exprProp.location.namespaces
     val qn = GlobalQName(Some("daf"), "outputValueCalc", XMLUtils.dafintURI)
-    val expr = ExpressionCompilers.AnyRef.compile(qn,
-      primType, exprText, exprNamespaces, dpathCompileInfo, false)
+    val expr = ExpressionCompilers.AnyRef.compileExpression(qn,
+      primType, exprText, exprNamespaces, dpathCompileInfo, false, self)
     expr
   }
 
diff --git a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/primitives/PrimitivesExpressions.scala b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/primitives/PrimitivesExpressions.scala
index db992a5a6..00e283402 100644
--- a/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/primitives/PrimitivesExpressions.scala
+++ b/daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/grammar/primitives/PrimitivesExpressions.scala
@@ -182,8 +182,8 @@ abstract class ExpressionEvaluatorBase(e: AnnotatedSchemaComponent) extends Term
   private def qn = GlobalQName(Some("daf"), baseName, XMLUtils.dafintURI)
 
   lazy val expr = LV('expr) {
-    ExpressionCompilers.AnyRef.compile(qn,
-      nodeKind, exprText, exprNamespaces, exprComponent.dpathCompileInfo, false)
+    ExpressionCompilers.AnyRef.compileExpression(qn,
+      nodeKind, exprText, exprNamespaces, exprComponent.dpathCompileInfo, false, this)
   }.value
 }
 
diff --git a/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionEvaluation.scala b/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionEvaluation.scala
index 9cf2459ad..75ac045cd 100644
--- a/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionEvaluation.scala
+++ b/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionEvaluation.scala
@@ -62,7 +62,7 @@ class TestDFDLExpressionEvaluation extends Parsers {
     val erd = decl.elementRuntimeData
     val infosetRootElem = TestInfoset.elem2Infoset(erd, infosetAsXML)
     val qn = GlobalQName(Some("daf"), "testExpr", XMLUtils.dafintURI)
-    val exprCompiler = new DFDLPathExpressionParser[AnyRef](qn, NodeInfo.AnyType, testSchema.scope, erd.dpathCompileInfo, false)
+    val exprCompiler = new DFDLPathExpressionParser[AnyRef](qn, NodeInfo.AnyType, testSchema.scope, erd.dpathCompileInfo, false, sset)
     val compiledExpr = exprCompiler.compile(expr)
     val doc = infosetRootElem.parent.asInstanceOf[DIDocument]
 
diff --git a/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionTree.scala b/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionTree.scala
index 957a523c2..3f79e179a 100644
--- a/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionTree.scala
+++ b/daffodil-core/src/test/scala/edu/illinois/ncsa/daffodil/dpath/TestDFDLExpressionTree.scala
@@ -60,8 +60,8 @@ class TestDFDLExpressionTree extends Parsers {
     val decl = declf.forRoot()
     val erd = decl.elementRuntimeData
 
-    val exprCompiler = new DFDLPathExpressionParser(qn, NodeInfo.String, testSchema.scope, erd.dpathCompileInfo, false)
-    val result = exprCompiler.getExpressionTree(expr)
+    val exprCompiler = new DFDLPathExpressionParser(qn, NodeInfo.String, testSchema.scope, erd.dpathCompileInfo, false, sset)
+    val result = exprCompiler.getExpressionTree(expr, sset)
     body(result)
   }
 
@@ -73,8 +73,8 @@ class TestDFDLExpressionTree extends Parsers {
     val Seq(declf) = schemaDoc.globalElementDecls
     val decl = declf.forRoot()
     val erd = decl
-    val exprCompiler = new DFDLPathExpressionParser(qn, NodeInfo.AnyType, testSchema.scope, decl.dpathCompileInfo, false)
-    val result = exprCompiler.getExpressionTree(expr)
+    val exprCompiler = new DFDLPathExpressionParser(qn, NodeInfo.AnyType, testSchema.scope, decl.dpathCompileInfo, false, sset)
+    val result = exprCompiler.getExpressionTree(expr, sset)
     body(result, erd.elementRuntimeData)
   }
 
@@ -100,7 +100,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_a() = {
     testExpr2(aSchema, "{ /tns:a }") { (ce, erd) =>
-      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _) = ce
+      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _, _) = ce
       val List(n1) = steps
       val n1p @ NamedStep("tns:a", None) = n1; assertNotNull(n1p)
       assertFalse(n1.isArray)
@@ -125,7 +125,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_a_pred() {
     testExpr2(bSchema, "{ /tns:b/a[/tns:b/i] }") { (ce, erd) =>
-      val w @ WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _) = ce
+      val w @ WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _, _) = ce
       val List(b, a) = steps
       val bp @ NamedStep("tns:b", None) = b; assertNotNull(bp)
       val NamedStep("a", Some(PredicateExpression(i))) = a
@@ -141,7 +141,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_a_predPred() {
     testExpr(dummySchema, "{ a[i[j]] }") { actual =>
-      val WholeExpression(_, RelativePathExpression(steps, _), _, _) = actual
+      val WholeExpression(_, RelativePathExpression(steps, _), _, _, _) = actual
       val List(n1) = steps
       val NamedStep("a", Some(PredicateExpression(rel))) = n1
       val RelativePathExpression(List(n2), _) = rel
@@ -153,7 +153,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_relativePath() = {
     testExpr(dummySchema, "{ ../..[2]/bookstore }") { actual =>
-      val WholeExpression(_, RelativePathExpression(steps, _), _, _) = actual
+      val WholeExpression(_, RelativePathExpression(steps, _), _, _, _) = actual
       val List(n1, n2, n3) = steps
       val u @ Up(None) = n1; assertNotNull(u)
       val u2 @ Up(Some(PredicateExpression(LiteralExpression(two: JBigInt)))) = n2; assertNotNull(u2)
@@ -183,7 +183,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_absolutePath() = {
     testExpr2(testSchema, "{ /tns:bookstore/book/title }") { (actual, erd) =>
-      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _) = actual
+      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _, _) = actual
       val List(n1, n2, n3) = steps
       val n1p @ NamedStep("tns:bookstore", None) = n1; assertNotNull(n1p)
       assertTrue(n1.isFirstStep)
@@ -226,7 +226,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_pathNoSuchElement1() {
     testExpr2(testSchema, "{ /thereIsNoElementWithThisName }") { (actual, erd) =>
-      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(List(step), _))), _, _) = actual
+      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(List(step), _))), _, _, _) = actual
       val exc = intercept[SchemaDefinitionError] {
         step.stepElement
       }
@@ -240,7 +240,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_predPath() = {
     testExpr(dummySchema, "{ /bookstore[$i]/book/title }") { actual =>
-      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _) = actual
+      val WholeExpression(_, RootPathExpression(Some(RelativePathExpression(steps, _))), _, _, _) = actual
       val List(n1, n2, n3) = steps
       val NamedStep("bookstore", pred) = n1
       // println(pred)
@@ -253,7 +253,7 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def testAddConstants() {
     testExpr(dummySchema, "{ 1 + 2 }") { actual =>
-      val a @ WholeExpression(_, AdditiveExpression("+", List(LiteralExpression(one: JBigInt), LiteralExpression(two: JBigInt))), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, AdditiveExpression("+", List(LiteralExpression(one: JBigInt), LiteralExpression(two: JBigInt))), _, _, _) = actual; assertNotNull(a)
       assertEquals(BigDecimal(1), BigDecimal(one))
       assertEquals(BigDecimal(2), BigDecimal(two))
     }
@@ -261,14 +261,14 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def testFnTrue() {
     testExpr(dummySchema, "{ fn:true() }") { actual =>
-      val a @ WholeExpression(_, FunctionCallExpression("fn:true", Nil), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, FunctionCallExpression("fn:true", Nil), _, _, _) = actual; assertNotNull(a)
     }
   }
 
   @Test def test_numbers1() = {
     testExpr(dummySchema, "0.") { actual: Expression =>
       val res = BigDecimal("0.0")
-      val a @ WholeExpression(_, LiteralExpression(actualRes), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, LiteralExpression(actualRes), _, _, _) = actual; assertNotNull(a)
       val bd = BigDecimal(actualRes.asInstanceOf[JBigDecimal])
       assertEquals(res, bd)
     }
@@ -276,34 +276,34 @@ class TestDFDLExpressionTree extends Parsers {
 
   @Test def test_numbers() = {
 
-    testExpr(dummySchema, "5.0E2") { case WholeExpression(_, LiteralExpression(500.0), _, _) => /* ok */ ; }
-    testExpr(dummySchema, "5E2") { case WholeExpression(_, LiteralExpression(500.0), _, _) => /* ok */ ; }
-    testExpr(dummySchema, ".2E2") { case WholeExpression(_, LiteralExpression(20.0), _, _) => /* ok */ ; }
-    testExpr(dummySchema, ".2E-3") { case WholeExpression(_, LiteralExpression(0.0002), _, _) => /* ok */ ; }
-    testExpr(dummySchema, ".2E+3") { case WholeExpression(_, LiteralExpression(200.0), _, _) => /* ok */ ; }
+    testExpr(dummySchema, "5.0E2") { case WholeExpression(_, LiteralExpression(500.0), _, _, _) => /* ok */ ; }
+    testExpr(dummySchema, "5E2") { case WholeExpression(_, LiteralExpression(500.0), _, _, _) => /* ok */ ; }
+    testExpr(dummySchema, ".2E2") { case WholeExpression(_, LiteralExpression(20.0), _, _, _) => /* ok */ ; }
+    testExpr(dummySchema, ".2E-3") { case WholeExpression(_, LiteralExpression(0.0002), _, _, _) => /* ok */ ; }
+    testExpr(dummySchema, ".2E+3") { case WholeExpression(_, LiteralExpression(200.0), _, _, _) => /* ok */ ; }
 
     //    testExpr(dummySchema, "0.") { actual =>
     //      val res = new JBigDecimal("0.0")
-    //      val a @ WholeExpression(_, LiteralExpression(`res`), _, _) = actual; assertNotNull(a)
+    //      val a @ WholeExpression(_, LiteralExpression(`res`), _, _, _) = actual; assertNotNull(a)
     //    }
     testExpr(dummySchema, ".1") { actual =>
       val res = new JBigDecimal("0.1")
-      val a @ WholeExpression(_, LiteralExpression(`res`), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, LiteralExpression(`res`), _, _, _) = actual; assertNotNull(a)
     }
     testExpr(dummySchema, "982304892038409234982304892038409234.0909808908982304892038409234") { actual =>
       val res = new JBigDecimal("982304892038409234982304892038409234.0909808908982304892038409234")
-      val WholeExpression(_, LiteralExpression(r: JBigDecimal), _, _) = actual
+      val WholeExpression(_, LiteralExpression(r: JBigDecimal), _, _, _) = actual
       assertEquals(res, r)
     }
 
     testExpr(dummySchema, "0") { actual =>
       val res = scala.math.BigInt(0)
-      val a @ WholeExpression(_, LiteralExpression(actualRes: JBigInt), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, LiteralExpression(actualRes: JBigInt), _, _, _) = actual; assertNotNull(a)
       assertEquals(res, BigInt(actualRes))
     }
     testExpr(dummySchema, "9817239872193792873982173948739879128370982398723897921370") { actual =>
       val res = scala.math.BigInt("9817239872193792873982173948739879128370982398723897921370")
-      val a @ WholeExpression(_, LiteralExpression(actualRes: JBigInt), _, _) = actual; assertNotNull(a)
+      val a @ WholeExpression(_, LiteralExpression(actualRes: JBigInt), _, _, _) = actual; assertNotNull(a)
       assertEquals(res, BigInt(actualRes))
     }
 
@@ -313,7 +313,7 @@ class TestDFDLExpressionTree extends Parsers {
 
     def testStringLit(expr: String) {
       testExpr(dummySchema, expr) {
-        case WholeExpression(_, LiteralExpression(expr), _, _) => /* ok */
+        case WholeExpression(_, LiteralExpression(expr), _, _, _) => /* ok */
       }
     }
     testStringLit("'abc'")
@@ -334,7 +334,7 @@ class TestDFDLExpressionTree extends Parsers {
 
     def testFn(expr: String)(body: FunctionCallExpression => Unit) {
       testExpr(dummySchema, expr) { actual =>
-        val WholeExpression(_, fnExpr: FunctionCallExpression, _, _) = actual
+        val WholeExpression(_, fnExpr: FunctionCallExpression, _, _, _) = actual
         body(fnExpr)
       }
     }
@@ -352,7 +352,7 @@ class TestDFDLExpressionTree extends Parsers {
     else -h
   else +i
         }""") { actual =>
-      val WholeExpression(_, IfExpression(Seq(pred, thenPart, elsePart)), _, _) = actual
+      val WholeExpression(_, IfExpression(Seq(pred, thenPart, elsePart)), _, _, _) = actual
       val p @ OrExpression(
         List(RelativePathExpression(List(NamedStep("a", None)), _),
           AndExpression(
diff --git a/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/util/MaybeInt.scala b/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/util/MaybeInt.scala
index b944ba779..8274724ba 100644
--- a/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/util/MaybeInt.scala
+++ b/daffodil-lib/src/main/scala/edu/illinois/ncsa/daffodil/util/MaybeInt.scala
@@ -176,4 +176,7 @@ object MaybeBoolean {
   @inline final def apply(v: Boolean) = new MaybeBoolean(if (v) 1 else 0)
 
   val Nope = new MaybeBoolean(undefValue)
+  val True = MaybeBoolean(true)
+  val False = MaybeBoolean(false)
+  
 }
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/debugger/InteractiveDebugger.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/debugger/InteractiveDebugger.scala
index b75f39616..8605a2718 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/debugger/InteractiveDebugger.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/debugger/InteractiveDebugger.scala
@@ -64,6 +64,7 @@ import edu.illinois.ncsa.daffodil.infoset.InfosetItem
 import edu.illinois.ncsa.daffodil.infoset.InfosetElement
 import edu.illinois.ncsa.daffodil.infoset.XMLTextInfosetOutputter
 import edu.illinois.ncsa.daffodil.processors.parsers.ConvertTextCombinatorParser
+import edu.illinois.ncsa.daffodil.oolag.OOLAG._
 
 abstract class InteractiveDebuggerRunner {
   def init(id: InteractiveDebugger): Unit
@@ -312,8 +313,15 @@ class InteractiveDebugger(runner: InteractiveDebuggerRunner, eCompilers: Express
       // compile the expression
       //
       val compiledExpr = try {
-        eCompilers.JBoolean.compile(debuggerQName,
-          NodeInfo.Boolean, expression, processor.context.namespaces, context.dpathCompileInfo, false)
+        val hostForDiags = new DebuggerHost()
+        val ce = eCompilers.JBoolean.compileExpression(debuggerQName,
+          NodeInfo.Boolean, expression, processor.context.namespaces, context.dpathCompileInfo, false,
+          hostForDiags)
+        val warnings = hostForDiags.getDiagnostics.filterNot(_.isError)
+        warnings.foreach {
+          debugPrintln(_)
+        }
+        ce
       } catch {
         //
         // These are compile-time errors for the expression compilation
@@ -1046,10 +1054,15 @@ class InteractiveDebugger(runner: InteractiveDebuggerRunner, eCompilers: Express
           else adjustedExpression
         val isEvaluatedAbove = false
         try {
-          val compiledExpression = eCompilers.AnyRef.compile(debuggerQName,
+          val hostForDiags = new DebuggerHost()
+          val compiledExpression = eCompilers.AnyRef.compileExpression(debuggerQName,
             NodeInfo.AnyType, expressionWithBraces, namespaces, context.dpathCompileInfo,
-            isEvaluatedAbove)
+            isEvaluatedAbove, hostForDiags)
           val res = compiledExpression.evaluate(state)
+          val warnings = hostForDiags.getDiagnostics.filterNot(_.isError)
+          warnings.foreach {
+            debugPrintln(_)
+          }
           res match {
             case ie: InfosetElement => debugPrettyPrintXML(ie)
             case nodeSeq: Seq[Any] => nodeSeq.foreach { a =>
@@ -1805,3 +1818,9 @@ class InteractiveDebugger(runner: InteractiveDebuggerRunner, eCompilers: Express
     }
   }
 }
+
+/**
+ * A stub OOLAGHost is needed to accumulate warnings that may be created
+ * during expression compilation in the debugger.
+ */
+class DebuggerHost extends OOLAGHostImpl(null) // null means this is the root OOLAG Host
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DPath.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DPath.scala
index 65be97132..f435aa57b 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DPath.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dpath/DPath.scala
@@ -60,11 +60,11 @@ class ExpressionEvaluationException(e: Throwable, s: ParseOrUnparseState)
 // Misc.getSomeMessage(e).get
 
 final class RuntimeExpressionDPath[T <: AnyRef](qn: NamedQName, tt: NodeInfo.Kind, recipe: CompiledDPath,
-                                                dpathText: String,
-                                                ci: DPathCompileInfo,
-                                                isEvaluatedAbove: Boolean,
-                                                override val contentReferencedElementInfos: Set[DPathElementCompileInfo],
-                                                override val valueReferencedElementInfos: Set[DPathElementCompileInfo])
+  dpathText: String,
+  ci: DPathCompileInfo,
+  isEvaluatedAbove: Boolean,
+  override val contentReferencedElementInfos: Set[DPathElementCompileInfo],
+  override val valueReferencedElementInfos: Set[DPathElementCompileInfo])
   extends CompiledExpression[T](qn, dpathText) with DoSDEMixin {
 
   override def targetType = tt
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression1.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression1.scala
index 51f0ed4d5..8d00503bc 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression1.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/CompiledExpression1.scala
@@ -339,6 +339,11 @@ class DPathElementCompileInfo(
    * value is determined during DPath compilation, which requires that the
    * DPathElementCompileInfo already exists. So this must be a mutable value
    * that can be flipped during schema compilation.
+   *
+   * Note that in the case of multiple child element decls with the same name,
+   * we must make sure ALL of them get this var set.
+   *
+   * This is done on the Seq returned when findNameMatches is called.
    */
   var isReferencedByExpressions = false
 
@@ -357,17 +362,45 @@ class DPathElementCompileInfo(
     }
   }
 
+  /**
+   * Marks compile info that element is referenced by an expression    //
+   *
+   * We must indicate for all children having this path step as their name
+   * that they are referenced by expression. Expressions that end in such
+   * a path step are considered "query style" expressions as they may
+   * return more than one node, which DFDL v1.0 doesn't allow. (They also may
+   * not return multiple, as the different path step children could be in
+   * different choice branches. Either way, we have to indicate that they are
+   * ALL referenced by this path step.
+   */
+  private def indicateReferencedByExpression(matches: Seq[DPathElementCompileInfo]): Unit = {
+    matches.foreach { info =>
+      info.isReferencedByExpressions = true
+    }
+  }
   /**
    * Finds a child ERD that matches a StepQName. This is for matching up
    * path steps (for example) to their corresponding ERD.
+   *
+   * TODO: Must eventually change to support query-style expressions where there
+   * can be more than one such child.
    */
-  final def findNamedChild(step: StepQName): DPathElementCompileInfo =
-    findNamedMatch(step, elementChildrenCompileInfo)
+  final def findNamedChild(step: StepQName,
+    expr: ImplementsThrowsOrSavesSDE): DPathElementCompileInfo = {
+    val matches = findNamedMatches(step, elementChildrenCompileInfo, expr)
+    indicateReferencedByExpression(matches)
+    matches(0)
+  }
 
-  final def findRoot(step: StepQName): DPathElementCompileInfo =
-    findNamedMatch(step, Seq(this))
+  final def findRoot(step: StepQName,
+    expr: ImplementsThrowsOrSavesSDE): DPathElementCompileInfo = {
+    val matches = findNamedMatches(step, Seq(this), expr)
+    indicateReferencedByExpression(matches)
+    matches(0)
+  }
 
-  private def findNamedMatch(step: StepQName, possibles: Seq[DPathElementCompileInfo]): DPathElementCompileInfo = {
+  private def findNamedMatches(step: StepQName, possibles: Seq[DPathElementCompileInfo],
+    expr: ImplementsThrowsOrSavesSDE): Seq[DPathElementCompileInfo] = {
     val matchesERD: Seq[DPathElementCompileInfo] = step.findMatches(possibles)
 
     val retryMatchesERD =
@@ -385,11 +418,45 @@ class DPathElementCompileInfo(
 
     retryMatchesERD.length match {
       case 0 => noMatchError(step, possibles)
-      case 1 => retryMatchesERD(0)
-      case _ => queryMatchError(step, matchesERD)
+      case 1 => // ok
+      case _ => queryMatchWarning(step, retryMatchesERD, expr)
     }
+    retryMatchesERD
   }
 
+  /**
+   * Returns a subset of the possibles which are truly ambiguous siblings.
+   * Does not find all such, but if any exist, it finds some ambiguous
+   * Siblings. Only returns empty Seq if there are no ambiguous siblings.
+   */
+  //      private def ambiguousModelGroupSiblings(possibles: Seq[DPathElementCompileInfo]) : Seq[DPathElementCompileInfo] = {
+  //        val ambiguityLists: Seq[Seq[DPathElementCompileInfo]] = possibles.tails.toSeq.map{
+  //          possiblesList =>
+  //          if (possiblesList.isEmpty) Nil
+  //          else {
+  //            val one = possiblesList.head
+  //            val rest = possiblesList.tail
+  //            val ambiguousSiblings = modelGroupSiblings(one, rest)
+  //            val allAmbiguous =
+  //                if (ambiguousSiblings.isEmpty) Nil
+  //            else one +: ambiguousSiblings
+  //            allAmbiguous
+  //          }
+  //        }
+  //          val firstAmbiguous = ambiguityLists
+  //          ambiguityLists.head
+  //        }
+
+  /**
+   * Returns others that are direct siblings of a specific one.
+   *
+   * Direct siblings means they have the same parent, but that parent
+   * cannot be a choice.
+   */
+  //  private def modelGroupSiblings(one: DPathElementCompileInfo, rest: Seq[DPathElementCompileInfo]): Seq[DPathElementCompileInfo] = {
+  //    rest.filter(r => one.immediateEnclosingCompileInfo eq r.immediateEnclosingCompileInfo &&
+  //        one.immediateEnclosingCompileInfo
+  //  }
   /**
    * Issues a good diagnostic with suggestions about near-misses on names
    * like missing prefixes.
@@ -444,8 +511,9 @@ class DPathElementCompileInfo(
     }
   }
 
-  final def queryMatchError(step: StepQName, matches: Seq[DPathElementCompileInfo]) = {
-    SDE("Statically ambiguous or query-style paths not supported in step path: '%s'. Matches are at locations:\n%s",
+  private def queryMatchWarning(step: StepQName, matches: Seq[DPathElementCompileInfo],
+    expr: ImplementsThrowsOrSavesSDE) = {
+    expr.SDW("Statically ambiguous or query-style paths not supported in step path: '%s'. Matches are at locations:\n%s",
       step, matches.map(_.schemaFileLocation.locationDescription).mkString("- ", "\n- ", ""))
   }
 }
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ExpressionCompiler.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ExpressionCompiler.scala
index bfef0d2cb..8735670b4 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ExpressionCompiler.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/dsom/ExpressionCompiler.scala
@@ -36,13 +36,14 @@ import edu.illinois.ncsa.daffodil.dpath.NodeInfo
 import edu.illinois.ncsa.daffodil.xml.NamedQName
 import scala.xml.NamespaceBinding
 import java.lang.{ Long => JLong, Boolean => JBoolean }
+import edu.illinois.ncsa.daffodil.oolag.OOLAG._
 
 trait ExpressionCompilerBase[T <: AnyRef] {
 
-  def compile(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, exprWithBracesMaybe: String, namespaces: NamespaceBinding,
+  def compileExpression(qn: NamedQName, nodeInfoKind: NodeInfo.Kind, exprWithBracesMaybe: String, namespaces: NamespaceBinding,
     compileInfoWherePropertyWasLocated: DPathCompileInfo,
-    isEvaluatedAbove: Boolean): CompiledExpression[T]
-
+    isEvaluatedAbove: Boolean,
+    host: OOLAGHost): CompiledExpression[T]
 }
 
 abstract class ExpressionCompilerClass {
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/infoset/InfosetImpl.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/infoset/InfosetImpl.scala
index f73adfe59..d5c0ccdea 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/infoset/InfosetImpl.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/infoset/InfosetImpl.scala
@@ -118,6 +118,19 @@ trait InfosetException {
   def asDiagnostic = self
 }
 
+/**
+ * Indicates that an expression evaluated to a node sequence of more than
+ * one value. This results in a schema definition error at runtime.
+ */
+case class InfosetAmbiguousNodeException(node: DIComplex, info: DPathElementCompileInfo)
+  extends Diagnostic(One(info.schemaFileLocation), Nope, Nope,
+    One("Path step '%s' ambiguous. More than one infoset node corresponds to this name.\n" +
+      "Query-style expressions are not supported."), info.namedQName.toExtendedSyntax)
+  with InfosetException {
+  def isError = true
+  def modeName = "Schema Definition"
+}
+
 trait InfosetNodeNotFinalException extends InfosetException with RetryableException {
   self: Diagnostic =>
   def node: DINode
@@ -1334,8 +1347,23 @@ sealed class DIComplex(override val erd: ElementRuntimeData, val tunable: Daffod
     getChild(erd.dpathElementCompileInfo)
   }
 
+  private def noQuerySupportCheck(nodes: Seq[DINode], info: DPathElementCompileInfo) = {
+    if (nodes.length > 1) {
+      // might be more than one result
+      // but we have to rule out there being an empty DIArray
+      val withoutEmptyArrays = nodes.filter { node =>
+        node match {
+          case a: DIArray if a.length == 0 => false
+          case _ => true
+        }
+      }
+      if (withoutEmptyArrays.length > 1)
+        info.toss(InfosetAmbiguousNodeException(this, info))
+    }
+  }
+
   final def getChild(info: DPathElementCompileInfo): InfosetElement = {
-    val maybeNode = findChild(info.namedQName)
+    val maybeNode = findChild(info)
     if (maybeNode.isDefined)
       maybeNode.get.asInstanceOf[InfosetElement]
     else
@@ -1350,7 +1378,7 @@ sealed class DIComplex(override val erd: ElementRuntimeData, val tunable: Daffod
 
   final def getChildArray(info: DPathElementCompileInfo): InfosetArray = {
     Assert.usage(info.isArray)
-    val maybeNode = findChild(info.namedQName)
+    val maybeNode = findChild(info)
     if (maybeNode.isDefined) {
       maybeNode.get.asInstanceOf[InfosetArray]
     } else {
@@ -1396,12 +1424,13 @@ sealed class DIComplex(override val erd: ElementRuntimeData, val tunable: Daffod
     }
   }
 
-  def findChild(qname: NamedQName): Maybe[DINode] = {
+  def findChild(info: DPathElementCompileInfo): Maybe[DINode] = {
+    val qname = info.namedQName
     val fastSeq = nameToChildNodeLookup.get(qname)
     if (fastSeq != null) {
       // Daffodil does not support query expressions yet, so there should only
       // be one item in the list
-      Assert.invariant(fastSeq.length == 1)
+      noQuerySupportCheck(fastSeq, info)
       One(fastSeq(0))
     } else if (tunable.allowExternalPathExpressions) {
       // Only DINodes used in expressions defined in the schema are added to
@@ -1415,7 +1444,7 @@ sealed class DIComplex(override val erd: ElementRuntimeData, val tunable: Daffod
 
       // Daffodil does not support query expressions yet, so there should be at
       // most one item found
-      Assert.invariant(found.length <= 1)
+      noQuerySupportCheck(found, info)
       Maybe.toMaybe(found.headOption)
     } else {
       Nope
@@ -1452,7 +1481,6 @@ sealed class DIComplex(override val erd: ElementRuntimeData, val tunable: Daffod
           fastSeq.reduceToSize(fastSeq.length - 1)
         }
       }
-
       i -= 1
     }
     // now just quickly remove all those children
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Runtime.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Runtime.scala
index 1b1f8a15d..3717411e2 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Runtime.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/Runtime.scala
@@ -354,6 +354,10 @@ class DataProcessor(val ssrd: SchemaSetRuntimeData)
         unparserState.setFailed(new UnparseError(None, None, e))
         unparserState.unparseResult
       }
+      case ie: InfosetException => {
+        unparserState.setFailed(new UnparseError(None, None, ie))
+        unparserState.unparseResult
+      }
       case th: Throwable => throw th
     }
     res
diff --git a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/RuntimeData.scala b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/RuntimeData.scala
index 827924d5d..0f03d74f0 100644
--- a/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/RuntimeData.scala
+++ b/daffodil-runtime1/src/main/scala/edu/illinois/ncsa/daffodil/processors/RuntimeData.scala
@@ -933,11 +933,11 @@ final class VariableRuntimeData(
   @throws(classOf[java.io.IOException])
   final private def writeObject(out: java.io.ObjectOutputStream): Unit = serializeObject(out)
 
-  private val state =
+  private lazy val state =
     if (!maybeDefaultValueExpr.isDefined) VariableUndefined
     else VariableDefined
 
-  private val maybeValue: Maybe[AnyRef] =
+  private lazy val maybeValue: Maybe[AnyRef] =
     if (maybeDefaultValueExpr.isEmpty) Nope
     else {
       val defaultValueExpr = maybeDefaultValueExpr.get
diff --git a/daffodil-tdml/src/main/scala/edu/illinois/ncsa/daffodil/tdml/TDMLRunner.scala b/daffodil-tdml/src/main/scala/edu/illinois/ncsa/daffodil/tdml/TDMLRunner.scala
index 247a7a18f..7a74132a3 100644
--- a/daffodil-tdml/src/main/scala/edu/illinois/ncsa/daffodil/tdml/TDMLRunner.scala
+++ b/daffodil-tdml/src/main/scala/edu/illinois/ncsa/daffodil/tdml/TDMLRunner.scala
@@ -651,7 +651,10 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
     roundTrip: Boolean,
     tracer: Option[Debugger]) = {
 
-    val useSerializedProcessor = if (validationMode == ValidationMode.Full) false else true
+    val useSerializedProcessor =
+      if (validationMode == ValidationMode.Full) false
+      else if (optWarnings.isDefined) false
+      else true
     val nBits = optLengthLimitInBits.get
     val dataToParse = optDataToParse.get
 
@@ -697,37 +700,44 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
     optWarnings: Option[ExpectedWarnings],
     optValidationErrors: Option[ExpectedValidationErrors],
     validationMode: ValidationMode.Type) {
-
-    val diagnostics = {
-      if (processor.isError) processor.getDiagnostics
+    lazy val sw = new StringWriter()
+    val (diagnostics, isError: Boolean) = {
+      if (processor.isError) (processor.getDiagnostics, true)
       else {
-        val sw = new StringWriter()
+
         val out = new XMLTextInfosetOutputter(sw)
         val actual = processor.parse(dataToParse, out, lengthLimitInBits)
-        if (actual.isError) actual
-        else {
-          val loc: DataLocation = actual.resultState.currentLocation
-
-          if (!loc.isAtEnd) {
-            val leftOverMsg = "Left over data. Consumed %s bit(s) with %s bit(s) remaining.".format(loc.bitPos1b - 1, lengthLimitInBits - (loc.bitPos1b - 1))
-            actual.addDiagnostic(new GeneralParseFailure(leftOverMsg))
-            actual
-          } else {
-            // We did not get an error!!
-            // val diags = actual.getDiagnostics().map(_.getMessage()).foldLeft("")(_ + "\n" + _)
-            throw new TDMLException("Expected error. Didn't get one. Actual result was\n" + sw.toString)
+        val isErr: Boolean =
+          if (actual.isError) true
+          else {
+            //
+            // didn't get an error.
+            // If we're not at the end of data, synthesize an error for left-over-data
+            //
+            val loc: DataLocation = actual.resultState.currentLocation
+
+            if (!loc.isAtEnd) {
+              val leftOverMsg = "Left over data. Consumed %s bit(s) with %s bit(s) remaining.".format(loc.bitPos1b - 1, lengthLimitInBits - (loc.bitPos1b - 1))
+              actual.addDiagnostic(new GeneralParseFailure(leftOverMsg))
+              true
+            } else {
+              false
+            }
           }
-        }
-        processor.getDiagnostics ++ actual.getDiagnostics
+
+        val diagnostics = processor.getDiagnostics ++ actual.getDiagnostics
+        (diagnostics, isErr)
       }
     }
-
-    // check for any test-specified errors
-    VerifyTestCase.verifyAllDiagnosticsFound(diagnostics, Some(errors))
-
     // check for any test-specified warnings
     VerifyTestCase.verifyAllDiagnosticsFound(diagnostics, optWarnings)
-
+    if (isError) {
+      // good we expected an error
+      // check for any test-specified errors
+      VerifyTestCase.verifyAllDiagnosticsFound(diagnostics, Some(errors))
+    } else {
+      throw new TDMLException("Expected error. Didn't get one. Actual result was\n" + sw.toString)
+    }
   }
 
   def runParseExpectSuccess(processor: DFDL.DataProcessor,
@@ -790,10 +800,6 @@ case class ParserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
 
       leftOverException.map { throw _ } // if we get here, throw the left over data exception.
 
-      // TODO: Implement Warnings
-      // check for any test-specified warnings
-      //verifyAllDiagnosticsFound(actual, warnings)
-
       val allDiags = processor.getDiagnostics ++ actual.getDiagnostics
       VerifyTestCase.verifyAllDiagnosticsFound(allDiags, warnings)
 
@@ -876,12 +882,6 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
     val processor = getProcessor(schemaSource, useSerializedProcessor)
     processor.right.foreach {
       case (warnings, proc) =>
-        //
-        // Print out the warnings
-        // (JIRA DFDL-1583 is implementation of expected warnings checking.)
-        //
-        warnings.foreach { System.err.println(_) }
-
         setupDebugOrTrace(proc)
     }
 
@@ -897,6 +897,8 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
       case (_, Some(errors)) => {
         processor.left.foreach { diags =>
           VerifyTestCase.verifyAllDiagnosticsFound(diags, Some(errors))
+          // check warnings even if there are errors expected.
+          VerifyTestCase.verifyAllDiagnosticsFound(diags, optWarnings)
         }
         processor.right.foreach {
           case (warnings, processor) =>
@@ -942,9 +944,8 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
       // we will need to treat as Hex bytes as well.
       VerifyTestCase.verifyBinaryOrMixedData(expectedData, outStream)
     }
-
-    // TODO: Implement Warnings - check for any test-specified warnings
-    // verifyAllDiagnosticsFound(actual, warnings)
+    val allDiags = actual.getDiagnostics ++ processor.getDiagnostics
+    VerifyTestCase.verifyAllDiagnosticsFound(allDiags, warnings)
 
     if (roundTrip) {
       val out = new ScalaXMLInfosetOutputter()
@@ -967,6 +968,7 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
 
       val xmlNode = out.getResult
       VerifyTestCase.verifyParserTestData(xmlNode, inputInfoset)
+      VerifyTestCase.verifyAllDiagnosticsFound(actual.getDiagnostics, warnings)
 
       (shouldValidate, expectsValidationError) match {
         case (true, true) => {
@@ -1030,8 +1032,9 @@ case class UnparserTestCase(ptc: NodeSeq, parentArg: DFDLTestSuite)
       }
     }
 
-    // check for any test-specified errors
+    // check for any test-specified errors or warnings
     VerifyTestCase.verifyAllDiagnosticsFound(diagnostics, Some(errors))
+    VerifyTestCase.verifyAllDiagnosticsFound(diagnostics, optWarnings)
   }
 }
 
diff --git a/daffodil-tdml/src/test/resources/test/tdml/testWarnings.tdml b/daffodil-tdml/src/test/resources/test/tdml/testWarnings.tdml
new file mode 100644
index 000000000..a398250c3
--- /dev/null
+++ b/daffodil-tdml/src/test/resources/test/tdml/testWarnings.tdml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<tdml:testSuite 
+  suiteName="tdml warnings" 
+  description="Tests for TDML Runner warnings features." 
+  xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:ex="http://example.com" 
+  xmlns:fn="http://www.w3.org/2005/xpath-functions"
+  defaultRoundTrip="false">
+
+<tdml:defineSchema name="causesWarnings" elementFormDefault="unqualified">
+
+  <dfdl:format ref="ex:daffodilTest1" lengthKind="explicit" occursCountKind="implicit"/>
+
+  <xs:element name="causesWarnings" dfdl:lengthKind="implicit">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="A" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" />
+        <xs:element name="B" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0"/>
+        <xs:sequence>
+          <xs:annotation>
+            <xs:appinfo source="http://www.ogf.org/dfdl/">
+              <dfdl:assert>{ ./AmbigElt eq '2' }</dfdl:assert>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:sequence>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  
+    <xs:element name="errUnparsing" dfdl:lengthKind="implicit">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="A" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" />
+        <xs:element name="B" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0" />
+        <xs:element name="UnparseFails" type="xs:string" dfdl:length="1"
+           dfdl:outputValueCalc="{ ../AmbigElt }"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+</tdml:defineSchema>
+
+<tdml:parserTestCase name="warningWhenExpectingError" root="causesWarnings" model="causesWarnings" description="TDML runner verifies warnings and errors.">
+
+  <tdml:document><![CDATA[1234]]></tdml:document>
+
+  <tdml:errors>
+    <tdml:error>Schema Definition Error</tdml:error>
+    <tdml:error>query-style</tdml:error>
+    <tdml:error>AmbigElt</tdml:error>
+  </tdml:errors>
+
+  <tdml:warnings>
+    <tdml:warning>Schema Definition Warning</tdml:warning>
+    <tdml:warning>AmbigElt</tdml:warning>
+    <tdml:warning>query-style</tdml:warning>
+  </tdml:warnings>
+</tdml:parserTestCase>
+
+<tdml:unparserTestCase name="unparserWarningWhenExpectingError" root="errUnparsing" model="causesWarnings" description="TDML runner verifies warnings and errors.">
+  <tdml:infoset>
+    <tdml:dfdlInfoset>
+      <ex:errUnparsing>
+        <A>1</A>
+        <AmbigElt>2</AmbigElt>
+        <B>3</B>
+        <AmbigElt>4</AmbigElt>
+      </ex:errUnparsing>
+    </tdml:dfdlInfoset>
+  </tdml:infoset>
+  
+  <tdml:document><![CDATA[12344]]></tdml:document>
+
+  <tdml:errors>
+    <tdml:error>Schema Definition Error</tdml:error>
+    <tdml:error>query-style</tdml:error>
+    <tdml:error>AmbigElt</tdml:error>
+  </tdml:errors>
+
+  <tdml:warnings>
+    <tdml:warning>Schema Definition Warning</tdml:warning>
+    <tdml:warning>AmbigElt</tdml:warning>
+    <tdml:warning>query-style</tdml:warning>
+  </tdml:warnings>
+</tdml:unparserTestCase>
+
+
+<tdml:parserTestCase name="warningWhenExpectingSuccess" root="causesWarnings" model="causesWarnings" description="TDML runner verifies warnings and infoset.">
+
+  <tdml:document><![CDATA[123]]></tdml:document>
+
+  <tdml:infoset>
+    <tdml:dfdlInfoset>
+      <ex:causesWarnings>
+        <A>1</A>
+        <AmbigElt>2</AmbigElt>
+        <B>3</B>
+      </ex:causesWarnings>
+    </tdml:dfdlInfoset>
+  </tdml:infoset>
+
+  <tdml:warnings>
+    <tdml:warning>Schema Definition Warning</tdml:warning>
+    <tdml:warning>query-style</tdml:warning>
+    <tdml:warning>AmbigElt</tdml:warning>
+  </tdml:warnings>
+</tdml:parserTestCase>
+
+<tdml:unparserTestCase name="unparserWarningWhenExpectingSuccess" root="causesWarnings" model="causesWarnings" description="TDML runner verifies warnings and infoset.">
+
+  <tdml:document><![CDATA[123]]></tdml:document>
+
+  <tdml:infoset>
+    <tdml:dfdlInfoset>
+      <ex:causesWarnings>
+        <A>1</A>
+        <AmbigElt>2</AmbigElt>
+        <B>3</B>
+      </ex:causesWarnings>
+    </tdml:dfdlInfoset>
+  </tdml:infoset>
+
+  <tdml:warnings>
+    <tdml:warning>Schema Definition Warning</tdml:warning>
+    <tdml:warning>query-style</tdml:warning>
+    <tdml:warning>AmbigElt</tdml:warning>
+  </tdml:warnings>
+</tdml:unparserTestCase>
+
+
+</tdml:testSuite>
diff --git a/daffodil-tdml/src/test/scala/edu/illinois/ncsa/daffodil/tdml/TestTDMLRunnerWarnings.scala b/daffodil-tdml/src/test/scala/edu/illinois/ncsa/daffodil/tdml/TestTDMLRunnerWarnings.scala
new file mode 100644
index 000000000..70b43b4dd
--- /dev/null
+++ b/daffodil-tdml/src/test/scala/edu/illinois/ncsa/daffodil/tdml/TestTDMLRunnerWarnings.scala
@@ -0,0 +1,243 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.illinois.ncsa.daffodil.tdml
+
+import org.junit.Test
+import org.junit.AfterClass
+import edu.illinois.ncsa.daffodil.Implicits._
+import junit.framework.Assert.fail
+
+object TestTDMLRunnerWarnings {
+  val runner = Runner("/test/tdml/", "testWarnings.tdml")
+
+  @AfterClass def shutDown {
+    runner.reset
+  }
+}
+
+class TestTDMLRunnerWarnings {
+  import TestTDMLRunnerWarnings._
+
+  // DAFFODIL-1583
+  @Test def test_warningWhenExpectingSuccess() = { runner.runOneTest("warningWhenExpectingSuccess") }
+  @Test def test_warningWhenExpectingError() = { runner.runOneTest("warningWhenExpectingError") }
+  @Test def test_unparserWarningWhenExpectingSuccess() = { runner.runOneTest("unparserWarningWhenExpectingSuccess") }
+  @Test def test_unparserWarningWhenExpectingError() = { runner.runOneTest("unparserWarningWhenExpectingError") }
+
+  /*
+   * These tests insure that the TDML runner is actually testing the warnings.
+   * A TDML test could silently not even be checking the warnings and pass with false positive.
+   * These tests cause the TDML runner test to fail to find warnings, and check
+   * that we got the TDML runner to detect this.
+   */
+
+  @Test def testWarningsCheckedParserExpectingSuccess() = {
+    val testSuite =
+      <tdml:testSuite suiteName="tdml warnings" xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com" xmlns:fn="http://www.w3.org/2005/xpath-functions">
+        <tdml:defineSchema name="causesWarnings" elementFormDefault="unqualified">
+          <dfdl:format ref="ex:daffodilTest1" lengthKind="explicit"/>
+          <xs:element name="causesWarnings" dfdl:lengthKind="implicit">
+            <xs:complexType>
+              <xs:sequence>
+                <xs:element name="A" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1"/>
+                <xs:element name="B" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0"/>
+                <xs:sequence>
+                  <xs:annotation>
+                    <xs:appinfo source="http://www.ogf.org/dfdl/">
+                      <dfdl:discriminator test="{ ./AmbigElt eq '2' }"/>
+                    </xs:appinfo>
+                  </xs:annotation>
+                </xs:sequence>
+              </xs:sequence>
+            </xs:complexType>
+          </xs:element>
+        </tdml:defineSchema>
+        <tdml:parserTestCase name="warningWhenExpectingSuccess" root="causesWarnings" model="causesWarnings">
+          <tdml:document><![CDATA[123]]></tdml:document>
+          <tdml:infoset>
+            <tdml:dfdlInfoset>
+              <ex:causesWarnings>
+                <A>1</A>
+                <AmbigElt>2</AmbigElt>
+                <B>3</B>
+              </ex:causesWarnings>
+            </tdml:dfdlInfoset>
+          </tdml:infoset>
+          <tdml:warnings>
+            <tdml:warning>This will not be found</tdml:warning>
+          </tdml:warnings>
+        </tdml:parserTestCase>
+      </tdml:testSuite>
+
+    lazy val ts = new DFDLTestSuite(testSuite)
+    val e = intercept[Exception] {
+      ts.runOneTest("warningWhenExpectingSuccess")
+    }
+    val msg = e.getMessage()
+    System.err.println(msg)
+    if (!msg.contains("This will not be found")) {
+      println(msg)
+      fail("TDML Warnings were not checked")
+    }
+  }
+
+  @Test def testWarningsCheckedParserExpectingError() = {
+    val testSuite =
+      <tdml:testSuite suiteName="tdml warnings" xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com" xmlns:fn="http://www.w3.org/2005/xpath-functions">
+        <tdml:defineSchema name="causesWarnings" elementFormDefault="unqualified">
+          <dfdl:format ref="ex:daffodilTest1" lengthKind="explicit"/>
+          <xs:element name="causesWarnings" dfdl:lengthKind="implicit">
+            <xs:complexType>
+              <xs:sequence>
+                <xs:element name="A" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1"/>
+                <xs:element name="B" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0"/>
+                <xs:sequence>
+                  <xs:annotation>
+                    <xs:appinfo source="http://www.ogf.org/dfdl/">
+                      <dfdl:discriminator test="{ ./AmbigElt eq '2' }"/>
+                    </xs:appinfo>
+                  </xs:annotation>
+                </xs:sequence>
+              </xs:sequence>
+            </xs:complexType>
+          </xs:element>
+        </tdml:defineSchema>
+        <tdml:parserTestCase name="warningWhenExpectingError" root="causesWarnings" model="causesWarnings" description="TDML runner verifies warnings and errors.">
+          <tdml:document><![CDATA[1234]]></tdml:document>
+          <tdml:errors>
+            <tdml:error>Schema Definition Error</tdml:error>
+            <tdml:error>query-style</tdml:error>
+            <tdml:error>AmbigElt</tdml:error>
+          </tdml:errors>
+          <tdml:warnings>
+            <tdml:warning>This will not be found</tdml:warning>
+          </tdml:warnings>
+        </tdml:parserTestCase>
+      </tdml:testSuite>
+
+    lazy val ts = new DFDLTestSuite(testSuite)
+    val e = intercept[Exception] {
+      ts.runOneTest("warningWhenExpectingError")
+    }
+    val msg = e.getMessage()
+    System.err.println(msg)
+    if (!msg.contains("This will not be found")) {
+      println(msg)
+      fail("TDML Warnings were not checked")
+    }
+  }
+
+  @Test def testWarningsCheckedUnparserExpectingSuccess() = {
+    val testSuite =
+      <tdml:testSuite suiteName="tdml warnings" xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com" xmlns:fn="http://www.w3.org/2005/xpath-functions">
+        <tdml:defineSchema name="causesWarnings" elementFormDefault="unqualified">
+          <dfdl:format ref="ex:daffodilTest1" lengthKind="explicit"/>
+          <xs:element name="errUnparsing" dfdl:lengthKind="implicit">
+            <xs:complexType>
+              <xs:sequence>
+                <xs:element name="A" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1"/>
+                <xs:element name="B" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0"/>
+                <xs:element name="UnparseFails" type="xs:string" dfdl:length="1" dfdl:outputValueCalc="{ ../AmbigElt }"/>
+              </xs:sequence>
+            </xs:complexType>
+          </xs:element>
+        </tdml:defineSchema>
+        <tdml:unparserTestCase name="unparserWarningWhenExpectingSuccess" root="errUnparsing" model="causesWarnings" roundTrip="false">
+          <tdml:document><![CDATA[1232]]></tdml:document>
+          <tdml:infoset>
+            <tdml:dfdlInfoset>
+              <ex:errUnparsing>
+                <A>1</A>
+                <AmbigElt>2</AmbigElt>
+                <B>3</B>
+              </ex:errUnparsing>
+            </tdml:dfdlInfoset>
+          </tdml:infoset>
+          <tdml:warnings>
+            <tdml:warning>This will not be found</tdml:warning>
+          </tdml:warnings>
+        </tdml:unparserTestCase>
+      </tdml:testSuite>
+
+    lazy val ts = new DFDLTestSuite(testSuite)
+    val e = intercept[Exception] {
+      ts.runOneTest("unparserWarningWhenExpectingSuccess")
+    }
+    val msg = e.getMessage()
+    System.err.println(msg)
+    if (!msg.contains("This will not be found")) {
+      println(msg)
+      fail("TDML Warnings were not checked")
+    }
+  }
+
+  @Test def testWarningsCheckedUnparserExpectingError() = {
+    val testSuite =
+      <tdml:testSuite suiteName="tdml warnings" xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://example.com" xmlns:fn="http://www.w3.org/2005/xpath-functions">
+        <tdml:defineSchema name="causesWarnings" elementFormDefault="unqualified">
+          <dfdl:format ref="ex:daffodilTest1" lengthKind="explicit"/>
+          <xs:element name="errUnparsing" dfdl:lengthKind="implicit">
+            <xs:complexType>
+              <xs:sequence>
+                <xs:element name="A" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1"/>
+                <xs:element name="B" type="xs:string" dfdl:length="1"/>
+                <xs:element name="AmbigElt" type="xs:string" dfdl:length="1"/>
+                <xs:element name="UnparseFails" type="xs:string" dfdl:length="1" dfdl:outputValueCalc="{ ../AmbigElt }"/>
+              </xs:sequence>
+            </xs:complexType>
+          </xs:element>
+        </tdml:defineSchema>
+        <tdml:unparserTestCase name="unparserWarningWhenExpectingError" root="errUnparsing" model="causesWarnings" roundTrip="false">
+          <tdml:infoset>
+            <tdml:dfdlInfoset>
+              <ex:errUnparsing>
+                <A>1</A>
+                <AmbigElt>2</AmbigElt>
+                <B>3</B>
+                <AmbigElt>4</AmbigElt>
+              </ex:errUnparsing>
+            </tdml:dfdlInfoset>
+          </tdml:infoset>
+          <tdml:document><![CDATA[1234]]></tdml:document>
+          <tdml:errors>
+            <tdml:error>Schema Definition Error</tdml:error>
+            <tdml:error>query-style</tdml:error>
+            <tdml:error>AmbigElt</tdml:error>
+          </tdml:errors>
+          <tdml:warnings>
+            <tdml:warning>This will not be found</tdml:warning>
+          </tdml:warnings>
+        </tdml:unparserTestCase>
+      </tdml:testSuite>
+
+    lazy val ts = new DFDLTestSuite(testSuite)
+    val e = intercept[Exception] {
+      ts.runOneTest("unparserWarningWhenExpectingError")
+    }
+    val msg = e.getMessage()
+    System.err.println(msg)
+    if (!msg.contains("This will not be found")) {
+      println(msg)
+      fail("TDML Warnings were not checked")
+    }
+  }
+}
diff --git a/daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section15/choice_groups/choice1773.tdml b/daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section15/choice_groups/choice1773.tdml
index b04ed0bad..6a2281814 100644
--- a/daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section15/choice_groups/choice1773.tdml
+++ b/daffodil-test/src/test/resources/edu/illinois/ncsa/daffodil/section15/choice_groups/choice1773.tdml
@@ -110,13 +110,31 @@
     </xs:complexType>
   </xs:element>
 
+  <xs:element name="msgB" dfdl:ref="ex:complex">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="A" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" />
+        <xs:element name="B" type="xs:string" dfdl:length="1" />
+        <xs:element name="AmbigElt" type="xs:string" dfdl:length="1" minOccurs="0"/>
+        <xs:sequence>
+          <xs:annotation>
+            <xs:appinfo source="http://www.ogf.org/dfdl/">
+              <dfdl:discriminator>{ ./AmbigElt eq '2' }</dfdl:discriminator>
+            </xs:appinfo>
+          </xs:annotation>
+        </xs:sequence>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+               
+
 </tdml:defineSchema>
 
   <tdml:parserTestCase name="choiceSlotAmbiguous1" root="msgA" model="s2" description="Choice branches with same element name inside.">
 
     <tdml:document><![CDATA[A1Y]]></tdml:document>
-<!--
-    This is the expected infoset when we resolve DFDL-1773 regarding statically ambiguous path expressions
+
     <tdml:infoset>
       <tdml:dfdlInfoset>
         <ex:msgA>
@@ -126,12 +144,6 @@
          </ex:msgA>
       </tdml:dfdlInfoset>
     </tdml:infoset>
--->
-    <tdml:errors>
-      <tdml:error>Statically ambiguous or query-style paths not supported</tdml:error>
-      <tdml:error>{}C</tdml:error>
-    </tdml:errors>
-
   </tdml:parserTestCase>
   
 
@@ -139,8 +151,6 @@
 
     <tdml:document><![CDATA[B2X]]></tdml:document>
 
-<!--
-    This is the expected infoset when we resolve DFDL-1773 regarding statically ambiguous path expressions
     <tdml:infoset>
       <tdml:dfdlInfoset>
         <ex:msgA>
@@ -150,13 +160,43 @@
          </ex:msgA>
       </tdml:dfdlInfoset>
     </tdml:infoset>
--->
+
+  </tdml:parserTestCase>
+  
+   <tdml:parserTestCase name="queryStyle1" root="msgB" model="s2" description="Query style expression gives warning and runtime SDE.">
+
+    <tdml:document><![CDATA[1234]]></tdml:document>
 
     <tdml:errors>
-      <tdml:error>Statically ambiguous or query-style paths not supported</tdml:error>
-      <tdml:error>{}C</tdml:error>
+      <tdml:error>Schema Definition Error</tdml:error>
+      <tdml:error>query-style</tdml:error>
+      <tdml:error>AmbigElt</tdml:error>
     </tdml:errors>
+    
+    <tdml:warnings>
+      <tdml:warning>Warning</tdml:warning>
+    </tdml:warnings>
+  </tdml:parserTestCase>   
+  
+  <tdml:parserTestCase name="queryStyle2" root="msgB" model="s2" description="Query style expression gives warning but not runtime SDE.">
 
+    <tdml:document><![CDATA[123]]></tdml:document>
+    
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <ex:msgB>
+         <A>1</A>
+         <AmbigElt>2</AmbigElt>
+         <B>3</B>
+        </ex:msgB>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+    
+    <tdml:warnings>
+      <tdml:warning>Warning</tdml:warning>
+      <tdml:warning>query-style</tdml:warning>
+      <tdml:warning>AmbigElt</tdml:warning>
+    </tdml:warnings>
   </tdml:parserTestCase>
   
 
diff --git a/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section07/external_variables/TestExternalVariablesDebug.scala b/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section07/external_variables/TestExternalVariablesDebug.scala
index a2811a127..466c9f360 100644
--- a/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section07/external_variables/TestExternalVariablesDebug.scala
+++ b/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section07/external_variables/TestExternalVariablesDebug.scala
@@ -52,6 +52,6 @@ class TestExternalVariablesDebug {
   // TODO: When Daffodil-1846 is fixed this test could be enabled.
   @Test
   def test_testNoRootUnnecessaryBinding(): Unit = {
-    runner.trace.runOneTest("testNoRootUnnecessaryBinding")
+    runner.runOneTest("testNoRootUnnecessaryBinding")
   }
 }
diff --git a/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala b/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
index 226f0d6fe..3aaac92fe 100644
--- a/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
+++ b/daffodil-test/src/test/scala-debug/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
@@ -55,6 +55,9 @@ object TestDFDLExpressionsDebug {
   val runner4 = Runner(testDir4, "runtime-properties.tdml", validateTDMLFile = true, validateDFDLSchemas = false)
   val runner_fun = Runner(testDir, "functions.tdml")
 
+  val testDir5 = "/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/"
+  val runner5 = Runner(testDir5, "expressions.tdml")
+
   @AfterClass def shutDown() {
     runner4.reset
     runner.reset
diff --git a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section15/choice_groups/TestChoice2.scala b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section15/choice_groups/TestChoice2.scala
index 230872839..9a41bef7f 100644
--- a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section15/choice_groups/TestChoice2.scala
+++ b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section15/choice_groups/TestChoice2.scala
@@ -61,4 +61,8 @@ class TestChoice2 {
   // DFDL-1773
   @Test def test_choiceSlotAmbiguous1(): Unit = { runner1773.runOneTest("choiceSlotAmbiguous1") }
   @Test def test_choiceSlotAmbiguous2(): Unit = { runner1773.runOneTest("choiceSlotAmbiguous2") }
+
+  // DAFFODIL-1773
+  @Test def test_queryStyle1(): Unit = { runner1773.runOneTest("queryStyle1") }
+  @Test def test_queryStyle2(): Unit = { runner1773.runOneTest("queryStyle2") }
 }
diff --git a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressions2.scala b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressions2.scala
index 9b3070054..c99d94459 100644
--- a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressions2.scala
+++ b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressions2.scala
@@ -131,9 +131,6 @@ class TestDFDLExpressions2 {
   @Test def test_idiv19 { runner.runOneTest("idiv19") }
   @Test def test_idiv20 { runner.runOneTest("idiv20") }
 
-  // DFDL-1617
-  @Test def test_query_style_01 { runner4.runOneTest("query_style_01") }
-  @Test def test_query_style_02 { runner4.runOneTest("query_style_02") }
 
   // DFDL-1719
   @Test def test_if_expression_type_01 { runner5.runOneTest("if_expression_type_01") }
diff --git a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala
index 55e76bc15..d096e064d 100644
--- a/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala
+++ b/daffodil-test/src/test/scala/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala
@@ -40,9 +40,11 @@ object TestDFDLExpressionsNew {
 
   val testDir2 = "/edu/illinois/ncsa/daffodil/section23/dfdl_functions/"
   val runner2 = Runner(testDir2, "Functions.tdml")
-
+  val testDir5 = "/edu/illinois/ncsa/daffodil/section23/dfdl_expressions/"
+  val runner5 = Runner(testDir5, "expressions.tdml")
   @AfterClass def shutdown = {
     runner2.reset
+    runner5.reset
 
   }
 }
@@ -53,4 +55,7 @@ class TestDFDLExpressionsNew {
   //DFDL-1076
   @Test def test_nilled_01() { runner2.runOneTest("nilled_01") }
 
+  // DFDL-1617 - should detect errors due to query-style expressions
+  @Test def test_query_style_01 { runner5.runOneTest("query_style_01") }
+  @Test def test_query_style_02 { runner5.runOneTest("query_style_02") }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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