updated
authorChristian Urban <urbanc@in.tum.de>
Thu, 05 Apr 2018 02:33:30 +0100
changeset 548 c6ba1d17aaf3
parent 547 81eb43c41416
child 549 352d15782d35
updated
progs/funt.scala
--- a/progs/funt.scala	Mon Feb 05 10:58:48 2018 +0000
+++ b/progs/funt.scala	Thu Apr 05 02:33:30 2018 +0100
@@ -115,8 +115,8 @@
 
 
 // regular expressions for the While language
-val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_")
-val DIGIT = RANGE("0123456789")
+val SYM = RANGE("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_".toList)
+val DIGIT = RANGE("0123456789".toList)
 val ID = SYM ~ (SYM | DIGIT).% 
 val NUM = PLUS(DIGIT)
 val KEYWORD : Rexp = "if" | "then" | "else" | "write" | "def"
@@ -486,3 +486,23 @@
 //examples
 compile_run("defs.rec")
 //compile_run("fact.rec")
+
+
+
+
+
+// a problem with the parser 
+val text = "(((((1)))))"
+val tokens = tokenizer(text)
+println(tokens)
+val ast = Prog.parse_single(tokens)
+println(ast)
+
+Exp.parse_single(tokens)
+
+
+
+val text = "((((1))))"
+val tokens = tokenizer(text)
+println(tokens)
+Exp.parse(tokens)