2006-09-25 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                 public bool IsReferenceType { 
23                         get { throw new NotSupportedException (); }
24                 }
25         }
26
27         public abstract class Constraints : GenericConstraints
28         {
29                 public abstract Location Location {
30                         get;
31                 }
32
33                 public abstract void VerifyClsCompliance ();
34         }
35
36         public class TypeParameter : MemberCore, IMemberContainer
37         {
38                 public TypeParameter (DeclSpace parent, DeclSpace decl, string name,
39                                       Constraints constraints, Attributes attrs, Location loc)
40                         : base (parent, new MemberName (name, loc), attrs)
41                 {
42                         throw new NotImplementedException ();
43                 }
44
45                 public static string GetSignatureForError (TypeParameter[] tp)
46                 {
47                         throw new NotImplementedException ();
48                 }
49
50                 //
51                 // MemberContainer
52                 //
53
54                 public override bool Define ()
55                 {
56                         return true;
57                 }
58
59                 public override void ApplyAttributeBuilder (Attribute a,
60                                                             CustomAttributeBuilder cb)
61                 {
62                         throw new NotImplementedException ();
63                 }
64
65                 public override AttributeTargets AttributeTargets {
66                         get { throw new NotImplementedException (); }
67                 }
68
69                 public override string[] ValidAttributeTargets {
70                         get {
71                                 return new string [] { "type parameter" };
72                         }
73                 }
74
75                 public Constraints Constraints {
76                         get {
77                                 return null;
78                         }
79                 }
80
81                 public override string DocCommentHeader {
82                         get { throw new NotImplementedException (); }
83                 }
84
85                 public bool Resolve (DeclSpace ds)
86                 {
87                         throw new NotImplementedException ();
88                 }
89
90                 public bool DefineType (IResolveContext ec)
91                 {
92                         throw new NotImplementedException ();
93                 }
94
95                 public bool DefineType (IResolveContext ec, MethodBuilder builder,
96                                         MethodInfo implementing, bool is_override)
97                 {
98                         throw new NotImplementedException ();
99                 }
100
101                 public bool CheckDependencies ()
102                 {
103                         throw new NotImplementedException ();
104                 }
105
106                 public bool UpdateConstraints (IResolveContext ec, Constraints new_constraints)
107                 {
108                         throw new NotImplementedException ();
109                 }
110
111                 //
112                 // IMemberContainer
113                 //
114
115                 Type IMemberContainer.Type {
116                         get { throw new NotImplementedException (); }
117                 }
118
119                 string IMemberContainer.Name {
120                         get { throw new NotImplementedException (); }
121                 }
122
123                 MemberCache IMemberContainer.BaseCache {
124                         get { throw new NotImplementedException (); }
125                 }
126
127                 bool IMemberContainer.IsInterface {
128                         get { throw new NotImplementedException (); }
129                 }
130
131                 MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
132                 {
133                         throw new NotImplementedException ();
134                 }
135
136                 MemberCache IMemberContainer.MemberCache {
137                         get { throw new NotImplementedException (); }
138                 }
139
140                 public bool IsSubclassOf (Type t)
141                 {
142                         throw new NotImplementedException ();
143                 }
144
145                 public MemberList FindMembers (MemberTypes mt, BindingFlags bf,
146                                                MemberFilter filter, object criteria)
147                 {
148                         throw new NotImplementedException ();
149                 }
150         }
151
152         public class TypeParameterExpr : TypeExpr
153         {
154                 public override string Name {
155                         get { throw new NotImplementedException (); }
156                 }
157
158                 public override string FullName {
159                         get { throw new NotImplementedException (); }
160                 }
161
162                 public TypeParameterExpr (TypeParameter type_parameter, Location loc)
163                 {
164                         throw new NotImplementedException ();
165                 }
166
167                 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
168                 {
169                         return null;
170                 }
171         }
172
173         public class TypeParameterName : SimpleName
174         {
175                 Attributes attributes;
176
177                 public TypeParameterName (string name, Attributes attrs, Location loc)
178                         : base (name, loc)
179                 {
180                         attributes = attrs;
181                 }
182
183                 public Attributes OptAttributes {
184                         get {
185                                 return attributes;
186                         }
187                 }
188         }
189
190         public class ConstructedType : TypeExpr
191         {
192                 public ConstructedType (FullNamedExpression fname, TypeArguments args, Location l)
193                 {
194                         throw new NotImplementedException ();
195                 }
196
197                 public ConstructedType (Type t, TypeParameter[] type_params, Location l)
198                 {
199                         throw new NotImplementedException ();
200                 }
201
202                 public ConstructedType (Type t, TypeArguments args, Location l)
203                 {
204                         throw new NotImplementedException ();
205                 }
206
207                 public override string Name {
208                         get { throw new NotImplementedException (); }
209                 }
210
211                 public override string FullName {
212                         get { throw new NotImplementedException (); }
213                 }
214
215                 protected override TypeExpr DoResolveAsTypeStep (IResolveContext ec)
216                 {
217                         throw new NotImplementedException ();
218                 }
219
220                 public bool CheckConstraints (IResolveContext ec)
221                 {
222                         throw new NotImplementedException ();
223                 }
224         }
225
226         public abstract class GenericMethod : DeclSpace
227         {
228                 public GenericMethod (NamespaceEntry ns, DeclSpace parent, MemberName name,
229                                       Expression return_type, Parameters parameters)
230                         : base (ns, parent, name, null)
231                 {
232                         throw new NotImplementedException ();
233                 }
234
235                 public bool DefineType (EmitContext ec, MethodBuilder mb,
236                                         MethodInfo implementing, bool is_override)
237                 {
238                         throw new NotImplementedException ();
239                 }
240
241                 public void EmitAttributes ()
242                 {
243                         throw new NotImplementedException ();
244                 }
245
246
247                 public new void VerifyClsCompliance ()
248                 {
249                         throw new NotImplementedException ();
250                 }
251         }
252
253         public class TypeArguments
254         {
255                 public TypeArguments (Location loc)
256                 {
257                         throw new NotImplementedException ();
258                 }
259
260                 public void Add (Expression type)
261                 {
262                         throw new NotImplementedException ();
263                 }
264
265                 public void Add (TypeArguments new_args)
266                 {
267                         throw new NotImplementedException ();
268                 }
269
270                 public bool Resolve (IResolveContext ec)
271                 {
272                         throw new NotImplementedException ();
273                 }
274
275                 public Type[] Arguments {
276                         get { throw new NotImplementedException (); }
277                 }
278
279                 public int Count {
280                         get { throw new NotImplementedException (); }
281                 }
282
283                 public bool IsUnbound {
284                         get { throw new NotImplementedException (); }
285                 }
286
287                 public TypeParameterName[] GetDeclarations ()
288                 {
289                         throw new NotImplementedException ();
290                 }
291         }
292 }