示例#1
0
        public bool InheritContextsOnSkip(PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> parent, PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> child, TState nextState,
                                          TTransition sourceTransition, bool memoized)
        {
            parent.AddTransition(
                new ExtractedTransition <PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition>, TTransition>(
                    sourceTransition, child, PdaAction.Skip));

            return(true);
        }
示例#2
0
        public void MergeContexts(
            PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> source,
            PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> target)
        {
            if (ReferenceEquals(source, target))
            {
                return;
            }

            foreach (var transition in target.Transitions)
            {
                source.AddTransition(transition);
            }
        }
示例#3
0
        public bool InheritContextsOnPop(PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> parent, PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> child, TState nextState,
                                         TTransition sourceTransition, bool memoized)
        {
            foreach (var record in GetOrCreatePushHistory(parent.StackTop))
            {
                record.Pusher.AddTransition(
                    new ExtractedTransition <PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition>, TTransition>(
                        record.SourceTransition, record.Child, PdaAction.Push));
            }

            ClearPushHistory(parent.StackTop);

            parent.AddTransition(
                new ExtractedTransition <PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition>, TTransition>(
                    sourceTransition, child, PdaAction.Pop));

            return(true);
        }
示例#4
0
 public MyPushHistoryRecord(PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> pusher, PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> child, TTransition sourceTransition) : base(pusher, child, sourceTransition)
 {
 }
示例#5
0
 public bool InheritContextsOnPush(PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> parent, PdaExtractingContext <GssNode <TStackSymbol, PdaExtractingGssData>, TTransition> child, TState nextState,
                                   TStackSymbol pushed, TTransition sourceTransition, bool memoized)
 {
     AddToPushHistory(child.StackTop, new MyPushHistoryRecord(parent, child, sourceTransition));
     return(true);
 }