Add few more accessors
authorMarek Safar <marek.safar@gmail.com>
Tue, 22 Jun 2010 08:55:35 +0000 (08:55 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 22 Jun 2010 08:55:35 +0000 (08:55 -0000)
svn path=/trunk/mcs/; revision=159315

mcs/mcs/expression.cs
mcs/mcs/statement.cs

index 8b516c900eef15222e5b1e9b6d14fcc0012fb393..3877c4b202ae677ae5e975d3f3554fb33b559a90 100644 (file)
@@ -8259,12 +8259,12 @@ namespace Mono.CSharp {
        ///   The base operator for method names
        /// </summary>
        public class BaseAccess : Expression {
-               public readonly string Identifier;
+               readonly string identifier;
                TypeArguments args;
 
                public BaseAccess (string member, Location l)
                {
-                       this.Identifier = member;
+                       this.identifier = member;
                        loc = l;
                }
 
@@ -8274,6 +8274,21 @@ namespace Mono.CSharp {
                        this.args = args;
                }
 
+               #region Properties
+
+               public string Identifier {
+                       get {
+                               return identifier;
+                       }
+               }
+
+               public TypeArguments TypeArguments {
+                       get {
+                               return args;
+                       }
+               }
+               #endregion
+
                public override Expression CreateExpressionTree (ResolveContext ec)
                {
                        throw new NotSupportedException ("ET");
@@ -8326,10 +8341,10 @@ namespace Mono.CSharp {
                        }
 
                        var arity = args == null ? -1 : args.Count;
-                       member_lookup = MemberLookup (ec.Compiler, ec.CurrentType, null, base_type, Identifier, arity,
+                       member_lookup = MemberLookup (ec.Compiler, ec.CurrentType, null, base_type, identifier, arity,
                                                      MemberKind.All, BindingRestriction.AccessibleOnly | BindingRestriction.NoOverrides, loc);
                        if (member_lookup == null) {
-                               Error_MemberLookupFailed (ec, ec.CurrentType, base_type, base_type, Identifier, arity,
+                               Error_MemberLookupFailed (ec, ec.CurrentType, base_type, base_type, identifier, arity,
                                        null, MemberKind.All, BindingRestriction.AccessibleOnly);
                                return null;
                        }
@@ -8338,10 +8353,10 @@ namespace Mono.CSharp {
                        if (me == null){
                                if (member_lookup is TypeExpression){
                                        ec.Report.Error (582, loc, "{0}: Can not reference a type through an expression, try `{1}' instead",
-                                                        Identifier, member_lookup.GetSignatureForError ());
+                                                        identifier, member_lookup.GetSignatureForError ());
                                } else {
                                        ec.Report.Error (582, loc, "{0}: Can not reference a {1} through an expression", 
-                                                        Identifier, member_lookup.ExprClassName);
+                                                        identifier, member_lookup.ExprClassName);
                                }
                                
                                return null;
index fc8e9adf12856713ca6b1724d1f11eedc90db27d..23051d36496594d0582b27eca44512d17b1e5d1a 100644 (file)
@@ -659,14 +659,23 @@ namespace Mono.CSharp {
        /// <summary>
        ///   Implements the return statement
        /// </summary>
-       public class Return : ExitStatement {
+       public class Return : ExitStatement
+       {
                protected Expression Expr;
                public Return (Expression expr, Location l)
                {
                        Expr = expr;
                        loc = l;
                }
-               
+
+               #region Properties
+               public Expression Expression {
+                       get {
+                               return Expr;
+                       }
+               }
+               #endregion
+
                protected override bool DoResolve (BlockContext ec)
                {
                        if (Expr == null) {