main_testing3/re_test1.scala
changeset 475 59e005dcf163
parent 433 6af86ba1208f
equal deleted inserted replaced
474:b528d1d3d3c3 475:59e005dcf163
     1 import M3._
       
     2 
     1 
     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 
     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 }