Пример #1
0
            public MyPDVMState(
                IContextProcessor <TState, TStackSymbol, TPosition,
                                   TTransition, TContext, GssNode <TStackSymbol, TGssData> > contextProcessor,
                ICacheProvider <TState, TStackSymbol, TPosition,
                                TContext, GssNode <TStackSymbol, TGssData> > cacheProvider,
                PopHistory <TState, TTransition, TPosition,
                            TContext, GssNode <TStackSymbol, TGssData> > popHistory)
            {
                ContextProcessor = contextProcessor;
                CacheProvider    = cacheProvider;
                PopHistory       = popHistory;

                myProcessing = new Stack <Head <TState, TPosition, TContext, GssNode <TStackSymbol, TGssData> > >();
                myQueued     = new Stack <Action>();
            }
Пример #2
0
        public PDVMSimulation(
            IContextProcessor <TState, TStackSymbol, TPosition, TTransition, TContext, GssNode <TStackSymbol, TGssData> > contextProcessor,
            ICacheProvider <TState, TStackSymbol, TPosition, TContext, GssNode <TStackSymbol, TGssData> > cacheProvider,
            ITransitionProvider <TPosition, TTransition> transitionProvider,
            Func <PDVM <TState, TStackSymbol, TPosition, TTransition, TContext, TGssData> > pdvmProvider)
        {
            myContextProcessor   = contextProcessor;
            myCacheProvider      = cacheProvider;
            myTransitionProvider = transitionProvider;
            myPopHistory         = new PopHistory <TState, TTransition, TPosition, TContext, GssNode <TStackSymbol, TGssData> >();

            myPdvm = pdvmProvider();

            myGssRoots = new Dictionary <TStackSymbol, GssNode <TStackSymbol, TGssData> >();

            myStarts = new Queue <Head <TState, TPosition, TContext, GssNode <TStackSymbol, TGssData> > >();
        }
Пример #3
0
        public DPDASimulation(
            IDPDA <TState, TStackSymbol, TPosition, TTransition> pda,
            IContextProcessor <TState, TStackSymbol, TPosition, TTransition, TContext, GssNode <TStackSymbol, TGssData> > contextProcessor,
            ICacheProvider <TState, TStackSymbol, TPosition, TContext, GssNode <TStackSymbol, TGssData> > cacheProvider,
            ITransitionProvider <TPosition, TTransition> transitionProvider)
        {
            myPda = pda;
            myContextProcessor   = contextProcessor;
            myCacheProvider      = cacheProvider;
            myTransitionProvider = transitionProvider;

            myProcessing = new Stack <MyHead>();
            myStarts     = new Queue <MyHead>();

            myStackRoot = new GssNode <TStackSymbol, TGssData>(pda.GetInitialStackData());

            myPopHistory = new PopHistory <TState, TTransition, TPosition, TContext, GssNode <TStackSymbol, TGssData> >();
        }