コード例 #1
0
            private void HandleAction(RegexStruct regex1, RegexStruct regex2)
            {
                var running = true;

                while (running)
                {
                    Console.Clear();
                    Console.WriteLine($"regex: {regex1.text} en {regex2.text} gekozen. Kies een actie");
                    actions.ToList().ForEach(a => Console.WriteLine(a));
                    int input = GetInput(actions.Length);
                    switch (input)
                    {
                    case 0:
                        NdfatoDfa.MakeDfa(Thompson.CreateAutomaat(regex1.regex)).ViewImage();
                        break;

                    case 1:
                        NdfatoDfa.MakeDfa(Thompson.CreateAutomaat(regex2.regex)).ViewImage();
                        break;

                    case 2:
                        Console.WriteLine("gelijkheid reg1 en reg2 is: " + regex1.regex.Equals(regex2.regex));
                        Console.WriteLine("druk op enter om door te gaan");
                        Console.ReadLine();
                        break;

                    case 3:
                        running = false;
                        samples.Clear();
                        break;
                    }
                }
            }
コード例 #2
0
            private void ViewActions(RegexStruct regexStruct)
            {
                var running = true;

                while (running)
                {
                    Console.Clear();
                    Console.WriteLine($"regex: {regexStruct.text} gekozen. Kies een actie");
                    actions.ToList().ForEach(a => Console.WriteLine(a));
                    int input = GetInput(actions.Length);
                    switch (input)
                    {
                    case 0:
                        Thompson.CreateAutomaat(regexStruct.regex).ViewImage();
                        break;

                    case 1:
                        NdfatoDfa.MakeDfa(Thompson.CreateAutomaat(regexStruct.regex)).ViewImage();
                        break;

                    case 2:
                        NdfatoDfa.MakeDfa(Thompson.CreateAutomaat(regexStruct.regex)).MinimizeHopCroft(false).ViewImage();
                        break;

                    case 3:
                        running = false;
                        samples.Clear();
                        break;
                    }
                }
            }