diff -r fa92e8f089a2 -r 8b5ed306e961 Fahad/Scala/POSIX.sc --- a/Fahad/Scala/POSIX.sc Sun Oct 26 16:42:28 2014 +0000 +++ b/Fahad/Scala/POSIX.sc Mon Oct 27 12:40:19 2014 +0000 @@ -247,8 +247,58 @@ result } //> time: [T](code: => T)T - val prog0 = """read n""" //> prog0 : String = read n - //env(lexing_simp(WHILE_REGS, prog0)) - - println("Next test") //> Next test + + val abc = List('a', 'b', 'c') //> abc : List[Char] = List(a, b, c) + val nullRexp = null //> nullRexp : Null = null + val myRexp = charlist2rexp(abc) //> myRexp : greeter.POSIX.Rexp = SEQ(CHAR(a),SEQ(CHAR(b),CHAR(c))) + val myRexp2 = string2rexp("FahadAusaf") //> myRexp2 : greeter.POSIX.Rexp = SEQ(CHAR(F),SEQ(CHAR(a),SEQ(CHAR(h),SEQ(CHA + //| R(a),SEQ(CHAR(d),SEQ(CHAR(A),SEQ(CHAR(u),SEQ(CHAR(s),SEQ(CHAR(a),CHAR(f)))) + //| )))))) + + RexpOps(myRexp2) //> res2: AnyRef{def |(s: greeter.POSIX.Rexp): greeter.POSIX.ALT; def %: greete + //| r.POSIX.STAR; def ~(s: greeter.POSIX.Rexp): greeter.POSIX.SEQ} = greeter.PO + //| SIX$$anonfun$main$1$$anon$1@37ecb28e + + stringOps("Fahad") //> res3: AnyRef{def |(r: greeter.POSIX.Rexp): greeter.POSIX.ALT; def |(r: Stri + //| ng): greeter.POSIX.ALT; def %: greeter.POSIX.STAR; def ~(r: greeter.POSIX.R + //| exp): greeter.POSIX.SEQ; def ~(r: String): greeter.POSIX.SEQ; def $(r: gree + //| ter.POSIX.Rexp): greeter.POSIX.RECD} = greeter.POSIX$$anonfun$main$1$$anon$ + //| 2@14bea551 + + size(myRexp2) //> res4: Int = 19 + nullable(nullRexp) //> scala.MatchError: null + //| at greeter.POSIX$$anonfun$main$1.nullable$1(greeter.POSIX.scala:59) + //| at greeter.POSIX$$anonfun$main$1.apply$mcV$sp(greeter.POSIX.scala:202) + //| at org.scalaide.worksheet.runtime.library.WorksheetSupport$$anonfun$$exe + //| cute$1.apply$mcV$sp(WorksheetSupport.scala:76) + //| at org.scalaide.worksheet.runtime.library.WorksheetSupport$.redirected(W + //| orksheetSupport.scala:65) + //| at org.scalaide.worksheet.runtime.library.WorksheetSupport$.$execute(Wor + //| ksheetSupport.scala:75) + //| at greeter.POSIX$.main(greeter.POSIX.scala:3) + //| at greeter.POSIX.main(greeter.POSIX.scala) + + val newRexp = der('a',myRexp) + + + + + + + + + + + + + + + + + + + + + + //this is some crap } \ No newline at end of file