Esempio n. 1
0
        internal static MinimizedDfa <TSymbol> MakeEmptyLanguageDfa <TSymbol>()
            where TSymbol : IComparable <TSymbol>, IEquatable <TSymbol>
        {
            var result = new ProductDfa <TSymbol> {
                _start = ProductDfaState <TSymbol> .MakeDeadState()
            }
            .Minimized <ProductDfa <TSymbol>, ProductDfaState <TSymbol>, TSymbol>();

            DfaStatesConcpetCheck <TSymbol> .CheckDfaStates(result);

            return(result);
        }
Esempio n. 2
0
        private static ProductDfa <TSymbol> MakeProductDfa <TLastDfa, TLastDfaState, TNewDfa, TNewDfaState, TSymbol>(
            TLastDfa lastDfa, TNewDfa newDfa, AmbiguityHandler handler)
            where TLastDfa : AbstractDfa <TLastDfaState, TSymbol> where TLastDfaState : AbstractDfaState <TLastDfaState, TSymbol>
            where TNewDfa : AbstractDfa <TNewDfaState, TSymbol>
            where TNewDfaState : AbstractDfaState <TNewDfaState, TSymbol>
            where TSymbol : IComparable <TSymbol>, IEquatable <TSymbol>
        {
            var result = new ProductDfaBuilder <TLastDfaState, TNewDfaState, TSymbol>(handler).Build(lastDfa.Start,
                                                                                                     newDfa.Start);

            DfaStatesConcpetCheck <TSymbol> .CheckDfaStates(result);

            return(result);
        }
Esempio n. 3
0
        public static MinimizedDfa <TSymbol> MakeMinimizedProductDfa
        <TLastDfa, TLastDfaState, TNewDfa, TNewDfaState, TSymbol>(TLastDfa lastDfa, TNewDfa newDfa,
                                                                  AmbiguityHandler handler)
            where TLastDfa : AbstractDfa <TLastDfaState, TSymbol>
            where TLastDfaState : AbstractDfaState <TLastDfaState, TSymbol>
            where TNewDfa : AbstractDfa <TNewDfaState, TSymbol>
            where TNewDfaState : AbstractDfaState <TNewDfaState, TSymbol>
            where TSymbol : IComparable <TSymbol>, IEquatable <TSymbol>
        {
            var result =
                MakeProductDfa <TLastDfa, TLastDfaState, TNewDfa, TNewDfaState, TSymbol>(lastDfa, newDfa, handler)
                .Minimized <ProductDfa <TSymbol>, ProductDfaState <TSymbol>, TSymbol>();

            DfaStatesConcpetCheck <TSymbol> .CheckDfaStates(result);

            return(result);
        }