Created
August 18, 2014 20:33
-
-
Save rcoh/aa52a6a30ca3e618cc9c to your computer and use it in GitHub Desktop.
blog1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class RegexExpr | |
// ., a, b | |
case class Literal(c: Char) extends RegexExpr | |
// a|b | |
case class Or(expr1: RegexExpr, expr2: RegexExpr) extends RegexExpr | |
// ab -> Concat(a,b); abc -> Concat(a, Concat(b, c)) | |
case class Concat(first: RegexExpr, second: RegexExpr) extends RegexExpr | |
// a* | |
case class Repeat(expr: RegexExpr) extends RegexExpr | |
// a+ | |
case class Plus(expr: RegexExpr) extends RegexExpr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment