Exemple #1
0
    protected LoopStatement(ToBoolean condition, Statement body)
    {
      Body = body;
      Condition = condition;
      SourceOffset = body.SourceOffset;

      Use(Condition);
      Use(Body);
    }
Exemple #2
0
        protected LoopStatement(ToBoolean condition, Statement body)
        {
            Body         = body;
            Condition    = condition;
            SourceOffset = body.SourceOffset;

            Use(Condition);
            Use(Body);
        }
Exemple #3
0
        public ToBoolean MakeToBoolean(Expression expression)
        {
            var n = expression as ToBoolean;

            if (n == null)
            {
                n = new ToBoolean(MakeGuardedCast(expression));
            }
            return(n);
        }
Exemple #4
0
        public ForStatement MakeForStatement(Scope scope, IStatement initialization, IExpression condition, IExpression increment, IStatement body)
        {
            scope.HasLoop = true;
            ToBoolean booleanCondition = null;

            if (condition != null)
            {
                booleanCondition = MakeToBoolean((Expression)condition);
            }
            var n = new ForStatement((Statement)initialization, booleanCondition, (Expression)increment, (Statement)body);

            return(n);
        }
Exemple #5
0
    public ForEachInStatement(
      Statement initialization, 
      ToObject expression, 
      Statement body, 
      Statement iteratorInitialization,
      ToBoolean iteratorCondition,
      BlockStatement extendedBody
    )
      : base(iteratorCondition, extendedBody)
    {
      Initialization = initialization;
      Expression = expression;
      OriginalBody = body;

      IteratorInitialization = iteratorInitialization;
      ExtendedBody = extendedBody;

      //Use(Expression); //We don't need this since IteratorInitialization must be already using it!
      Debug.Assert(Expression.HasUser, "{0} must already have a user", Expression);
    }
        public ForEachInStatement(
            Statement initialization,
            ToObject expression,
            Statement body,
            Statement iteratorInitialization,
            ToBoolean iteratorCondition,
            BlockStatement extendedBody
            )
            : base(iteratorCondition, extendedBody)
        {
            Initialization = initialization;
            Expression     = expression;
            OriginalBody   = body;

            IteratorInitialization = iteratorInitialization;
            ExtendedBody           = extendedBody;

            //Use(Expression); //We don't need this since IteratorInitialization must be already using it!
            Debug.Assert(Expression.HasUser, "{0} must already have a user", Expression);
        }
Exemple #7
0
 public override void Visit(ToBoolean node) { Visit(node, Types.Operations.Convert.ToBoolean); }
Exemple #8
0
 public override void Visit(ToBoolean node) { Visit((ConversionExpression)node); }
Exemple #9
0
 public override void Visit(ToBoolean node) { base.Visit(node); node.ValueType = GetType(node); }
Exemple #10
0
 internal static mdr.ValueTypes GetType(ToBoolean expression) { return Types.Operations.Convert.ToBoolean.ReturnType(expression.ValueType); }
Exemple #11
0
 public override void Visit(ToBoolean node)
 {
     Visit((ConversionExpression)node);
 }
Exemple #12
0
 public ToBoolean MakeToBoolean(Expression expression)
 {
   var n = expression as ToBoolean;
   if (n == null)
   {
     n = new ToBoolean(MakeGuardedCast(expression));
   }
   return n;
 }
Exemple #13
0
 public abstract void Visit(ToBoolean node);
Exemple #14
0
 public override void Visit(ToBoolean node)
 {
   PushLocation(node);
   VisitNode(node.Expression);
   Call(Types.Operations.Stack.ToBoolean, 1, 1);
   PopLocation();
 }
 public override void Visit(ToBoolean node) { AssignToImplicitReturn(node); }