progs/scala/re-basic.scala
changeset 293 1a4e5b94293b
parent 238 2dc1647eab9e
child 359 fedc16924b76
--- a/progs/scala/re-basic.scala	Mon Sep 10 21:41:54 2018 +0100
+++ b/progs/scala/re-basic.scala	Sun Sep 30 12:02:04 2018 +0100
@@ -230,3 +230,13 @@
 
 filelines.foreach({ case (s: String, i: Int) => process(s, i) })
 
+
+
+// test: ("a" | "aa")*
+val EVIL3 = STAR(ALT(CHAR('a'), SEQ(CHAR('a'), CHAR('a'))))
+
+for (i <- 1 to 29 by 1) {
+  println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL3, "a" * i))) + 
+	  " size: " + size(ders(("a" * i).toList, EVIL3)))
+}
+