Beispiel #1
0
        public override NFAModel ConvertKleeneStar(KleeneStarExpression exp)
        {
            var innerNFA = Convert(exp.InnerExpression);

            var newTail = new NFAState();
            var entry   = new NFAEdge(newTail);

            innerNFA.TailState.AddEmptyEdgeTo(newTail);
            newTail.AddEdge(innerNFA.EntryEdge);

            var kleenStarNFA = new NFAModel();

            kleenStarNFA.AddStates(innerNFA.States);
            kleenStarNFA.AddState(newTail);
            kleenStarNFA.EntryEdge = entry;
            kleenStarNFA.TailState = newTail;

            return(kleenStarNFA);
        }
 public abstract T ConvertKleeneStar(KleeneStarExpression exp);