Exemplo n.º 1
0
 public override object VisitUnaryOperatorExpression(IFSharpCode.NRefactory.Ast.UnaryOperatorExpression unaryOperatorExpression, object data)
 {
     bool result = (bool)(unaryOperatorExpression.Expression.AcceptVisitor (this, data) ?? (object)false);
     if (unaryOperatorExpression.Op == IFSharpCode.NRefactory.Ast.UnaryOperatorType.Not)
         return !result;
     return result;
 }
Exemplo n.º 2
0
 public override object VisitIdentifierExpression(IFSharpCode.NRefactory.Ast.IdentifierExpression identifierExpression, object data)
 {
     return symbols.Contains (identifierExpression.Identifier);
 }
Exemplo n.º 3
0
 public override object VisitPrimitiveExpression(IFSharpCode.NRefactory.Ast.PrimitiveExpression primitiveExpression, object data)
 {
     return (bool)primitiveExpression.Value;
 }
Exemplo n.º 4
0
                public override object VisitBinaryOperatorExpression(IFSharpCode.NRefactory.Ast.BinaryOperatorExpression binaryOperatorExpression, object data)
                {
                    bool left  = (bool)(binaryOperatorExpression.Left.AcceptVisitor (this, data) ?? (object)false);
                    bool right = (bool)(binaryOperatorExpression.Right.AcceptVisitor (this, data) ?? (object)false);

                    switch (binaryOperatorExpression.Op) {
                    case IFSharpCode.NRefactory.Ast.BinaryOperatorType.InEquality:
                        return left != right;
                    case IFSharpCode.NRefactory.Ast.BinaryOperatorType.Equality:
                        return left == right;
                    case IFSharpCode.NRefactory.Ast.BinaryOperatorType.LogicalOr:
                        return left || right;
                    case IFSharpCode.NRefactory.Ast.BinaryOperatorType.LogicalAnd:
                        return left && right;
                    }

                    Console.WriteLine ("Unknown operator:" + binaryOperatorExpression.Op);
                    return left;
                }