コード例 #1
0
 // TryStmt
 public override bool Walk(TryStmt node)
 {
     foreach (TryStmtHandler tsh in node.handlers)
     {
         if (tsh.target != null)
         {
             tsh.target.Walk(define);
         }
     }
     return(true);
 }
コード例 #2
0
        // TryStmt
        public override bool Walk(TryStmt node)
        {
            BitArray result = new BitArray(bits.Length, true);
            BitArray save   = bits;

            bits = new BitArray(bits);

            // Flow the body
            node.body.Walk(this);
            result.And(bits);

            foreach (TryStmtHandler tsh in node.handlers)
            {
                // Restore to saved state
                bits.SetAll(false);
                bits.Or(save);

                // Flow the test
                if (tsh.test != null)
                {
                    tsh.test.Walk(this);
                }

                // Define the target
                if (tsh.target != null)
                {
                    tsh.target.Walk(fdef);
                }

                // Flow the body
                tsh.body.Walk(this);
                result.And(bits);
            }

            if (node.elseStmt != null)
            {
                bits.SetAll(false);
                bits.Or(save);

                node.elseStmt.Walk(this);
                result.And(bits);
            }

            bits = save;
            bits.SetAll(false);
            bits.Or(result);
            return(false);
        }
コード例 #3
0
        public override bool Walk(TryStmt node)
        {
            TryBlock tb = new TryBlock(node);

            tryBlocks.Push(tb);
            node.body.Walk(this);

            tb.state = TryBlock.State.Handler;
            foreach (TryStmtHandler handler in node.handlers)
            {
                handler.Walk(this);
            }

            ExceptionBlock eb = tryBlocks.Pop();

            Debug.Assert((object)tb == (object)eb);

            if (node.elseStmt != null)
            {
                node.elseStmt.Walk(this);
            }
            return(false);
        }
コード例 #4
0
 public virtual void PostWalk(TryStmt node)
 {
 }
コード例 #5
0
 // TryStmt
 public virtual bool Walk(TryStmt node)
 {
     return(true);
 }
コード例 #6
0
 // TryStmt
 public virtual bool Walk(TryStmt node)
 {
     return(false);
 }
コード例 #7
0
 public TryBlock(TryStmt stmt, State state)
     : base(state)
 {
     this.stmt = stmt;
 }
コード例 #8
0
 public TryBlock(TryStmt stmt)
     : this(stmt, State.Try)
 {
 }