System.Linq.Expressions/ElementInit.cs
System.Linq.Expressions/Expression.cs
System.Linq.Expressions/Expression_T.cs
-System.Linq.Expressions/ExpressionCompiler.cs
+System.Linq.Expressions/ExpressionPrinter.cs
System.Linq.Expressions/ExpressionType.cs
-System.Linq.Expressions/ExpressionUtil.cs
+System.Linq.Expressions/ExpressionVisitor.cs
System.Linq.Expressions/InvocationExpression.cs
System.Linq.Expressions/LambdaExpression.cs
System.Linq.Expressions/ListInitExpression.cs
System/TimeZoneInfo.TransitionTimeTest.cs
System.Collections.Generic/HashSetTest.cs
System.Linq/EnumerableTest.cs
-System.Linq/QueryableTest.cs
System.Linq.Expressions/ExpressionTest.cs
-System.Linq.Expressions/ExpressionTest_Add.cs
-System.Linq.Expressions/ExpressionTest_AddChecked.cs
-System.Linq.Expressions/ExpressionTest_And.cs
-System.Linq.Expressions/ExpressionTest_AndAlso.cs
-System.Linq.Expressions/ExpressionTest_ArrayIndex.cs
-System.Linq.Expressions/ExpressionTest_ArrayLength.cs
-System.Linq.Expressions/ExpressionTest_Bind.cs
-System.Linq.Expressions/ExpressionTest_Call.cs
System.Linq.Expressions/ExpressionTest_Constant.cs
-System.Linq.Expressions/ExpressionTest_Divide.cs
-System.Linq.Expressions/ExpressionTest_ExclusiveOr.cs
-System.Linq.Expressions/ExpressionTest_Field.cs
-System.Linq.Expressions/ExpressionTest_LeftShift.cs
-System.Linq.Expressions/ExpressionTest_Modulo.cs
-System.Linq.Expressions/ExpressionTest_Multiply.cs
-System.Linq.Expressions/ExpressionTest_MultiplyChecked.cs
-System.Linq.Expressions/ExpressionTest_Or.cs
-System.Linq.Expressions/ExpressionTest_OrElse.cs
-System.Linq.Expressions/ExpressionTest_Property.cs
-System.Linq.Expressions/ExpressionTest_PropertyOrField.cs
-System.Linq.Expressions/ExpressionTest_Quote.cs
-System.Linq.Expressions/ExpressionTest_RightShift.cs
-System.Linq.Expressions/ExpressionTest_Subtract.cs
-System.Linq.Expressions/ExpressionTest_SubtractChecked.cs
-System.Linq.Expressions/ExpressionTest_TypeAs.cs
-System.Linq.Expressions/ExpressionTest_TypeIs.cs
System.Linq.Expressions/ExpressionTest_Utils.cs
--- /dev/null
+//
+// BinaryExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class BinaryExpression : Expression {
+
+ Expression left;
+ Expression right;
+ MethodInfo method;
+
+ public Expression Left {
+ get { return left; }
+ }
+
+ public Expression Right {
+ get { return right; }
+ }
+
+ public MethodInfo Method {
+ get { return method; }
+ }
+
+ [MonoTODO]
+ public bool IsLifted {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public bool IsLiftedToNull {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public LambdaExpression Conversion {
+ get {
+ if (this.NodeType != ExpressionType.Coalesce)
+ return null;
+
+ throw new System.NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+2008-01-13 Jb Evain <jbevain@novell.com>
+
+ * *.cs: fresh implementation.
--- /dev/null
+//
+// ConditionalExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Linq.Expressions {
+
+ public sealed class ConditionalExpression : Expression {
+
+ Expression test;
+ Expression ifTrue;
+ Expression ifFalse;
+
+ public Expression Test {
+ get { return test; }
+ }
+
+ public Expression IfTrue {
+ get { return ifTrue; }
+ }
+
+ public Expression IfFalse {
+ get { return ifFalse; }
+ }
+ }
+}
--- /dev/null
+//
+// ConstantExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Linq.Expressions {
+
+ public sealed class ConstantExpression : Expression {
+
+ object value;
+
+ public object Value {
+ get { return value; }
+ }
+
+ internal ConstantExpression (object value, Type type)
+ : base (ExpressionType.Constant, type)
+ {
+ this.value = value;
+ }
+ }
+}
--- /dev/null
+//
+// ElementInit.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class ElementInit {
+
+ MethodInfo add_method;
+ ReadOnlyCollection<Expression> arguments;
+
+ public MethodInfo AddMethod {
+ get { return add_method; }
+ }
+
+ public ReadOnlyCollection<Expression> Arguments {
+ get { return arguments; }
+ }
+
+ internal ElementInit (MethodInfo add_method, ReadOnlyCollection<Expression> arguments)
+ {
+ this.add_method = add_method;
+ this.arguments = arguments;
+ }
+
+ public override string ToString ()
+ {
+ return ExpressionPrinter.ToString (this);
+ }
+ }
+}
--- /dev/null
+//
+// Expression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public abstract class Expression {
+
+ ExpressionType node_type;
+ Type type;
+
+ public ExpressionType NodeType {
+ get { return node_type; }
+ }
+
+ public Type Type {
+ get { return type; }
+ }
+
+ // TODO: remove when all Expression subtypes
+ // have their constructor implemented
+ protected Expression ()
+ {
+ }
+
+ protected Expression (ExpressionType node_type, Type type)
+ {
+ this.node_type = node_type;
+ this.type = type;
+ }
+
+ public override string ToString ()
+ {
+ return ExpressionPrinter.ToString (this);
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Add (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Add (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression AddChecked (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression AddChecked (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression And (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression And (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression AndAlso (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression AndAlso (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression ArrayIndex (Expression left, params Expression [] indexes)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression ArrayIndex (Expression left, IEnumerable<Expression> indexes)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression ArrayIndex (Expression left, Expression index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static UnaryExpression ArrayLength (Expression array)
+ {
+ if (array == null)
+ throw new ArgumentNullException ("array");
+ if (!array.Type.IsArray)
+ throw new ArgumentException ("The type of the expression must me Array");
+ if (array.Type.GetArrayRank () != 1)
+ throw new ArgumentException ("The array must be a single dimensional array");
+
+ return new UnaryExpression (ExpressionType.ArrayLength, array, typeof (int));
+ }
+
+ [MonoTODO]
+ public static MemberAssignment Bind (MemberInfo member, Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberAssignment Bind (MethodInfo propertyAccessor, Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression Call (Expression instance, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression Call (MethodInfo method, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression Call (Expression instance, MethodInfo method, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression Call (Expression instance, MethodInfo method, IEnumerable<Expression> arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MethodCallExpression Call (Type type, string methodName, Type [] typeArguments, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Coalesce (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Coalesce (Expression left, Expression right, LambdaExpression conversion)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ConditionalExpression Condition (Expression test, Expression ifTrue, Expression ifFalse)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ConstantExpression Constant (object value)
+ {
+ return Constant (value, value == null ? typeof (object) : value.GetType ());
+ }
+
+ public static ConstantExpression Constant (object value, Type type)
+ {
+ if (type == null)
+ throw new ArgumentNullException ("type");
+ if (value == null && type.IsValueType && !IsNullable (type))
+ throw new ArgumentException ();
+
+ // TODO: check assignability
+
+ return new ConstantExpression (value, type);
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Convert (Expression expression, Type type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Convert (Expression expression, Type type, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression ConvertChecked (Expression expression, Type type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression ConvertChecked (Expression expression, Type type, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Divide (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Divide (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ElementInit ElementInit (MethodInfo addMethod, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ElementInit ElementInit (MethodInfo addMethod, IEnumerable<Expression> arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Equal (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Equal (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression ExclusiveOr (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression ExclusiveOr (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression Field (Expression expression, FieldInfo field)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression Field (Expression expression, string fieldName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static Type GetActionType (params Type [] typeArgs)
+ {
+ if (typeArgs == null)
+ throw new ArgumentNullException ("typeArgs");
+
+ if (typeArgs.Length > 4)
+ throw new ArgumentException ("No Action type of this arity");
+
+ if (typeArgs.Length == 0)
+ return typeof (Action);
+
+ Type action = null;
+ switch (typeArgs.Length) {
+ case 1:
+ action = typeof (Action<>);
+ break;
+ case 2:
+ action = typeof (Action<,>);
+ break;
+ case 3:
+ action = typeof (Action<,,>);
+ break;
+ case 4:
+ action = typeof (Action<,,,>);
+ break;
+ }
+
+ return action.MakeGenericType (typeArgs);
+ }
+
+ public static Type GetFuncType (params Type [] typeArgs)
+ {
+ if (typeArgs == null)
+ throw new ArgumentNullException ("typeArgs");
+
+ if (typeArgs.Length < 1 || typeArgs.Length > 5)
+ throw new ArgumentException ("No Func type of this arity");
+
+ Type func = null;
+ switch (typeArgs.Length) {
+ case 1:
+ func = typeof (Func<>);
+ break;
+ case 2:
+ func = typeof (Func<,>);
+ break;
+ case 3:
+ func = typeof (Func<,,>);
+ break;
+ case 4:
+ func = typeof (Func<,,,>);
+ break;
+ case 5:
+ func = typeof (Func<,,,,>);
+ break;
+ }
+
+ return func.MakeGenericType (typeArgs);
+ }
+
+ [MonoTODO]
+ public static BinaryExpression GreaterThan (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression GreaterThan (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression GreaterThanOrEqual (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression GreaterThanOrEqual (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static InvocationExpression Invoke (Expression expression, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static InvocationExpression Invoke (Expression expression, IEnumerable<Expression> arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static Expression<TDelegate> Lambda<TDelegate> (Expression body, params ParameterExpression [] parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static Expression<TDelegate> Lambda<TDelegate> (Expression body, IEnumerable<ParameterExpression> parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static LambdaExpression Lambda (Expression body, params ParameterExpression [] parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static LambdaExpression Lambda (Type delegateType, Expression body, params ParameterExpression [] parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static LambdaExpression Lambda (Type delegateType, Expression body, IEnumerable<ParameterExpression> parameters)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LeftShift (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LeftShift (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LessThan (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LessThan (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LessThanOrEqual (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression LessThanOrEqual (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberListBinding ListBind (MemberInfo member, params ElementInit [] initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberListBinding ListBind (MemberInfo member, IEnumerable<ElementInit> initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberListBinding ListBind (MethodInfo propertyAccessor, params ElementInit [] initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberListBinding ListBind (MethodInfo propertyAccessor, IEnumerable<ElementInit> initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, params ElementInit [] initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, IEnumerable<ElementInit> initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, params Expression [] initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, IEnumerable<Expression> initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, MethodInfo addMethod, params Expression [] initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ListInitExpression ListInit (NewExpression newExpression, MethodInfo addMethod, IEnumerable<Expression> initializers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression MakeBinary (ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo method, LambdaExpression conversion)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression MakeMemberAccess (Expression expression, MemberInfo member)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static UnaryExpression MakeUnary (ExpressionType unaryType, Expression operand, Type type)
+ {
+ return MakeUnary (unaryType, operand, null, null);
+ }
+
+ public static UnaryExpression MakeUnary (ExpressionType unaryType, Expression operand, Type type, MethodInfo method)
+ {
+ if (!IsUnaryOperator (unaryType))
+ throw new ArgumentException ("Make unary expect an unary operator");
+ if (operand == null)
+ throw new ArgumentNullException ("operand");
+
+ return new UnaryExpression (unaryType, operand, type != null ? type : operand.Type, method);
+ }
+
+ static bool IsUnaryOperator (ExpressionType type)
+ {
+ switch (type) {
+ case ExpressionType.ArrayLength:
+ case ExpressionType.Convert:
+ case ExpressionType.ConvertChecked:
+ case ExpressionType.Negate:
+ case ExpressionType.NegateChecked:
+ case ExpressionType.Not:
+ case ExpressionType.Quote:
+ case ExpressionType.TypeAs:
+ case ExpressionType.UnaryPlus:
+ return true;
+ }
+
+ return false;
+ }
+
+ [MonoTODO]
+ public static MemberMemberBinding MemberBind (MemberInfo member, params MemberBinding [] binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberMemberBinding MemberBind (MemberInfo member, IEnumerable<MemberBinding> binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberMemberBinding MemberBind (MethodInfo propertyAccessor, params MemberBinding [] binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberMemberBinding MemberBind (MethodInfo propertyAccessor, IEnumerable<MemberBinding> binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberInitExpression MemberInit (NewExpression newExpression, params MemberBinding [] binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberInitExpression MemberInit (NewExpression newExpression, IEnumerable<MemberBinding> binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Modulo (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Modulo (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Multiply (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Multiply (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression MultiplyChecked (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression MultiplyChecked (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Negate (Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Negate (Expression expression, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression NegateChecked (Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression NegateChecked (Expression expression, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (ConstructorInfo constructor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (Type type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (ConstructorInfo constructor, params Expression [] arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments, params MemberInfo [] members)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression New (ConstructorInfo constructor, IEnumerable<Expression> arguments, IEnumerable<MemberInfo> members)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewArrayExpression NewArrayBounds (Type type, params Expression [] bounds)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewArrayExpression NewArrayBounds (Type type, IEnumerable<Expression> bounds)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression NewArrayInit (Type type, params Expression [] bounds)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static NewExpression NewArrayInit (Type type, IEnumerable<Expression> bounds)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Not (Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression Not (Expression expression, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression NotEqual (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression NotEqual (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Or (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Or (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression OrElse (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression OrElse (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static ParameterExpression Parameter (Type type, string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Power (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Power (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression Property (Expression expression, MethodInfo propertyAccessor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression Property (Expression expression, PropertyInfo property)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression Property (Expression expression, string propertyName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static MemberExpression PropertyOrField (Expression expression, string propertyOrFieldName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static UnaryExpression Quote (Expression expression)
+ {
+ if (expression == null)
+ throw new ArgumentNullException ("expression");
+
+ return new UnaryExpression (ExpressionType.Quote, expression);
+ }
+
+ [MonoTODO]
+ public static BinaryExpression RightShift (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression RightShift (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Subtract (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression Subtract (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression SubtractChecked (Expression left, Expression right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static BinaryExpression SubtractChecked (Expression left, Expression right, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static UnaryExpression TypeAs (Expression expression, Type type)
+ {
+ if (expression == null)
+ throw new ArgumentNullException ("expression");
+ if (type == null)
+ throw new ArgumentNullException ("type");
+
+ return new UnaryExpression (ExpressionType.TypeAs, expression, type);
+ }
+
+ [MonoTODO]
+ public static TypeBinaryExpression TypeIs (Expression expression, Type type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression UnaryPlus (Expression expression)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static UnaryExpression UnaryPlus (Expression expression, MethodInfo method)
+ {
+ throw new NotImplementedException ();
+ }
+
+ static bool IsNullable (Type type)
+ {
+ return type.IsGenericType && type.GetGenericTypeDefinition () == typeof (Nullable<>);
+ }
+ }
+}
--- /dev/null
+//
+// ExpressionPrinter.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+namespace System.Linq.Expressions {
+
+ class ExpressionPrinter : ExpressionVisitor {
+
+ StringBuilder builder;
+
+ ExpressionPrinter (StringBuilder builder)
+ {
+ this.builder = builder;
+ }
+
+ ExpressionPrinter () : this (new StringBuilder ())
+ {
+ }
+
+ public static string ToString (Expression expression)
+ {
+ var printer = new ExpressionPrinter ();
+ printer.Visit (expression);
+ return printer.builder.ToString ();
+ }
+
+ public static string ToString (ElementInit init)
+ {
+ var printer = new ExpressionPrinter ();
+ printer.VisitElementInitializer (init);
+ return printer.builder.ToString ();
+ }
+
+ public static string ToString (MemberBinding binding)
+ {
+ var printer = new ExpressionPrinter ();
+ printer.VisitBinding (binding);
+ return printer.builder.ToString ();
+ }
+
+ void Print (string str)
+ {
+ builder.Append (str);
+ }
+
+ void Print (object obj)
+ {
+ builder.Append (obj);
+ }
+
+ void Print (string str, params object [] objs)
+ {
+ builder.AppendFormat (str, objs);
+ }
+
+ protected override void VisitElementInitializer (ElementInit initializer)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitUnary (UnaryExpression unary)
+ {
+ throw new NotImplementedException ();
+ }
+
+ static string OperatorToString (BinaryExpression binary)
+ {
+ switch (binary.NodeType) {
+ case ExpressionType.Add:
+ case ExpressionType.AddChecked:
+ return "+";
+ case ExpressionType.AndAlso:
+ return "&&";
+ case ExpressionType.Coalesce:
+ return "??";
+ case ExpressionType.Divide:
+ return "/";
+ case ExpressionType.Equal:
+ return "==";
+ case ExpressionType.ExclusiveOr:
+ return "^";
+ case ExpressionType.GreaterThan:
+ return ">";
+ case ExpressionType.GreaterThanOrEqual:
+ return ">=";
+ case ExpressionType.LeftShift:
+ return "<<";
+ case ExpressionType.LessThan:
+ return "<";
+ case ExpressionType.LessThanOrEqual:
+ return "<=";
+ case ExpressionType.Modulo:
+ return "%";
+ case ExpressionType.Multiply:
+ case ExpressionType.MultiplyChecked:
+ return "*";
+ case ExpressionType.NotEqual:
+ return "!=";
+ case ExpressionType.OrElse:
+ return "||";
+ case ExpressionType.RightShift:
+ return ">>";
+ case ExpressionType.Subtract:
+ case ExpressionType.SubtractChecked:
+ return "-";
+ case ExpressionType.And:
+ return IsBoolean (binary) ? "And" : "&";
+ case ExpressionType.Or:
+ return IsBoolean (binary) ? "Or" : "|";
+ default:
+ return null;
+ }
+ }
+
+ static bool IsBoolean (Expression expression)
+ {
+ return expression.Type == typeof (bool) || expression.Type == typeof (bool?);
+ }
+
+ protected override void VisitBinary (BinaryExpression binary)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitTypeIs (TypeBinaryExpression type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitConstant (ConstantExpression constant)
+ {
+ var value = constant.Value;
+
+ if (value == null) {
+ Print ("null");
+ } else if (value is string) {
+ Print ("\"");
+ Print (value);
+ Print ("\"");
+ } else if (!HasStringRepresentation (value)) {
+ Print ("value(");
+ Print (value);
+ Print (")");
+ } else
+ Print (value);
+ }
+
+ static bool HasStringRepresentation (object obj)
+ {
+ return obj.ToString () != obj.GetType ().ToString ();
+ }
+
+ protected override void VisitConditional (ConditionalExpression conditional)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitParameter (ParameterExpression parameter)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMemberAccess (MemberExpression member)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMethodCall (MethodCallExpression methodCall)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitExpressionList (ReadOnlyCollection<Expression> list)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMemberAssignment (MemberAssignment assignment)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMemberMemberBinding (MemberMemberBinding binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMemberListBinding (MemberListBinding binding)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitList<T> (ReadOnlyCollection<T> list, Action<T> visitor)
+ {
+ for (int i = 0; i < list.Count; i++) {
+ if (i > 0)
+ Print (", ");
+
+ visitor (list [i]);
+ }
+ }
+
+ protected override void VisitLambda (LambdaExpression lambda)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitNew (NewExpression nex)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitMemberInit (MemberInitExpression init)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitListInit (ListInitExpression init)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitNewArray (NewArrayExpression newArray)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void VisitInvocation (InvocationExpression invocation)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// Expression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Linq.Expressions {
+
+ public enum ExpressionType {
+ Add,
+ AddChecked,
+ And,
+ AndAlso,
+ ArrayLength,
+ ArrayIndex,
+ Call,
+ Coalesce,
+ Conditional,
+ Constant,
+ Convert,
+ ConvertChecked,
+ Divide,
+ Equal,
+ ExclusiveOr,
+ GreaterThan,
+ GreaterThanOrEqual,
+ Invoke,
+ Lambda,
+ LeftShift,
+ LessThan,
+ LessThanOrEqual,
+ ListInit,
+ MemberAccess,
+ MemberInit,
+ Modulo,
+ Multiply,
+ MultiplyChecked,
+ Negate,
+ UnaryPlus,
+ NegateChecked,
+ New,
+ NewArrayInit,
+ NewArrayBounds,
+ Not,
+ NotEqual,
+ Or,
+ OrElse,
+ Parameter,
+ Power,
+ Quote,
+ RightShift,
+ Subtract,
+ SubtractChecked,
+ TypeAs,
+ TypeIs,
+ }
+}
--- /dev/null
+//
+// ExpressionVisitor.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+
+namespace System.Linq.Expressions {
+
+ abstract class ExpressionVisitor {
+
+ protected ExpressionVisitor ()
+ {
+ }
+
+ protected virtual void Visit (Expression expression)
+ {
+ if (expression == null)
+ return;
+
+ switch (expression.NodeType) {
+ case ExpressionType.Negate:
+ case ExpressionType.NegateChecked:
+ case ExpressionType.Not:
+ case ExpressionType.Convert:
+ case ExpressionType.ConvertChecked:
+ case ExpressionType.ArrayLength:
+ case ExpressionType.Quote:
+ case ExpressionType.TypeAs:
+ VisitUnary ((UnaryExpression) expression);
+ break;
+ case ExpressionType.Add:
+ case ExpressionType.AddChecked:
+ case ExpressionType.Subtract:
+ case ExpressionType.SubtractChecked:
+ case ExpressionType.Multiply:
+ case ExpressionType.MultiplyChecked:
+ case ExpressionType.Divide:
+ case ExpressionType.Modulo:
+ case ExpressionType.And:
+ case ExpressionType.AndAlso:
+ case ExpressionType.Or:
+ case ExpressionType.OrElse:
+ case ExpressionType.LessThan:
+ case ExpressionType.LessThanOrEqual:
+ case ExpressionType.GreaterThan:
+ case ExpressionType.GreaterThanOrEqual:
+ case ExpressionType.Equal:
+ case ExpressionType.NotEqual:
+ case ExpressionType.Coalesce:
+ case ExpressionType.ArrayIndex:
+ case ExpressionType.RightShift:
+ case ExpressionType.LeftShift:
+ case ExpressionType.ExclusiveOr:
+ VisitBinary ((BinaryExpression) expression);
+ break;
+ case ExpressionType.TypeIs:
+ VisitTypeIs ((TypeBinaryExpression) expression);
+ break;
+ case ExpressionType.Conditional:
+ VisitConditional ((ConditionalExpression) expression);
+ break;
+ case ExpressionType.Constant:
+ VisitConstant ((ConstantExpression) expression);
+ break;
+ case ExpressionType.Parameter:
+ VisitParameter ((ParameterExpression) expression);
+ break;
+ case ExpressionType.MemberAccess:
+ VisitMemberAccess ((MemberExpression) expression);
+ break;
+ case ExpressionType.Call:
+ VisitMethodCall ((MethodCallExpression) expression);
+ break;
+ case ExpressionType.Lambda:
+ VisitLambda ((LambdaExpression) expression);
+ break;
+ case ExpressionType.New:
+ VisitNew ((NewExpression) expression);
+ break;
+ case ExpressionType.NewArrayInit:
+ case ExpressionType.NewArrayBounds:
+ VisitNewArray ((NewArrayExpression) expression);
+ break;
+ case ExpressionType.Invoke:
+ VisitInvocation ((InvocationExpression) expression);
+ break;
+ case ExpressionType.MemberInit:
+ VisitMemberInit ((MemberInitExpression) expression);
+ break;
+ case ExpressionType.ListInit:
+ VisitListInit ((ListInitExpression) expression);
+ break;
+ default:
+ throw new ArgumentException (string.Format ("Unhandled expression type: '{0}'", expression.NodeType));
+ }
+ }
+
+ protected virtual void VisitBinding (MemberBinding binding)
+ {
+ switch (binding.BindingType) {
+ case MemberBindingType.Assignment:
+ VisitMemberAssignment ((MemberAssignment) binding);
+ break;
+ case MemberBindingType.MemberBinding:
+ VisitMemberMemberBinding ((MemberMemberBinding) binding);
+ break;
+ case MemberBindingType.ListBinding:
+ VisitMemberListBinding ((MemberListBinding) binding);
+ break;
+ default:
+ throw new ArgumentException (string.Format ("Unhandled binding type '{0}'", binding.BindingType));
+ }
+ }
+
+ protected virtual void VisitElementInitializer (ElementInit initializer)
+ {
+ VisitExpressionList (initializer.Arguments);
+ }
+
+ protected virtual void VisitUnary (UnaryExpression unary)
+ {
+ Visit (unary.Operand);
+ }
+
+ protected virtual void VisitBinary (BinaryExpression binary)
+ {
+ Visit (binary.Left);
+ Visit (binary.Right);
+ Visit (binary.Conversion);
+ }
+
+ protected virtual void VisitTypeIs (TypeBinaryExpression type)
+ {
+ Visit (type.Expression);
+ }
+
+ protected virtual void VisitConstant (ConstantExpression constant)
+ {
+ }
+
+ protected virtual void VisitConditional (ConditionalExpression conditional)
+ {
+ Visit (conditional.Test);
+ Visit (conditional.IfTrue);
+ Visit (conditional.IfFalse);
+ }
+
+ protected virtual void VisitParameter (ParameterExpression parameter)
+ {
+ }
+
+ protected virtual void VisitMemberAccess (MemberExpression member)
+ {
+ Visit (member.Expression);
+ }
+
+ protected virtual void VisitMethodCall (MethodCallExpression methodCall)
+ {
+ Visit (methodCall.Object);
+ VisitExpressionList (methodCall.Arguments);
+ }
+
+ protected virtual void VisitList<T> (ReadOnlyCollection<T> list, Action<T> visitor)
+ {
+ foreach (T element in list) {
+ visitor (element);
+ }
+ }
+
+ protected virtual void VisitExpressionList (ReadOnlyCollection<Expression> list)
+ {
+ VisitList (list, Visit);
+ }
+
+ protected virtual void VisitMemberAssignment (MemberAssignment assignment)
+ {
+ Visit (assignment.Expression);
+ }
+
+ protected virtual void VisitMemberMemberBinding (MemberMemberBinding binding)
+ {
+ VisitBindingList (binding.Bindings);
+ }
+
+ protected virtual void VisitMemberListBinding (MemberListBinding binding)
+ {
+ VisitElementInitializerList (binding.Initializers);
+ }
+
+ protected virtual void VisitBindingList (ReadOnlyCollection<MemberBinding> list)
+ {
+ VisitList (list, VisitBinding);
+ }
+
+ protected virtual void VisitElementInitializerList (ReadOnlyCollection<ElementInit> list)
+ {
+ VisitList (list, VisitElementInitializer);
+ }
+
+ protected virtual void VisitLambda (LambdaExpression lambda)
+ {
+ Visit (lambda.Body);
+ }
+
+ protected virtual void VisitNew (NewExpression nex)
+ {
+ VisitExpressionList (nex.Arguments);
+ }
+
+ protected virtual void VisitMemberInit (MemberInitExpression init)
+ {
+ VisitNew (init.NewExpression);
+ VisitBindingList (init.Bindings);
+ }
+
+ protected virtual void VisitListInit (ListInitExpression init)
+ {
+ VisitNew (init.NewExpression);
+ VisitElementInitializerList (init.Initializers);
+ }
+
+ protected virtual void VisitNewArray (NewArrayExpression newArray)
+ {
+ VisitExpressionList (newArray.Expressions);
+ }
+
+ protected virtual void VisitInvocation (InvocationExpression invocation)
+ {
+ VisitExpressionList (invocation.Arguments);
+ Visit (invocation.Expression);
+ }
+ }
+}
--- /dev/null
+//
+// Expression_T.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Linq.Expressions {
+
+ public sealed class Expression<TDelegate> : LambdaExpression {
+
+ [MonoTODO]
+ public new TDelegate Compile ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// InvocationExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+namespace System.Linq.Expressions {
+
+ public sealed class InvocationExpression : Expression {
+
+ Expression lambda;
+ ReadOnlyCollection<Expression> arguments;
+
+ public Expression Expression {
+ get { return lambda; }
+ }
+
+ public ReadOnlyCollection<Expression> Arguments {
+ get { return arguments; }
+ }
+ }
+}
--- /dev/null
+//
+// LambdaExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+
+namespace System.Linq.Expressions {
+
+ public class LambdaExpression : Expression {
+
+ Expression body;
+ ReadOnlyCollection<ParameterExpression> parameters;
+
+ public Expression Body {
+ get { return body; }
+ }
+
+ public ReadOnlyCollection<ParameterExpression> Parameters {
+ get { return parameters; }
+ }
+
+ [MonoTODO]
+ public Delegate Compile ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+//
+// ListInitExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+namespace System.Linq.Expressions {
+
+ public sealed class ListInitExpression : Expression {
+
+ NewExpression new_expression;
+ ReadOnlyCollection<ElementInit> initializers;
+
+ public NewExpression NewExpression {
+ get { return new_expression; }
+ }
+
+ public ReadOnlyCollection<ElementInit> Initializers {
+ get { return initializers; }
+ }
+ }
+}
--- /dev/null
+//
+// MemberAssignement.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Text;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MemberAssignment : MemberBinding {
+
+ Expression expression;
+
+ public Expression Expression {
+ get { return expression; }
+ }
+ }
+}
--- /dev/null
+//
+// MemberBinding.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public abstract class MemberBinding {
+
+ MemberBindingType binding_type;
+ MemberInfo member;
+
+ public MemberBindingType BindingType {
+ get { return binding_type; }
+ }
+
+ public MemberInfo Member {
+ get { return member; }
+ }
+
+ public override string ToString ()
+ {
+ return ExpressionPrinter.ToString (this);
+ }
+ }
+}
--- /dev/null
+//
+// MemberBindingType.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Linq.Expressions {
+
+ public enum MemberBindingType {
+ Assignment,
+ MemberBinding,
+ ListBinding
+ }
+}
--- /dev/null
+//
+// MemberExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Text;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MemberExpression : Expression {
+
+ Expression expression;
+ MemberInfo member;
+
+ public Expression Expression {
+ get { return expression; }
+ }
+
+ public MemberInfo Member {
+ get { return member; }
+ }
+ }
+}
--- /dev/null
+//
+// MemberInitExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MemberInitExpression : Expression {
+
+ NewExpression new_expression;
+ ReadOnlyCollection<MemberBinding> bindings;
+
+ public NewExpression NewExpression {
+ get { return new_expression; }
+ }
+
+ public ReadOnlyCollection<MemberBinding> Bindings {
+ get { return bindings; }
+ }
+ }
+}
--- /dev/null
+//
+// MemberListBinding.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MemberListBinding : MemberBinding {
+
+ ReadOnlyCollection<ElementInit> initializers;
+
+ public ReadOnlyCollection<ElementInit> Initializers {
+ get { return initializers; }
+ }
+ }
+}
--- /dev/null
+//
+// MemberMemberExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MemberMemberBinding : MemberBinding {
+
+ ReadOnlyCollection<MemberBinding> bindings;
+
+ public ReadOnlyCollection<MemberBinding> Bindings {
+ get { return bindings; }
+ }
+ }
+}
--- /dev/null
+//
+// MethodCallExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class MethodCallExpression : Expression {
+
+ Expression @object;
+ MethodInfo method;
+ ReadOnlyCollection<Expression> arguments;
+
+ public Expression Object {
+ get { return @object; }
+ }
+
+ public MethodInfo Method {
+ get { return method; }
+ }
+
+ public ReadOnlyCollection<Expression> Arguments {
+ get { return arguments; }
+ }
+ }
+}
--- /dev/null
+//
+// NewArrayExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+
+namespace System.Linq.Expressions {
+
+ public sealed class NewArrayExpression : Expression {
+
+ ReadOnlyCollection<Expression> expressions;
+
+ public ReadOnlyCollection<Expression> Expressions {
+ get { return expressions; }
+ }
+ }
+}
--- /dev/null
+//
+// NewExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class NewExpression : Expression {
+
+ ConstructorInfo constructor;
+ ReadOnlyCollection<Expression> arguments;
+ ReadOnlyCollection<MemberInfo> members;
+
+ public ConstructorInfo Constructor {
+ get { return constructor; }
+ }
+
+ public ReadOnlyCollection<Expression> Arguments {
+ get { return arguments; }
+ }
+
+ public ReadOnlyCollection<MemberInfo> Members {
+ get { return members; }
+ }
+ }
+}
--- /dev/null
+//
+// ParameterExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Linq.Expressions {
+
+ public sealed class ParameterExpression : Expression {
+
+ string name;
+
+ public string Name {
+ get { return name; }
+ }
+ }
+}
--- /dev/null
+//
+// TypeBinaryExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace System.Linq.Expressions {
+
+ public sealed class TypeBinaryExpression : Expression {
+
+ Expression expression;
+ Type type_operand;
+
+ public Expression Expression {
+ get { return expression; }
+ }
+
+ public Type TypeOperand {
+ get { return type_operand; }
+ }
+ }
+}
--- /dev/null
+//
+// UnaryExpression.cs
+//
+// Author:
+// Jb Evain (jbevain@novell.com)
+//
+// (C) 2008 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+
+namespace System.Linq.Expressions {
+
+ public sealed class UnaryExpression : Expression {
+
+ Expression operand;
+ MethodInfo method;
+
+ public Expression Operand {
+ get { return operand; }
+ }
+
+ public MethodInfo Method {
+ get { return method; }
+ }
+
+ [MonoTODO]
+ public bool IsLifted {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public bool IsLiftedToNull {
+ get { throw new NotImplementedException (); }
+ }
+
+ internal UnaryExpression (ExpressionType node_type, Expression operand)
+ : base (node_type, operand.Type)
+ {
+ this.operand = operand;
+ }
+
+ internal UnaryExpression (ExpressionType node_type, Expression operand, Type type)
+ : base (node_type, type)
+ {
+ this.operand = operand;
+ }
+
+ internal UnaryExpression (ExpressionType node_type, Expression operand, Type type, MethodInfo method)
+ : base (node_type, type)
+ {
+ this.operand = operand;
+ this.method = method;
+ }
+ }
+}