예제 #1
0
 // BoundAssignment
 private void DefaultWalk(BoundAssignment node)
 {
     if (Walk(node))
     {
         WalkNode(node.Value);
     }
     PostWalk(node);
 }
예제 #2
0
        // BoundAssignment
        private Expression Rewrite(BoundAssignment node)
        {
            Expression value = RewriteExpression(node.Value);

            if ((object)value != (object)node.Value)
            {
                return(Ast.Assign(node.Variable, value));
            }
            else
            {
                return(node);
            }
        }
예제 #3
0
        protected override object DoExecute(CodeContext context)
        {
            bool      rethrow  = false;
            Exception savedExc = null;
            object    ret      = Statement.NextStatement;

            try {
                ret = _body.Execute(context);
            } catch (Exception exc) {
                rethrow  = true;
                savedExc = exc;
                if (_handlers != null)
                {
                    PushEvalException(exc);
                    try {
                        foreach (CatchBlock handler in _handlers)
                        {
                            if (handler.Test.IsInstanceOfType(exc))
                            {
                                rethrow = false;
                                if (handler.Variable != null)
                                {
                                    BoundAssignment.EvaluateAssign(context, handler.Variable, exc);
                                }
                                ret = handler.Body.Execute(context);
                                break;
                            }
                        }
                    } finally {
                        PopEvalException();
                    }
                }
            } finally {
                if (_finally != null)
                {
                    object finallyRet = _finally.Execute(context);
                    if (finallyRet != Statement.NextStatement)
                    {
                        ret     = finallyRet;
                        rethrow = false;
                    }
                }
                if (rethrow)
                {
                    throw ExceptionHelpers.UpdateForRethrow(savedExc);
                }
            }

            return(ret);
        }
예제 #4
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return(true);
 }
예제 #5
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return true;
 }
예제 #6
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return false;
 }
예제 #7
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return(false);
 }
예제 #8
0
 // BoundAssignment
 private void DefaultWalk(BoundAssignment node)
 {
     if (Walk(node)) {
         WalkNode(node.Value);
     }
     PostWalk(node);
 }
        protected override void PostWalk(BoundAssignment node)
        {
          base.PostWalk(node);

          var val = node.Value;
          var var = node.Variable;

          val = ProcessAssignment(val, var);
          node.Value = val;
        }
        protected override bool Walk(BoundAssignment node)
        {
          var val = node.Value;
          var var = node.Variable;

          ProcessAssignment(val, var, true);  

          return base.Walk(node);
        }
예제 #11
0
 protected internal override bool Walk(BoundAssignment node) {
     node.Ref = GetOrMakeRef(node.Variable);
     return true;
 }
예제 #12
0
 internal override object EvaluateAssign(CodeContext context, object value)
 {
     return(BoundAssignment.EvaluateAssign(context, Variable, value));
 }
예제 #13
0
 // BoundAssignment
 private void Dump(BoundAssignment node)
 {
     Out("(.bound " + SymbolTable.IdToString(node.Variable.Name) + ") = ");
     WalkNode(node.Value);
 }