progs/comb1.scala
changeset 185 ea8b94d4755e
parent 183 b17eff695c7f
child 360 c6c574d2ca0c
--- a/progs/comb1.scala	Mon Nov 11 15:26:20 2013 +0000
+++ b/progs/comb1.scala	Mon Nov 11 23:24:38 2013 +0000
@@ -70,7 +70,7 @@
   (("a" ~ Pal ~ "a") ==> { case ((x, y), z) => x + y + z } ||
    ("b" ~ Pal ~ "b") ==> { case ((x, y), z) => x + y + z } || "")
 
-Pal.parse_all("ababbaba")
+println("Palindrom" + Pal.parse_all("ababbaba"))
 
 
 lazy val P : Parser[String, String] = 
@@ -88,11 +88,11 @@
 lazy val T: Parser[String, String] = 
   ("(" ~ E ~ ")") ==> { case ((x, y), z) => x + y + z } || NumParser
 
-
+println(E.parse_all("1*2+3"))
+println(E.parse_all("1+2*3"))
 println(E.parse_all("1+2+3"))
 
 
-
 // non-ambiguous vs ambiguous
 lazy val U : Parser[String, String] =
   ("1" ~ U) ==> { case (x, y) => x + y } || ""