Пример #1
0
        // DoStatement
        protected internal override bool Walk(DoStatement node)
        {
            BitArray loop = new BitArray(_bits); // State at the loop entry with which the loop runs
            BitArray save = _bits;               // Save the state at loop entry

            // Prepare loop exit state
            BitArray exit = new BitArray(_bits.Length, true);

            PushStatement(exit);

            // Loop will be flown starting from the current state
            _bits = loop;

            // Walk the loop
            WalkNode(node.Body);
            // Walk the test in the context of the loop
            WalkNode(node.Test);

            // Handle the loop exit
            PopStatement();
            _bits.And(exit);

            // Restore the state after walking the loop
            _bits = save;
            _bits.And(loop);

            return(false);
        }
Пример #2
0
 // DoStatement
 private void DefaultWalk(DoStatement node)
 {
     if (Walk(node))
     {
         WalkNode(node.Body);
         WalkNode(node.Test);
     }
     PostWalk(node);
 }
Пример #3
0
 // DoStatement
 private void Dump(DoStatement node)
 {
     Out(".do {", Flow.NewLine);
     Indent();
     WalkNode(node.Body);
     Dedent();
     Out(Flow.NewLine, "} .while (");
     WalkNode(node.Test);
     Out(");");
 }
Пример #4
0
        // DoStatement
        private Statement Rewrite(DoStatement node)
        {
            Statement  body = RewriteStatement(node.Body);
            Expression test = RewriteExpressionFreeTemps(node.Test);

            if (((object)body != (object)node.Body) ||
                ((object)test != (object)node.Test))
            {
                return(new DoStatement(node.Span, node.Header, test, body));
            }
            else
            {
                return(node);
            }
        }
Пример #5
0
 protected internal override bool Walk(DoStatement node) {
     _hasLoops = true;
     return false;
 }
Пример #6
0
 protected internal override void PostWalk(DoStatement node)
 {
     _nesting--;
 }
Пример #7
0
 protected internal override bool Walk(DoStatement node)
 {
     _nesting++;
     return(true);
 }
Пример #8
0
        // DoStatement
        protected internal override bool Walk(DoStatement node)
        {
            BitArray loop = new BitArray(_bits); // State at the loop entry with which the loop runs
            BitArray save = _bits;               // Save the state at loop entry

            // Prepare loop exit state
            BitArray exit = new BitArray(_bits.Length, true);
            PushStatement(exit);

            // Loop will be flown starting from the current state
            _bits = loop;

            // Walk the loop
            WalkNode(node.Body);
            // Walk the test in the context of the loop
            WalkNode(node.Test);

            // Handle the loop exit
            PopStatement();
            _bits.And(exit);

            // Restore the state after walking the loop
            _bits = save;
            _bits.And(loop);

            return false;
        }
Пример #9
0
 // DoStatement
 private void DefaultWalk(DoStatement node)
 {
     if (Walk(node)) {
         WalkNode(node.Body);
         WalkNode(node.Test);
     }
     PostWalk(node);
 }
Пример #10
0
 protected internal override bool Walk(DoStatement node)
 {
     _nesting++;
     return true;
 }
Пример #11
0
 protected internal override void PostWalk(DoStatement node)
 {
     _nesting--;
 }
Пример #12
0
 protected internal override bool Walk(DoStatement node)
 {
     _hasLoops = true;
     return(false);
 }