main_marking3/re_test1.scala
changeset 491 2a30c7dfe3ed
parent 460 f5c0749858fd
equal deleted inserted replaced
490:f70d74fea67f 491:2a30c7dfe3ed
     1 import M3._
       
     2 
       
     3 assert(nullable(ZERO) == false)
       
     4 assert(nullable(ONE) == true)
       
     5 assert(nullable(CHAR('a')) == false)
       
     6 assert(nullable(ZERO | ONE) == true)
       
     7 assert(nullable(ZERO | CHAR('a')) == false)
       
     8 assert(nullable(ONE ~  ONE) == true)
       
     9 assert(nullable(ONE ~ CHAR('a')) == false)
       
    10 assert(nullable(STAR(ZERO)) == true)
       
    11 assert(nullable(ALTs(List(ONE, CHAR('a'), ZERO))) == true)
       
    12 assert(nullable(SEQs(List(ONE, ALTs(List(ONE, CHAR('a'), ZERO)), STAR(ZERO)))) == true)
       
    13 
     1 
    14 
     2 
       
     3 def urbanmain() = {
       
     4   import M3._
       
     5 
       
     6   assert(nullable(ZERO) == false)
       
     7   assert(nullable(ONE) == true)
       
     8   assert(nullable(CHAR('a')) == false)
       
     9   assert(nullable(ZERO | ONE) == true)
       
    10   assert(nullable(ZERO | CHAR('a')) == false)
       
    11   assert(nullable(ONE ~  ONE) == true)
       
    12   assert(nullable(ONE ~ CHAR('a')) == false)
       
    13   assert(nullable(STAR(ZERO)) == true)
       
    14   assert(nullable(ALTs(List(ONE, CHAR('a'), ZERO))) == true)
       
    15   assert(nullable(SEQs(List(ONE, ALTs(List(ONE, CHAR('a'), ZERO)), STAR(ZERO)))) == true)
       
    16 }
       
    17