PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/IronPython_Main/Languages/Ruby/Ruby/Compiler/Ast/Expressions/IsDefinedExpression.cs

#
C# | 48 lines | 26 code | 8 blank | 14 comment | 0 complexity | 23795f13d011fc9ea5be5f2010ac3d50 MD5 | raw file
 1/* ****************************************************************************
 2 *
 3 * Copyright (c) Microsoft Corporation. 
 4 *
 5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
 6 * copy of the license can be found in the License.html file at the root of this distribution. If 
 7 * you cannot locate the  Apache License, Version 2.0, please send an email to 
 8 * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 9 * by the terms of the Apache License, Version 2.0.
10 *
11 * You must not remove this notice, or any other, from this software.
12 *
13 *
14 * ***************************************************************************/
15
16#if !CLR2
17using MSA = System.Linq.Expressions;
18#else
19using MSA = Microsoft.Scripting.Ast;
20#endif
21
22using Microsoft.Scripting;
23using Microsoft.Scripting.Utils;
24
25namespace IronRuby.Compiler.Ast {
26    public partial class IsDefinedExpression : Expression {
27        private readonly Expression/*!*/ _expression;
28
29        public Expression/*!*/ Expression {
30            get { return _expression; }
31        }
32
33        public IsDefinedExpression(Expression/*!*/ expression, SourceSpan location)
34            : base(location) {
35            Assert.NotNull(expression);
36
37            _expression = expression;
38        }
39
40        internal override MSA.Expression/*!*/ TransformRead(AstGenerator/*!*/ gen) {
41            return _expression.TransformIsDefined(gen);
42        }
43
44        internal override MSA.Expression/*!*/ TransformReadBoolean(AstGenerator/*!*/ gen, bool positive) {
45            return _expression.TransformBooleanIsDefined(gen, positive);
46        }
47    }
48}