refactoring
[mono.git] / mcs / class / System.Core / System.Linq.Expressions / ParameterExpression.cs
index a3621fcc06e10c3d01996b56300be366de5538ae..e4cd848bbaedf3063ad21cacb2f9da594f7b9e17 100644 (file)
@@ -1,3 +1,12 @@
+//
+// ParameterExpression.cs
+//
+// Author:
+//   Jb Evain (jbevain@novell.com)
+//   Miguel de Icaza (miguel@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
 // 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
-//
-// Authors:
-//        Marek Safar (marek.safar@seznam.cz)
-//        Antonello Provenzano  <antonello@deveel.com>
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
 using System;
-using System.Text;
+using System.Reflection.Emit;
+
+namespace System.Linq.Expressions {
+
+       public sealed class ParameterExpression : Expression {
 
-namespace System.Linq.Expressions
-{
-    public class ParameterExpression : Expression
-    {
-        #region .ctor
-        internal ParameterExpression(Type type, string name)
-            : base(ExpressionType.Parameter, type) {
-            this.name = name;
-        }
-        #endregion
+               string name;
 
-        #region Fields
-        private string name;
-        #endregion
+               public string Name {
+                       get { return name; }
+               }
 
-        #region Properties
-        public string Name
-        {
-            get { return name; }
-        }
-        #endregion
+               internal ParameterExpression (Type type, string name)
+                       : base (ExpressionType.Parameter, type)
+               {
+                       this.name = name;
+               }
 
-        #region Internal Methods
-        internal override void BuildString(StringBuilder builder)
-        {
-            string param = name;
-            if (param == null)
-                param = "<param>";
-            builder.Append(param);
-        }
-        #endregion
-    }
+               internal override void Emit (EmitContext ec)
+               {
+                       ec.ig.Emit (OpCodes.Ldarg, ec.GetParameterPosition (this));
+               }
+       }
 }