2006-09-21 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / generic.cs
1 //
2 // generic.cs: Support classes for generics to reduce differences from GMCS
3 //
4 // Author:
5 //   Raja R Harinath <rharinath@novell.com>
6 //
7 // (C) 2006 Novell, Inc.
8 //
9 using System;
10 using System.Reflection;
11 using System.Reflection.Emit;
12 using System.Collections;
13
14 namespace Mono.CSharp
15 {
16         public abstract class GenericConstraints
17         {
18                 public abstract string TypeParameter {
19                         get;
20                 }
21         }
22
23         public abstract class Constraints : GenericConstraints
24         {
25                 public abstract Location Location {
26                         get;
27                 }
28         }
29
30         public class TypeParameter : MemberCore, IMemberContainer
31         {
32                 public TypeParameter (DeclSpace parent, DeclSpace decl, string name,
33                                       Constraints constraints, Attributes attrs, Location loc)
34                         : base (parent, new MemberName (name, loc), attrs)
35                 {
36                         throw new NotImplementedException ();
37                 }
38
39                 public static string GetSignatureForError (TypeParameter[] tp)
40                 {
41                         throw new NotImplementedException ();
42                 }
43
44                 //
45                 // MemberContainer
46                 //
47
48                 public override bool Define ()
49                 {
50                         return true;
51                 }
52
53                 public override void ApplyAttributeBuilder (Attribute a,
54                                                             CustomAttributeBuilder cb)
55                 {
56                         throw new NotImplementedException ();
57                 }
58
59                 public override AttributeTargets AttributeTargets {
60                         get { throw new NotImplementedException (); }
61                 }
62
63                 public override string[] ValidAttributeTargets {
64                         get {
65                                 return new string [] { "type parameter" };
66                         }
67                 }
68
69                 public override string DocCommentHeader {
70                         get { throw new NotImplementedException (); }
71                 }
72
73                 //
74                 // IMemberContainer
75                 //
76
77                 Type IMemberContainer.Type {
78                         get { throw new NotImplementedException (); }
79                 }
80
81                 string IMemberContainer.Name {
82                         get { throw new NotImplementedException (); }
83                 }
84
85                 MemberCache IMemberContainer.BaseCache {
86                         get { throw new NotImplementedException (); }
87                 }
88
89                 bool IMemberContainer.IsInterface {
90                         get { throw new NotImplementedException (); }
91                 }
92
93                 MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
94                 {
95                         throw new NotImplementedException ();
96                 }
97
98                 MemberCache IMemberContainer.MemberCache {
99                         get { throw new NotImplementedException (); }
100                 }
101
102                 public bool IsSubclassOf (Type t)
103                 {
104                         throw new NotImplementedException ();
105                 }
106
107                 public MemberList FindMembers (MemberTypes mt, BindingFlags bf,
108                                                MemberFilter filter, object criteria)
109                 {
110                         throw new NotImplementedException ();
111                 }
112         }
113
114         public class TypeParameterExpr : TypeExpr
115         {
116                 public override string Name {
117                         get { throw new NotImplementedException (); }
118                 }
119
120                 public override string FullName {
121                         get { throw new NotImplementedException (); }
122                 }
123
124                 public TypeParameterExpr (TypeParameter type_parameter, Location loc)
125                 {
126                         throw new NotImplementedException ();
127                 }
128
129                 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
130                 {
131                         return null;
132                 }
133         }
134
135         public class TypeParameterName : SimpleName
136         {
137                 Attributes attributes;
138
139                 public TypeParameterName (string name, Attributes attrs, Location loc)
140                         : base (name, loc)
141                 {
142                         attributes = attrs;
143                 }
144
145                 public Attributes OptAttributes {
146                         get {
147                                 return attributes;
148                         }
149                 }
150         }
151
152         public abstract class GenericMethod : DeclSpace
153         {
154                 public GenericMethod (NamespaceEntry ns, DeclSpace parent, MemberName name,
155                                       Expression return_type, Parameters parameters)
156                         : base (ns, parent, name, null)
157                 {
158                         throw new NotImplementedException ();
159                 }
160         }
161
162         public abstract class TypeArguments
163         {
164                 public int Count {
165                         get { throw new NotImplementedException (); }
166                 }
167
168                 public bool IsUnbound {
169                         get { throw new NotImplementedException (); }
170                 }
171
172                 public TypeParameterName[] GetDeclarations ()
173                 {
174                         throw new NotImplementedException ();
175                 }
176         }
177 }