lex_blex_Frankensteined.scala
changeset 14 610f14009c0b
parent 12 768b833d6230
child 15 cd0ceaf89c1d
--- a/lex_blex_Frankensteined.scala	Fri Apr 12 19:26:13 2019 +0100
+++ b/lex_blex_Frankensteined.scala	Sat Apr 13 16:18:23 2019 +0100
@@ -140,9 +140,9 @@
   def retrieve(r: ARexp, v: Val): Bits = (r,v) match {
     case (AONE(bs), Empty) => bs
     case (ACHAR(bs, c), Chr(d)) => bs
+    case (AALTS(bs, a::Nil), v) => bs ++ retrieve(a, v)
     case (AALTS(bs, as), Left(v)) => bs ++ retrieve(as.head,v)
     case (AALTS(bs, as), Right(v)) => bs ++ retrieve(AALTS(Nil,as.tail),v)
-    case (AALTS(bs, a::Nil), v) => bs ++ retrieve(a, v)
     case (ASEQ(bs, a1, a2), Sequ(v1, v2)) => bs ++ retrieve(a1, v1) ++ retrieve(a2, v2)
     case (ASTAR(bs, a), Stars(Nil)) => bs ++ List(Z) 
     case (ASTAR(bs, a), Stars(v::vs)) => bs ++ List(S) ++ retrieve(a, v) ++ retrieve(ASTAR(Nil, a), Stars(vs))
@@ -457,13 +457,13 @@
     case r => r
   }
     
-  
-  //----------------------------------------------------------------------------experiment bsimp
-  /*
   def bders_simp (s: List[Char], r: ARexp) : ARexp = s match {
     case Nil => r
     case c::s => bders_simp(s, bsimp(bder(c, r)))
   }
+  //----------------------------------------------------------------------------experiment bsimp
+  /*
+
   */
   /*
   def time[T](code: => T) = {
@@ -484,7 +484,7 @@
   }
 
   def bpre_lexing(r: Rexp, s: String) = blex(internalise(r), s.toList)
-  //def blexing(r: Rexp, s: String) : Val = decode(r, blex(internalise(r), s.toList))
+  def blexing(r: Rexp, s: String) : Val = decode(r, blex(internalise(r), s.toList))
 
   var bder_time = 0L
   var bsimp_time = 0L