progs/matcher/re1.sc
changeset 745 7dc3643a0cc5
parent 725 f345e89895f5
child 759 d70dd0b57e35
equal deleted inserted replaced
744:99c5916d9a8f 745:7dc3643a0cc5
     5 //   amm re1.sc testX
     5 //   amm re1.sc testX
     6 //
     6 //
     7 // or 
     7 // or 
     8 //
     8 //
     9 //   amm re1.sc all
     9 //   amm re1.sc all
    10 
    10  
    11 // regular expressions
    11 // regular expressions
    12 abstract class Rexp
    12 abstract class Rexp
    13 case object ZERO extends Rexp                    // matches nothing
    13 case object ZERO extends Rexp                    // matches nothing
    14 case object ONE extends Rexp                     // matches an empty string
    14 case object ONE extends Rexp                     // matches an empty string
    15 case class CHAR(c: Char) extends Rexp            // matches a character c
    15 case class CHAR(c: Char) extends Rexp            // matches a character c