Beispiel #1
0
        public static FiniteAutomata GenerateAutomataForRegex(string input)
        {
            var rootNode = NodeTreeCreator.Initialize(input);
            var states   = rootNode.Apply();
            var alphabet = new Alphabet(input.ToCharArray());
            var automata = new FiniteAutomata(
                $"Automata for regular expression {input}",
                alphabet,
                states,
                new List <Word>(),
                false,
                false);

            automata.AcceptWords();
            return(automata);
        }
Beispiel #2
0
        public static Node Initialize(string input)
        {
            var symbols = NodeTreeCreator.ParseToSymbols(input);

            return(NodeTreeCreator.CreateTree(symbols));
        }