equal
deleted
inserted
replaced
1 // NFAs in Scala using partial functions (returning |
1 // NFAs in Scala using partial functions (returning |
2 // sets of states) |
2 // sets of states) |
3 import scala.util.Try |
3 // |
4 |
4 // needs :load dfa.scala for states |
5 // states class |
|
6 abstract class State |
|
7 case object Q0 extends State |
|
8 case object Q1 extends State |
|
9 case object Q2 extends State |
|
10 case object Q3 extends State |
|
11 case object Q4 extends State |
|
12 |
|
13 |
5 |
14 |
6 |
15 // type abbreviation for partial functions |
7 // type abbreviation for partial functions |
16 type :=>[A, B] = PartialFunction[A, B] |
8 type :=>[A, B] = PartialFunction[A, B] |
17 |
9 |