mbeckerle commented on a change in pull request #88: Daffodil 1919 separators
URL: https://github.com/apache/incubator-daffodil/pull/88#discussion_r209035401
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/Grammar.scala
 ##########
 @@ -124,56 +119,20 @@ class SeqComp private (context: SchemaComponent, 
children: Seq[Gram]) extends Bi
   }
 }
 
-/**
- * Alternative composition of grammar terms.
- *
- * Flattens nests of these into a single flat list.
- */
-object AltComp {
-  def apply(context: SchemaComponent, p: => Gram, q: => Gram) = {
-    val children = (p, q) match {
-      case (ps: AltComp, qs: AltComp) => {
-        ps.children ++ qs.children
-      }
-      case (ps: AltComp, _) => ps.children ++ List(q)
-      case (_, qs: AltComp) => p +: qs.children
-      case (_, _) => List(p, q)
-    }
-    val res = new AltComp(context, children)
-    res
-  }
-}
-
-class AltComp private (context: SchemaComponent, children: Seq[Gram]) extends 
BinaryGram(context, children)
-  with HasNoUnparser {
-  protected final override def op = "|"
-  protected final override def open = "["
-  protected final override def close = "]"
-
-  final override lazy val parser = new AltCompParser(context.runtimeData, 
children.map { _.parser })
-}
-
 object EmptyGram extends Gram(null) {
   override def isEmpty = true
   override def toString = "Empty"
 
   override lazy val parser = new NadaParser(null)
-  override lazy val unparser = // hasNoUnparser
-    // we depend on this unparser being returned, even though it cannot be 
called to unparse anything.
-    // As there are unit tests which test attributes where those attributes 
cause a DummyUnparser to be created.
-    // That is later optimized out (or needs to be).
-    //
-    // FIXME: switch back to hasNoUnparser, find where this is being used and 
have it not ask for
-    // this unparser.
-    new EmptyGramUnparser(null) // DummyUnparser(Misc.getNameFromClass(this))
-
+  override lazy val unparser = new NadaUnparser(null)
 }
 
-object ErrorGram extends Gram(null) with HasNoUnparser {
+object ErrorGram extends Gram(null) {
 
 Review comment:
   Done

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


With regards,
Apache Git Services

Reply via email to