コード例 #1
0
 internal override MSA.Expression /*!*/ TransformRead(AstGenerator /*!*/ gen)
 {
     if (_value != null)
     {
         return(Ast.Block(
                    AstUtils.IfThen(
                        _condition.TransformReadBoolean(gen, !_negateCondition),
                        _jumpStatement.Transform(gen)
                        ),
                    _value.TransformRead(gen)
                    ));
     }
     else
     {
         MSA.Expression tmpVariable = gen.CurrentScope.DefineHiddenVariable("#tmp_cond", typeof(object));
         return(Ast.Block(
                    Ast.Assign(tmpVariable, AstUtils.Box(_condition.TransformRead(gen))),
                    AstUtils.IfThen(
                        (_negateCondition ? Methods.IsFalse : Methods.IsTrue).OpCall(tmpVariable),
                        _jumpStatement.Transform(gen)
                        ),
                    tmpVariable
                    ));
     }
 }
コード例 #2
0
 internal override MSA.Expression /*!*/ TransformRead(AstGenerator /*!*/ gen)
 {
     return(Ast.Condition(
                _condition.TransformReadBoolean(gen, !_negateCondition),
                AstUtils.Box(_body.TransformRead(gen)),
                (_elseStatement != null) ? AstUtils.Box(_elseStatement.TransformRead(gen)) : (MSA.Expression)AstUtils.Constant(null)
                ));
 }
コード例 #3
0
 internal override MSA.Expression /*!*/ TransformRead(AstGenerator /*!*/ gen)
 {
     return(AstFactory.Condition(
                _condition.TransformReadBoolean(gen, true),
                _trueExpression.TransformRead(gen),
                _falseExpression.TransformRead(gen)
                ));
 }
コード例 #4
0
 internal override MSA.Expression /*!*/ TransformReadBoolean(AstGenerator /*!*/ gen, bool positive)
 {
     return(AstFactory.Logical(_left.TransformReadBoolean(gen, positive), _right.TransformReadBoolean(gen, positive), positive));
 }
コード例 #5
0
ファイル: NotExpression.cs プロジェクト: rudimk/dlr-dotnet
 internal override MSA.Expression /*!*/ TransformRead(AstGenerator /*!*/ gen)
 {
     return(_expression.TransformReadBoolean(gen, false));
 }