Example #1
0
 protected override void VisitLift(Lift downNode, object o)
 {
     PointerToNode ptrUpNode = (o as Data).PointerToNode;
     LiftTask task = downNode.Task;
     if (task is StackLiftTask)
     {
         int depth = (task as StackLiftTask).Depth;
         ptrUpNode = new PointerToNode(ptrUpNode.Node = SpecializingVisitor.liftValue(this.state.Stack[depth]));
         this.state.Stack.RemoveAt(depth);
     }
     else
     {
         Variable var = (task as VariableLiftTask).Variable;
         ptrUpNode = new PointerToNode(ptrUpNode.Node = SpecializingVisitor.liftValue(this.state.Pool[var].Val));
         PointerValue ptr = new PointerToLocationValue(this.state.Pool[var]);
         ptrUpNode = new PointerToNode(ptrUpNode.Node = new StoreVar(this.varsHash[ptr]));
         ptr.SetZeroValue();
     }
     this.AddTask(downNode.Next, ptrUpNode);
 }
Example #2
0
 protected internal override void VisitLift(Lift upNode, object o)
 {
     State state = o as State;
     LiftTask task = upNode.Task;
     if (task is StackLiftTask)
         (state.Stack[(task as StackLiftTask).Depth] as PrimitiveBTValue).Lift();
     else if (task is VariableLiftTask)
         (state.Pool[(task as VariableLiftTask).Variable].Val as PrimitiveBTValue).Lift();
     else
         throw new InternalException();
     Annotation.SetNodeBTType(upNode, BTType.eXclusive);
 }
Example #3
0
        protected override void DispatchNode(Node upNode, object o)
        {
            State state = this.upDownNodes.GetState(upNode);
            Node downNode = this.upDownNodes[upNode];
            LiftTask task = o as LiftTask;

            if (task is StackLiftTask)
            {
                int depth = (task as StackLiftTask).Depth;
                for (int i = 0; i < depth; i++)
                    if ((state.Stack[i] as BTValue).BTType == BTType.Dynamic)
                    {
                        foreach (Node prevUp in upNode.PrevArray)
                        {
                            DepthContainer cnt = new DepthContainer(depth);
                            this.CallVisitorMethod(prevUp, cnt);
                            this.AddTask(prevUp, new StackLiftTask(cnt.Depth));
                        }
                        upNode.ReplaceByNode(null);
                        goto CleanGraph;
                    }
            }

            Node liftUp = new Lift(task);
            this.upDownNodes.SetUpAndDownNode(downNode, state, liftUp);
            this.aVisitor.AddTask(liftUp, state);
            upNode.ReplaceByNode(liftUp);

            CleanGraph:
                this.cVisitor.CleanGraph();
        }
Example #4
0
 protected internal virtual void VisitLift(Lift node, object o)
 {
     throw new NodeNotSupportedException(node);
 }
Example #5
0
 protected internal override void VisitLift(Lift upNode, object o)
 {
 }