diff -r c493eaba6018 -r 65731df141a5 templates4/re.scala --- a/templates4/re.scala Wed Oct 30 12:47:10 2019 +0000 +++ b/templates4/re.scala Wed Oct 30 14:07:58 2019 +0000 @@ -1,5 +1,7 @@ -// Part 1 about Regular Expression Matching -//========================================== +// Core Part about Regular Expression Matching +//============================================= + +object CW9c { // Regular Expressions abstract class Rexp @@ -37,7 +39,7 @@ def ~ (r: String) = SEQ(s, r) } -// (1) Complete the function nullable according to +// (5) Complete the function nullable according to // the definition given in the coursework; this // function checks whether a regular expression // can match the empty string and Returns a boolean @@ -46,7 +48,7 @@ //def nullable (r: Rexp) : Boolean = ... -// (2) Complete the function der according to +// (6) Complete the function der according to // the definition given in the coursework; this // function calculates the derivative of a // regular expression w.r.t. a character. @@ -54,7 +56,7 @@ //def der (c: Char, r: Rexp) : Rexp = ... -// (3) Complete the simp function according to +// (7) Complete the simp function according to // the specification given in the coursework; this // function simplifies a regular expression from // the inside out, like you would simplify arithmetic @@ -64,7 +66,7 @@ //def simp(r: Rexp) : Rexp = ... -// (4) Complete the two functions below; the first +// (8) Complete the two functions below; the first // calculates the derivative w.r.t. a string; the second // is the regular expression matcher taking a regular // expression and a string and checks whether the @@ -75,7 +77,7 @@ //def matcher(r: Rexp, s: String): Boolean = ... -// (5) Complete the size function for regular +// (9) Complete the size function for regular // expressions according to the specification // given in the coursework. @@ -132,3 +134,4 @@ */ +}