2001-11-14 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
2
3         * support.cs (ReflectionParameters.ParameterModifier): Report
4         whether the argument is a PARAMS argument or not.
5
6         * class.cs: Set the attribute `ParamArrayAttribute' on the
7         parameter argument.
8
9         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
10         and cons_param_array_attribute (ConstructorInfo for
11         ParamArrayAttribute)., 
12
13         * codegen.cs: Emit the return using the `Return' statement, that
14         way we can report the error correctly for missing return values. 
15
16         * class.cs (Method.Emit): Clean up.
17
18         * expression.cs (Argument.Resolve): Take another argument: the
19         location where this argument is used.  Notice that this is not
20         part of the "Argument" class as to reduce the size of the
21         structure (we know the approximate location anyways).
22
23         Test if the argument is a variable-reference, if not, then
24         complain with a 206.
25
26         (Argument.Emit): Emit addresses of variables.
27
28         (Argument.FullDesc): Simplify.
29
30         (Invocation.DoResolve): Update for Argument.Resolve.
31
32         (ElementAccess.DoResolve): ditto.
33
34         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
35         method should be virtual, as this method is always virtual.
36
37         (NewDelegate.DoResolve): Update for Argument.Resolve.
38
39         * class.cs (ConstructorInitializer.DoResolve): ditto.
40         
41         * attribute.cs (Attribute.Resolve): ditto.
42
43 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
44
45         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
46
47         * expression.cs (ParameterReference): Drop IStackStorage and implement
48         IAssignMethod instead. 
49
50         (LocalVariableReference): ditto.
51         
52         * ecore.cs (FieldExpr): Drop IStackStorage and implement
53         IAssignMethod instead. 
54
55 2001-11-13  Miguel de Icaza <miguel@ximian.com>
56
57         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
58         enumerations that are used in heavily used structures derive from
59         byte in a laughable and pathetic attempt to reduce memory usage.
60         This is the kind of pre-optimzations that you should not do at
61         home without adult supervision.
62
63         * expression.cs (UnaryMutator): New class, used to handle ++ and
64         -- separatedly from the other unary operators.  Cleans up the
65         code, and kills the ExpressionStatement dependency in Unary.
66
67         (Unary): Removed `method' and `Arguments' from this class, making
68         it smaller, and moving it all to SimpleCall, so I can reuse this
69         code in other locations and avoid creating a lot of transient data
70         strucutres when not required.
71
72         * cs-parser.jay: Adjust for new changes.
73
74 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
75
76         * enum.cs (Enum.Populate): If there is a failure during
77         definition, return
78
79         * cs-parser.jay (opt_enum_base): we used to catch type errors
80         here, but this is really incorrect.  The type error should be
81         catched during semantic analysis.
82
83 2001-12-11  Ravi Pratap  <ravi@ximian.com>
84
85         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
86         current_local_parameters as expected since I, in my stupidity, had forgotten
87         to do this :-)
88
89         * attribute.cs (GetValidPlaces): Fix stupid bug.
90
91         * class.cs (Method::Emit): Perform check on applicability of attributes.
92
93         (Constructor::Emit): Ditto.
94
95         (Field::Emit): Ditto.
96
97         (Field.Location): Store location information.
98
99         (Property, Event, Indexer, Operator): Ditto.
100
101         * cs-parser.jay (field_declaration): Pass in location for each field.
102
103         * ../errors/cs0592.cs : Add.
104
105 2001-11-12  Ravi Pratap  <ravi@ximian.com>
106
107         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
108
109         (InitCoreTypes): Update accordingly.
110
111         (RegisterAttrType, LookupAttr): Implement.
112
113         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
114         info about the same.
115
116         (Resolve): Update to populate the above as necessary.
117
118         (Error592): Helper.
119
120         (GetValidPlaces): Helper to the above.
121
122         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
123
124         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
125
126 2001-11-12  Ravi Pratap  <ravi@ximian.com>
127
128         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
129
130         * ../errors/cs0617.cs : Add.
131
132 2001-11-11  Ravi Pratap  <ravi@ximian.com>
133
134         * enum.cs (Emit): Rename to Populate to be more consistent with what
135         we expect it to do and when exactly it is called.
136
137         * class.cs, rootcontext.cs : Update accordingly.
138
139         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
140         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
141
142         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
143
144         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
145         of a fieldinfo using the above, when dealing with a FieldBuilder.
146
147 2001-11-10  Ravi Pratap  <ravi@ximian.com>
148
149         * ../errors/cs0031.cs : Add.
150
151         * ../errors/cs1008.cs : Add.
152
153         * ../errrors/cs0543.cs : Add.
154
155         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
156         enum type.
157
158         (FindMembers): Implement.
159
160         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
161         enums and delegates too.
162
163         (enum_types): Rename to builder_to_enum.
164
165         (delegate_types): Rename to builder_to_delegate.
166
167         * delegate.cs (FindMembers): Implement.
168
169 2001-11-09  Ravi Pratap  <ravi@ximian.com>
170
171         * typemanager.cs (IsEnumType): Implement.
172
173         * enum.cs (Emit): Re-write parts to account for the underlying type
174         better and perform checking etc.
175
176         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
177         of the underlying type.
178
179         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
180         value
181
182         * enum.cs (error31): Helper to report error #31.
183
184         * cs-parser.jay (enum_declaration): Store location of each member too.
185
186         * enum.cs (member_to_location): New hashtable. 
187
188         (AddEnumMember): Update location hashtable.
189
190         (Emit): Use the location of each member while reporting errors.
191
192 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
193
194         * cs-parser.jay: A for_initializer if is a
195         local_variable_declaration really ammount to have an implicit
196         block with the variable declaration and no initializer for for.
197
198         * statement.cs (For.Emit): Cope with null initializers.
199
200         This fixes the infinite loop on for initializers.
201
202 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
203
204         * enum.cs: More cleanup.
205
206         * ecore.cs: Remove dead code.
207
208         * class.cs (Property.Emit): More simplification.
209         (Event.Emit): ditto.
210
211         Reworked to have less levels of indentation.
212         
213 2001-11-08  Ravi Pratap  <ravi@ximian.com>
214
215         * class.cs (Property): Emit attributes.
216
217         (Field): Ditto.
218         
219         (Event): Ditto.
220
221         (Indexer): Ditto.
222
223         (Operator): Ditto.
224
225         * enum.cs (Emit): Ditto.
226
227         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
228         Enums too.
229
230         * class.cs (Field, Event, etc.): Move attribute generation into the
231         Emit method everywhere.
232
233         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
234         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
235         as we had no way of defining nested enums !
236
237         * rootcontext.cs : Adjust code accordingly.
238
239         * typemanager.cs (AddEnumType): To keep track of enum types separately.
240
241 2001-11-07  Ravi Pratap  <ravi@ximian.com>
242
243         * expression.cs (EvalConstantExpression): Move into ecore.cs
244         
245         * enum.cs (Enum): Rename some members and make them public and readonly
246         according to our convention.
247
248         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
249         nothing else.
250
251         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
252
253         (Enum::Emit): Write a simple version for now which doesn't try to compute
254         expressions. I shall modify this to be more robust in just a while.
255
256         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
257
258         (TypeContainer::CloseType): Create the Enum types too.
259
260         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
261
262         * expression.cs (EvalConstantExpression): Get rid of completely.
263
264         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
265         user-defined values and other cases.
266
267         (IsValidEnumLiteral): Helper function.
268
269         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
270         out there in the case we had a literal FieldExpr.
271
272         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
273
274         (Literalize): Revamp a bit to take two arguments.
275         
276         (EnumLiteral): New class which derives from Literal to wrap enum literals.
277         
278 2001-11-06  Ravi Pratap  <ravi@ximian.com>
279
280         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
281
282         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
283
284         (Resolve): Use the above to ensure we have proper initializers.
285
286 2001-11-05  Ravi Pratap  <ravi@ximian.com>
287
288         * expression.cs (Expression::EvalConstantExpression): New method to 
289         evaluate constant expressions.
290
291         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
292
293 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
294
295         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
296         in an array.
297
298         (Binary.ResolveOperator): Handle operator != (object a, object b)
299         and operator == (object a, object b);
300
301         (Binary.DoNumericPromotions): Indicate whether the numeric
302         promotion was possible.
303
304         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
305         Implement.  
306
307         Made the ArrayAccess implement interface IAssignMethod instead of
308         IStackStore as the order in which arguments are passed reflects
309         this.
310
311         * assign.cs: Instead of using expr.ExprClass to select the way of
312         assinging, probe for the IStackStore/IAssignMethod interfaces.
313
314         * typemanager.cs: Load InitializeArray definition.
315
316         * rootcontext.cs (RootContext.MakeStaticData): Used to define
317         static data that can be used to initialize arrays. 
318
319 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
320
321         * expression.cs: Handle operator== and operator!= for booleans.
322
323         (Conditioal.Reduce): Implement reducer for the ?: operator.
324
325         (Conditional.Resolve): Implement dead code elimination.
326
327         (Binary.Resolve): Catch string literals and return a new
328         concatenated string.
329
330         (Unary.Reduce): Implement reduction of unary expressions.
331
332         * ecore.cs: Split out the expression core handling here.
333
334         (Expression.Reduce): New method used to perform constant folding
335         and CSE.  This is needed to support constant-expressions. 
336         
337         * statement.cs (Statement.EmitBoolExpression): Pass true and false
338         targets, and optimize for !x.
339
340 2001-11-04  Ravi Pratap  <ravi@ximian.com>
341
342         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
343         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
344         set custom atttributes.
345
346         * literal.cs (Literal::GetValue): New abstract method to return the actual
347         value of the literal, cast as an object.
348
349         (*Literal): Implement GetValue method.
350
351         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
352         expressions to the arraylist but objects of type Argument.
353
354         * class.cs (TypeContainer::Emit): Emit our attributes too.
355
356         (Method::Emit, Constructor::Emit): Ditto.
357
358         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
359         to be ignoring earlier.
360
361 2001-11-03  Ravi Pratap  <ravi@ximian.com>
362
363         * attribute.cs (AttributeSection::Define): Implement to do the business
364         of constructing a CustomAttributeBuilder.
365
366         (Attribute): New trivial class. Increases readability of code.  
367
368         * cs-parser.jay : Update accordingly.
369
370         (positional_argument_list, named_argument_list, named_argument): New rules
371
372         (attribute_arguments): Use the above so that we are more correct.
373         
374 2001-11-02  Ravi Pratap  <ravi@ximian.com>
375         
376         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
377         to perform all checks for a method with a params parameter.
378
379         (Invocation::OverloadResolve): Update to use the above method and therefore
380         cope correctly with params method invocations.
381
382         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
383         params too.
384
385         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
386         constructors in our parent too because we can't afford to miss out on 
387         protected ones ;-)
388
389         * attribute.cs (AttributeSection): New name for the class Attribute
390
391         Other trivial changes to improve readability.
392
393         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
394         use the new class names.
395         
396 2001-11-01  Ravi Pratap  <ravi@ximian.com>
397
398         * class.cs (Method::Define): Complete definition for params types too
399
400         (Indexer::Define): Ditto.
401
402         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
403         Cope everywhere with a request for info about the array parameter.
404
405 2001-11-01  Ravi Pratap  <ravi@ximian.com>
406
407         * tree.cs (RecordNamespace): Fix up to check for the correct key.
408
409         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
410         local_variable_type to extract the string corresponding to the type.
411
412         (local_variable_type): Fixup the action to use the new helper method.
413
414         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
415         go.
416
417         * expression.cs : Clean out code which uses the above.
418
419 2001-10-31  Ravi Pratap  <ravi@ximian.com>
420         
421         * typemanager.cs (RegisterMethod): Check if we already have an existing key
422         and bale out if necessary by returning a false.
423
424         (RegisterProperty): Ditto.
425
426         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
427         and print out appropriate error messages.
428
429         * interface.cs (everywhere): Ditto.
430
431         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
432         location to constructor.
433
434         * class.cs (Property, Event, Indexer): Update accordingly.
435
436         * ../errors/cs111.cs : Added.
437
438         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
439         of a method, as laid down by the spec.
440
441         (Invocation::OverloadResolve): Use the above method.
442
443 2001-10-31  Ravi Pratap  <ravi@ximian.com>
444
445         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
446         now take a TypeContainer and a Parameters object.
447
448         (ParameterData): Modify return type of ParameterModifier method to be 
449         Parameter.Modifier and not a string.
450
451         (ReflectionParameters, InternalParameters): Update accordingly.
452
453         * expression.cs (Argument::GetParameterModifier): Same here.
454
455         * support.cs (InternalParameters::ParameterType): Find a better way of determining
456         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
457         symbol in it at all so maybe this is only for now.
458
459 2001-10-30  Ravi Pratap  <ravi@ximian.com>
460
461         * support.cs (InternalParameters): Constructor now takes an extra argument 
462         which is the actual Parameters class.
463
464         (ParameterDesc): Update to provide info on ref/out modifiers.
465
466         * class.cs (everywhere): Update call to InternalParameters to pass in
467         the second argument too.
468
469         * support.cs (ParameterData): Add ParameterModifier, which is a method 
470         to return the modifier info [ref/out etc]
471
472         (InternalParameters, ReflectionParameters): Implement the above.
473
474         * expression.cs (Argument::ParameterModifier): Similar function to return
475         info about the argument's modifiers.
476
477         (Invocation::OverloadResolve): Update to take into account matching modifiers 
478         too.
479
480         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
481         a new SetFormalParameters object which we pass to InternalParameters.
482
483 2001-10-30  Ravi Pratap  <ravi@ximian.com>
484
485         * expression.cs (NewArray): Merge into the ArrayCreation class.
486
487 2001-10-29  Ravi Pratap  <ravi@ximian.com>
488
489         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
490         NewUserdefinedArray into one as there wasn't much of a use in having
491         two separate ones.
492
493         * expression.cs (Argument): Change field's name to ArgType from Type.
494
495         (Type): New readonly property which returns the proper type, taking into 
496         account ref/out modifiers.
497
498         (everywhere): Adjust code accordingly for the above.
499
500         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
501         whether we are emitting for a ref or out parameter.
502
503         * expression.cs (Argument::Emit): Use the above field to set the state.
504
505         (LocalVariableReference::Emit): Update to honour the flag and emit the
506         right stuff.
507
508         * parameter.cs (Attributes): Set the correct flags for ref parameters.
509
510         * expression.cs (Argument::FullDesc): New function to provide a full desc.
511
512         * support.cs (ParameterData): Add method ParameterDesc to the interface.
513
514         (ReflectionParameters, InternalParameters): Implement the above method.
515
516         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
517         reporting errors.
518
519         (Invocation::FullMethodDesc): Ditto. 
520
521 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
522
523         * cs-parser.jay: Add extra production for the second form of array
524         creation. 
525
526         * expression.cs (ArrayCreation): Update to reflect the above
527         change. 
528
529         * Small changes to prepare for Array initialization.
530
531 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
532
533         * typemanager.cs (ImplementsInterface): interface might be null;
534         Deal with this problem;
535
536         Also, we do store negative hits on the cache (null values), so use
537         this instead of calling t.GetInterfaces on the type everytime.
538
539 2001-10-28  Ravi Pratap  <ravi@ximian.com>
540
541         * typemanager.cs (IsBuiltinType): New method to help determine the same.
542
543         * expression.cs (New::DoResolve): Get rid of array creation code and instead
544         split functionality out into different classes.
545
546         (New::FormArrayType): Move into NewBuiltinArray.
547
548         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
549         quite useless.
550
551         (NewBuiltinArray): New class to handle creation of built-in arrays.
552
553         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
554         account creation of one-dimensional arrays.
555
556         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
557
558         (NewUserdefinedArray::DoResolve): Implement.
559
560         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
561
562         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
563         we maintain inside the TypeManager. This is necessary to perform lookups on the
564         module builder.
565
566         (LookupType): Update to perform GetType on the module builders too.     
567
568         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
569
570         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
571
572 2001-10-23  Ravi Pratap  <ravi@ximian.com>
573
574         * expression.cs (New::DoResolve): Implement guts of array creation.
575
576         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
577         
578 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
579
580         * expression.cs: Fix bug I introduced lsat night that broke
581         Delegates. 
582
583         (Expression.Resolve): Report a 246 error (can not resolve name)
584         if we find a SimpleName in the stream.
585         
586         (Expression.ResolveLValue): Ditto.
587         
588         (Expression.ResolveWithSimpleName): This function is a variant of
589         ResolveName, this one allows SimpleNames to be returned without a
590         warning.  The only consumer of SimpleNames is MemberAccess
591
592 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
593
594         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
595         might arrive here.  I have my doubts that this is correct.
596
597         * statement.cs (Lock): Implement lock statement.
598
599         * cs-parser.jay: Small fixes to support `lock' and `using'
600
601         * cs-tokenizer.cs: Remove extra space
602
603         * driver.cs: New flag --checked, allows to turn on integer math
604         checking. 
605
606         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
607         Threading.Monitor.Exit 
608         
609 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
610
611         * expression.cs (IndexerAccess::DoResolveLValue): Set the
612         Expression Class to be IndexerAccess.
613
614         Notice that Indexer::DoResolve sets the eclass to Value.
615
616 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
617
618         * class.cs (TypeContainer::Emit): Emit code for indexers.
619
620         * assign.cs (IAssignMethod): New interface implemented by Indexers
621         and Properties for handling assignment.
622
623         (Assign::Emit): Simplify and reuse code. 
624         
625         * expression.cs (IndexerAccess, PropertyExpr): Implement
626         IAssignMethod, clean up old code. 
627
628 2001-10-22  Ravi Pratap  <ravi@ximian.com>
629
630         * typemanager.cs (ImplementsInterface): New method to determine if a type
631         implements a given interface. Provides a nice cache too.
632
633         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
634         method.
635
636         (ConvertReferenceExplicit): Ditto.
637
638         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
639         various methods, with correct names etc.
640
641         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
642         Operator.UnaryNegation.
643
644         * cs-parser.jay (operator_declarator): Be a little clever in the case where
645         we have a unary plus or minus operator.
646
647         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
648         UnaryMinus.
649
650         * everywhere : update accordingly.
651
652         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
653         respectively.
654
655         * class.cs (Method::Define): For the case where we are implementing a method
656         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
657         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
658         
659 2001-10-21  Ravi Pratap  <ravi@ximian.com>
660
661         * interface.cs (FindMembers): Implement to work around S.R.E
662         lameness.
663
664         * typemanager.cs (IsInterfaceType): Implement.
665
666         (FindMembers): Update to handle interface types too.
667
668         * expression.cs (ImplicitReferenceConversion): Re-write bits which
669         use IsAssignableFrom as that is not correct - it doesn't work.
670
671         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
672         and accordingly override EmitStatement.
673
674         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
675         using the correct logic :-)
676
677 2001-10-19  Ravi Pratap  <ravi@ximian.com>
678
679         * ../errors/cs-11.cs : Add to demonstrate error -11 
680
681 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
682
683         * assign.cs (Assign::Resolve): Resolve right hand side first, and
684         then pass this as a hint to ResolveLValue.
685         
686         * expression.cs (FieldExpr): Add Location information
687
688         (FieldExpr::LValueResolve): Report assignment to readonly
689         variable. 
690         
691         (Expression::ExprClassFromMemberInfo): Pass location information.
692
693         (Expression::ResolveLValue): Add new method that resolves an
694         LValue. 
695
696         (Expression::DoResolveLValue): Default invocation calls
697         DoResolve. 
698
699         (Indexers): New class used to keep track of indexers in a given
700         Type. 
701
702         (IStackStore): Renamed from LValue, as it did not really describe
703         what this did.  Also ResolveLValue is gone from this interface and
704         now is part of Expression.
705
706         (ElementAccess): Depending on the element access type
707         
708         * typemanager.cs: Add `indexer_name_type' as a Core type
709         (System.Runtime.CompilerServices.IndexerNameAttribute)
710
711         * statement.cs (Goto): Take a location.
712         
713 2001-10-18  Ravi Pratap  <ravi@ximian.com>
714
715         * delegate.cs (Delegate::VerifyDelegate): New method to verify
716         if two delegates are compatible.
717
718         (NewDelegate::DoResolve): Update to take care of the case when
719         we instantiate a delegate from another delegate.
720
721         * typemanager.cs (FindMembers): Don't even try to look up members
722         of Delegate types for now.
723
724 2001-10-18  Ravi Pratap  <ravi@ximian.com>
725
726         * delegate.cs (NewDelegate): New class to take care of delegate
727         instantiation.
728
729         * expression.cs (New): Split the delegate related code out into 
730         the NewDelegate class.
731
732         * delegate.cs (DelegateInvocation): New class to handle delegate 
733         invocation.
734
735         * expression.cs (Invocation): Split out delegate related code into
736         the DelegateInvocation class.
737
738 2001-10-17  Ravi Pratap  <ravi@ximian.com>
739
740         * expression.cs (New::DoResolve): Implement delegate creation fully
741         and according to the spec.
742
743         (New::DoEmit): Update to handle delegates differently.
744
745         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
746         because of which we were printing out arguments in reverse order !
747
748         * delegate.cs (VerifyMethod): Implement to check if the given method
749         matches the delegate.
750
751         (FullDelegateDesc): Implement.
752
753         (VerifyApplicability): Implement.
754
755         * expression.cs (Invocation::DoResolve): Update to accordingly handle
756         delegate invocations too.
757
758         (Invocation::Emit): Ditto.
759
760         * ../errors/cs1593.cs : Added.
761
762         * ../errors/cs1594.cs : Added.
763
764         * delegate.cs (InstanceExpression, TargetMethod): New properties.
765
766 2001-10-16  Ravi Pratap  <ravi@ximian.com>
767
768         * typemanager.cs (intptr_type): Core type for System.IntPtr
769
770         (InitCoreTypes): Update for the same.
771
772         (iasyncresult_type, asynccallback_type): Ditto.
773
774         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
775         correct.
776
777         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
778         too.
779
780         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
781         the builders for the 4 members of a delegate type :-)
782
783         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
784         type.
785
786         * expression.cs (New::DoResolve): Implement guts for delegate creation.
787
788         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
789
790 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
791
792         * statement.cs (Break::Emit): Implement.   
793         (Continue::Emit): Implement.
794
795         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
796         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
797         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
798         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
799         end loop
800         
801         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
802         properties that track the label for the current loop (begin of the
803         loop and end of the loop).
804
805 2001-10-15  Ravi Pratap  <ravi@ximian.com>
806
807         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
808         use of emitting anything at all.
809
810         * class.cs, rootcontext.cs : Get rid of calls to the same.
811
812         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
813
814         (Populate): Define the constructor correctly and set the implementation
815         attributes.
816
817         * typemanager.cs (delegate_types): New hashtable to hold delegates that
818         have been defined.
819
820         (AddDelegateType): Implement.
821
822         (IsDelegateType): Implement helper method.
823
824         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
825
826         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
827         and accordingly handle it.
828
829         * delegate.cs (Populate): Take TypeContainer argument.
830         Implement bits to define the Invoke method. However, I still haven't figured out
831         how to take care of the native int bit :-(
832
833         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
834         Qualify the name of the delegate, not its return type !
835
836         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
837         conversion.
838
839         (StandardConversionExists): Checking for array types turns out to be recursive.
840
841         (ConvertReferenceExplicit): Implement array conversion.
842
843         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
844         
845 2001-10-12  Ravi Pratap  <ravi@ximian.com>
846
847         * cs-parser.jay (delegate_declaration): Store the fully qualified
848         name as it is a type declaration.
849
850         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
851         readonly.
852
853         (DefineDelegate): Renamed from Define. Does the same thing essentially,
854         as TypeContainer::DefineType.
855
856         (Populate): Method in which all the definition of the various methods (Invoke)
857         etc is done.
858
859         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
860         see.
861         
862         (CloseDelegate): Finally creates the delegate.
863
864         * class.cs (TypeContainer::DefineType): Update to define delegates.
865         (Populate, Emit and CloseType): Do the same thing here too.
866
867         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
868         delegates in all these operations.
869
870 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
871
872         * expression.cs: LocalTemporary: a new expression used to
873         reference a temporary that has been created.
874
875         * assign.cs: Handle PropertyAccess back here, so that we can
876         provide the proper semantic access to properties.
877
878         * expression.cs (Expression::ConvertReferenceExplicit): Implement
879         a few more explicit conversions. 
880
881         * modifiers.cs: `NEW' modifier maps to HideBySig.
882
883         * expression.cs (PropertyExpr): Make this into an
884         ExpressionStatement, and support the EmitStatement code path. 
885
886         Perform get/set error checking, clean up the interface.
887
888         * assign.cs: recognize PropertyExprs as targets, and if so, turn
889         them into toplevel access objects.
890
891 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
892
893         * expression.cs: PropertyExpr::PropertyExpr: use work around the
894         SRE.
895
896         * typemanager.cs: Keep track here of our PropertyBuilders again to
897         work around lameness in SRE.
898
899 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
900
901         * expression.cs (LValue::LValueResolve): New method in the
902         interface, used to perform a second resolution pass for LValues. 
903         
904         (This::DoResolve): Catch the use of this in static methods.
905
906         (This::LValueResolve): Implement.
907
908         (This::Store): Remove warning, assigning to `this' in structures
909         is 
910
911         (Invocation::Emit): Deal with invocation of
912         methods on value types.  We need to pass the address to structure
913         methods rather than the object itself.  (The equivalent code to
914         emit "this" for structures leaves the entire structure on the
915         stack instead of a pointer to it). 
916
917         (ParameterReference::DoResolve): Compute the real index for the
918         argument based on whether the method takes or not a `this' pointer
919         (ie, the method is static).
920
921         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
922         value types returned from functions when we need to invoke a
923         method on the sturcture.
924         
925
926 2001-10-11  Ravi Pratap  <ravi@ximian.com>
927
928         * class.cs (TypeContainer::DefineType): Method to actually do the business of
929         defining the type in the Modulebuilder or Typebuilder. This is to take
930         care of nested types which need to be defined on the TypeBuilder using
931         DefineNestedMethod.
932
933         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
934         methods in RootContext, only ported to be part of TypeContainer.
935
936         (TypeContainer::GetInterfaceOrClass): Ditto.
937
938         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
939
940         * interface.cs (Interface::DefineInterface): New method. Does exactly
941         what RootContext.CreateInterface did earlier, only it takes care of nested types 
942         too.
943
944         (Interface::GetInterfaces): Move from RootContext here and port.
945
946         (Interface::GetInterfaceByName): Same here.
947
948         * rootcontext.cs (ResolveTree): Re-write.
949
950         (PopulateTypes): Re-write.
951
952         * class.cs (TypeContainer::Populate): Populate nested types too.
953         (TypeContainer::Emit): Emit nested members too.
954
955         * typemanager.cs (AddUserType): Do not make use of the FullName property,
956         instead just use the name argument passed in as it is already fully
957         qualified.
958
959         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
960         to TypeContainer mapping to see if a type is user-defined.
961
962         * class.cs (TypeContainer::CloseType): Implement. 
963
964         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
965         the default constructor.
966         
967         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
968         twice.
969
970         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
971
972         * interface.cs (CloseType): Create the type here.
973         
974         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
975         the hierarchy.
976
977         Remove all the methods which are now in TypeContainer.
978
979 2001-10-10  Ravi Pratap  <ravi@ximian.com>
980
981         * delegate.cs (Define): Re-write bits to define the delegate
982         correctly.
983
984 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
985
986         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
987
988         * expression.cs (ImplicitReferenceConversion): handle null as well
989         as a source to convert to any reference type.
990
991         * statement.cs (Return): Perform any implicit conversions to
992         expected return type.  
993
994         Validate use of return statement.  
995
996         * codegen.cs (EmitContext): Pass the expected return type here.
997
998         * class.cs (Method, Constructor, Property): Pass expected return
999         type to EmitContext.
1000
1001 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
1002
1003         * expression.cs: Make DoResolve take an EmitContext instead of a
1004         TypeContainer.
1005
1006         Replaced `l' and `location' for `loc', for consistency.
1007         
1008         (Error, Warning): Remove unneeded Tc argument.
1009
1010         * assign.cs, literal.cs, constant.cs: Update to new calling
1011         convention. 
1012         
1013         * codegen.cs: EmitContext now contains a flag indicating whether
1014         code is being generated in a static method or not.
1015
1016         * cs-parser.jay: DecomposeQI, new function that replaces the old
1017         QualifiedIdentifier.  Now we always decompose the assembled
1018         strings from qualified_identifier productions into a group of
1019         memberaccesses.
1020
1021 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
1022
1023         * rootcontext.cs: Deal with field-less struct types correctly now
1024         by passing the size option to Define Type.
1025
1026         * class.cs: Removed hack that created one static field. 
1027
1028 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
1029
1030         * statement.cs: Moved most of the code generation here. 
1031
1032 2001-10-09  Ravi Pratap  <ravi@ximian.com>
1033
1034         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
1035         seem very right.
1036
1037         (ElementAccess): Remove useless bits for now - keep checks as the spec
1038         says.
1039
1040 2001-10-08  Ravi Pratap  <ravi@ximian.com>
1041
1042         * expression.cs (ElementAccess::DoResolve): Remove my crap code
1043         and start performing checks according to the spec.
1044
1045 2001-10-07  Ravi Pratap  <ravi@ximian.com>
1046
1047         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
1048         rank_specifiers instead.
1049
1050         (rank_specifiers): Change the order in which the rank specifiers are stored
1051
1052         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
1053
1054         * expression.cs (ElementAccess): Implement the LValue interface too.
1055         
1056 2001-10-06  Ravi Pratap  <ravi@ximian.com>
1057         
1058         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
1059         except that user defined conversions are not included.
1060
1061         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
1062         perform the conversion of the return type, if necessary.
1063
1064         (New::DoResolve): Check whether we are creating an array or an object
1065         and accordingly do the needful.
1066
1067         (New::Emit): Same here.
1068
1069         (New::DoResolve): Implement guts of array creation.
1070
1071         (New::FormLookupType): Helper function.
1072
1073 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
1074
1075         * codegen.cs: Removed most of the code generation here, and move the
1076         corresponding code generation bits to the statement classes. 
1077
1078         Added support for try/catch/finalize and throw.
1079         
1080         * cs-parser.jay: Added support for try/catch/finalize.
1081
1082         * class.cs: Catch static methods having the flags override,
1083         virtual or abstract.
1084
1085         * expression.cs (UserCast): This user cast was not really doing
1086         what it was supposed to do.  Which is to be born in fully resolved
1087         state.  Parts of the resolution were being performed at Emit time! 
1088
1089         Fixed this code.
1090
1091 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
1092
1093         * expression.cs: Implicity convert the result from UserCast.
1094
1095 2001-10-05  Ravi Pratap  <ravi@ximian.com>
1096
1097         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
1098         prevented it from working correctly. 
1099
1100         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
1101         merely ConvertImplicit.
1102
1103 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
1104
1105         * typemanager.cs: Make the LookupTypeContainer function static,
1106         and not per-instance.  
1107
1108         * class.cs: Make static FindMembers (the one that takes a Type
1109         argument). 
1110
1111         * codegen.cs: Add EmitForeach here.
1112
1113         * cs-parser.jay: Make foreach a toplevel object instead of the
1114         inline expansion, as we need to perform semantic analysis on it. 
1115
1116 2001-10-05  Ravi Pratap  <ravi@ximian.com>
1117
1118         * expression.cs (Expression::ImplicitUserConversion): Rename to
1119         UserDefinedConversion.
1120
1121         (Expression::UserDefinedConversion): Take an extra argument specifying 
1122         whether we look for explicit user conversions too.
1123
1124         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
1125
1126         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
1127
1128         (ExplicitUserConversion): Make it a call to UserDefinedConversion
1129         with the appropriate arguments.
1130
1131         * cs-parser.jay (cast_expression): Record location too.
1132
1133         * expression.cs (Cast): Record location info.
1134
1135         (Expression::ConvertExplicit): Take location argument.
1136
1137         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
1138         to determine if we are doing explicit conversions.
1139
1140         (UserCast::Emit): Update accordingly.
1141
1142         (Expression::ConvertExplicit): Report an error if everything fails.
1143
1144         * ../errors/cs0030.cs : Add.
1145
1146 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
1147
1148         * modifiers.cs: If the ABSTRACT keyword is present, also set the
1149         virtual and newslot bits. 
1150
1151         * class.cs (TypeContainer::RegisterRequiredImplementations):
1152         Record methods we need.
1153
1154         (TypeContainer::MakeKey): Helper function to make keys for
1155         MethodBases, since the Methodbase key is useless.
1156
1157         (TypeContainer::Populate): Call RegisterRequiredImplementations
1158         before defining the methods.   
1159
1160         Create a mapping for method_builders_to_methods ahead of time
1161         instead of inside a tight loop.
1162
1163         (::RequireMethods):  Accept an object as the data to set into the
1164         hashtable so we can report interface vs abstract method mismatch.
1165
1166 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
1167
1168         * report.cs: Make all of it static.
1169
1170         * rootcontext.cs: Drop object_type and value_type computations, as
1171         we have those in the TypeManager anyways.
1172
1173         Drop report instance variable too, now it is a global.
1174
1175         * driver.cs: Use try/catch on command line handling.
1176
1177         Add --probe option to debug the error reporting system with a test
1178         suite. 
1179
1180         * report.cs: Add support for exiting program when a probe
1181         condition is reached.
1182
1183 2001-10-03  Ravi Pratap  <ravi@ximian.com>
1184
1185         * expression.cs (Binary::DoNumericPromotions): Fix the case when
1186         we do a forcible conversion regardless of type, to check if 
1187         ForceConversion returns a null.
1188
1189         (Binary::error19): Use location to report error.
1190
1191         (Unary::error23): Use location here too.
1192
1193         * ../errors/cs0019.cs : Check in.
1194
1195         * ../errors/cs0023.cs : Check in.
1196
1197         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
1198         case of a non-null MethodInfo object with a length of 0 !
1199
1200         (Binary::ResolveOperator): Flag error if overload resolution fails to find
1201         an applicable member - according to the spec :-)
1202         Also fix logic to find members in base types.
1203
1204         (Unary::ResolveOperator): Same here.
1205
1206         (Unary::report23): Change name to error23 and make first argument a TypeContainer
1207         as I was getting thoroughly confused between this and error19 :-)
1208         
1209         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
1210         (::FindMostEncompassedType): Implement.
1211         (::FindMostEncompassingType): Implement.
1212         (::StandardConversionExists): Implement.
1213
1214         (UserImplicitCast): Re-vamp. We now need info about most specific
1215         source and target types so that we can do the necessary conversions.
1216
1217         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
1218         mathematical union with no duplicates.
1219
1220 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
1221
1222         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
1223         in order from base classes to child classes, so that we can in
1224         child classes look up in our parent for method names and
1225         attributes (required for handling abstract, virtual, new, override
1226         constructs: we need to instrospect our base class, and if we dont
1227         populate the classes in order, the introspection might be
1228         incorrect.  For example, a method could query its parent before
1229         the parent has any methods and would determine that the parent has
1230         no abstract methods (while it could have had them)).
1231
1232         (RootContext::CreateType): Record the order in which we define the
1233         classes.
1234
1235 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
1236
1237         * class.cs (TypeContainer::Populate): Also method definitions can
1238         fail now, keep track of this.
1239
1240         (TypeContainer::FindMembers): Implement support for
1241         DeclaredOnly/noDeclaredOnly flag.
1242
1243         (Constructor::Emit) Return the ConstructorBuilder.
1244
1245         (Method::Emit) Return the MethodBuilder. 
1246         Check for abstract or virtual methods to be public.
1247
1248         * rootcontext.cs (RootContext::CreateType): Register all the
1249         abstract methods required for the class to be complete and the
1250         interface methods that must be implemented. 
1251
1252         * cs-parser.jay: Report error 501 (method requires body if it is
1253         not marked abstract or extern).
1254
1255         * expression.cs (TypeOf::Emit): Implement.
1256
1257         * typemanager.cs: runtime_handle_type, new global type.
1258
1259         * class.cs (Property::Emit): Generate code for properties.
1260
1261 2001-10-02  Ravi Pratap  <ravi@ximian.com>
1262
1263         * expression.cs (Unary::ResolveOperator): Find operators on base type
1264         too - we now conform exactly to the spec.
1265
1266         (Binary::ResolveOperator): Same here.
1267
1268         * class.cs (Operator::Define): Fix minor quirk in the tests.
1269
1270         * ../errors/cs0215.cs : Added.
1271
1272         * ../errors/cs0556.cs : Added.
1273
1274         * ../errors/cs0555.cs : Added.
1275
1276 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
1277
1278         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
1279         single integer which is really efficient
1280
1281 2001-10-01  Ravi Pratap  <ravi@ximian.com>
1282
1283         *  expression.cs (Expression::ImplicitUserConversion): Use location
1284         even in the case when we are examining True operators.
1285  
1286         * class.cs (Operator::Define): Perform extensive checks to conform
1287         with the rules for operator overloading in the spec.
1288
1289         * expression.cs (Expression::ImplicitReferenceConversion): Implement
1290         some of the other conversions mentioned in the spec.
1291
1292         * typemanager.cs (array_type): New static member for the System.Array built-in
1293         type.
1294
1295         (cloneable_interface): For System.ICloneable interface.
1296
1297         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
1298         we start resolving the tree and populating types.
1299
1300         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
1301  
1302 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
1303
1304         * expression.cs (Expression::ExprClassFromMemberInfo,
1305         Expression::Literalize): Create literal expressions from
1306         FieldInfos which are literals.
1307
1308         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
1309         type casts, because they were wrong.  The test suite in tests
1310         caught these ones.
1311
1312         (ImplicitNumericConversion): ushort to ulong requires a widening
1313         cast. 
1314
1315         Int32 constant to long requires widening cast as well.
1316
1317         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
1318         for integers because the type on the stack is not i4.
1319
1320 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
1321
1322         * expression.cs (report118): require location argument. 
1323
1324         * parameter.cs: Do not dereference potential null value.
1325
1326         * class.cs: Catch methods that lack the `new' keyword when
1327         overriding a name.  Report warnings when `new' is used without
1328         anything being there to override.
1329
1330         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
1331
1332         * class.cs: Only add constructor to hashtable if it is non-null
1333         (as now constructors can fail on define).
1334
1335         (TypeManager, Class, Struct): Take location arguments.
1336
1337         Catch field instance initialization in structs as errors.
1338
1339         accepting_filter: a new filter for FindMembers that is static so
1340         that we dont create an instance per invocation.
1341
1342         (Constructor::Define): Catch errors where a struct constructor is
1343         parameterless 
1344
1345         * cs-parser.jay: Pass location information for various new
1346         constructs. 
1347         
1348         * delegate.cs (Delegate): take a location argument.
1349
1350         * driver.cs: Do not call EmitCode if there were problesm in the
1351         Definition of the types, as many Builders wont be there. 
1352
1353         * decl.cs (Decl::Decl): Require a location argument.
1354
1355         * cs-tokenizer.cs: Handle properly hex constants that can not fit
1356         into integers, and find the most appropiate integer for it.
1357
1358         * literal.cs: Implement ULongLiteral.
1359
1360         * rootcontext.cs: Provide better information about the location of
1361         failure when CreateType fails.
1362         
1363 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
1364
1365         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
1366         as well.
1367
1368         * expression.cs (Binary::CheckShiftArguments): Add missing type
1369         computation.
1370         (Binary::ResolveOperator): Add type to the logical and and logical
1371         or, Bitwise And/Or and Exclusive Or code paths, it was missing
1372         before.
1373
1374         (Binary::DoNumericPromotions): In the case where either argument
1375         is ulong (and most signed types combined with ulong cause an
1376         error) perform implicit integer constant conversions as well.
1377
1378 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
1379
1380         * expression.cs (UserImplicitCast): Method should always be
1381         non-null. 
1382         (Invocation::BetterConversion): Simplified test for IntLiteral.
1383
1384         (Expression::ImplicitNumericConversion): Split this routine out.
1385         Put the code that performs implicit constant integer conversions
1386         here. 
1387
1388         (Expression::Resolve): Become a wrapper around DoResolve so we can
1389         check eclass and type being set after resolve.
1390
1391         (Invocation::Badness): Remove this dead function
1392
1393         (Binary::ResolveOperator): Do not compute the expensive argumnets
1394         unless we have a union for it.
1395
1396         (Probe::Emit): Is needs to do an isinst and then
1397         compare against null.
1398
1399         (::CanConvert): Added Location argument.  If the Location argument
1400         is null (Location.Null), then we do not report errors.  This is
1401         used by the `probe' mechanism of the Explicit conversion.  We do
1402         not want to generate an error for something that the user
1403         explicitly requested to be casted.  But the pipeline for an
1404         explicit cast first tests for potential implicit casts.
1405
1406         So for now, if the Location is null, it means `Probe only' to
1407         avoid adding another argument.   Might have to revise this
1408         strategy later.
1409
1410         (ClassCast): New class used to type cast objects into arbitrary
1411         classes (used in Explicit Reference Conversions).
1412
1413         Implement `as' as well.
1414
1415         Reverted all the patches from Ravi below: they were broken:
1416
1417                 * The use of `level' as a mechanism to stop recursive
1418                   invocations is wrong.  That was there just to catch the
1419                   bug with a strack trace but not as a way of addressing
1420                   the problem.
1421
1422                   To fix the problem we have to *understand* what is going
1423                   on and the interactions and come up with a plan, not
1424                   just get things going.
1425
1426                 * The use of the type conversion cache that I proposed
1427                   last night had an open topic: How does this work across
1428                   protection domains.  A user defined conversion might not
1429                   be public in the location where we are applying the
1430                   conversion, a different conversion might be selected
1431                   (ie, private A->B (better) but public B->A (worse),
1432                   inside A, A->B applies, but outside it, B->A will
1433                   apply).
1434
1435                 * On top of that (ie, even if the above is solved),
1436                   conversions in a cache need to be abstract.  Ie, `To
1437                   convert from an Int to a Short use an OpcodeCast', not
1438                   `To convert from an Int to a Short use the OpcodeCast on
1439                   the variable 5' (which is what this patch was doing).
1440         
1441 2001-09-28  Ravi Pratap  <ravi@ximian.com>
1442
1443         * expression.cs (Invocation::ConversionExists): Re-write to use
1444         the conversion cache
1445         
1446         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
1447         cache all conversions done, not just user-defined ones.
1448
1449         (Invocation::BetterConversion): The real culprit. Use ConversionExists
1450         to determine if a conversion exists instead of acutually trying to 
1451         perform the conversion. It's faster too.
1452
1453         (Expression::ConvertExplicit): Modify to use ConversionExists to check
1454         and only then attempt the implicit conversion.
1455
1456 2001-09-28  Ravi Pratap  <ravi@ximian.com>
1457
1458         * expression.cs (ConvertImplicit): Use a cache for conversions
1459         already found. Check level of recursion and bail out if necessary.
1460         
1461 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
1462
1463         * typemanager.cs (string_concat_string_string, string_concat_object_object):
1464         Export standard methods that we expect for string operations.
1465         
1466         * statement.cs (Block::UsageWarning): Track usage of variables and
1467         report the errors for not used variables.
1468
1469         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
1470         operator. 
1471
1472 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
1473
1474         * codegen.cs: remove unnneded code 
1475
1476         * expression.cs: Removed BuiltinTypeAccess class
1477
1478         Fix the order in which implicit conversions are
1479         done.  
1480
1481         The previous fixed dropped support for boxed conversions (adding a
1482         test to the test suite now)
1483
1484         (UserImplicitCast::CanConvert): Remove test for source being null,
1485         that code is broken.  We should not feed a null to begin with, if
1486         we do, then we should track the bug where the problem originates
1487         and not try to cover it up here.
1488
1489         Return a resolved expression of type UserImplicitCast on success
1490         rather than true/false.  Ravi: this is what I was talking about,
1491         the pattern is to use a static method as a "constructor" for
1492         objects. 
1493
1494         Also, do not create arguments until the very last minute,
1495         otherwise we always create the arguments even for lookups that
1496         will never be performed. 
1497
1498         (UserImplicitCast::Resolve): Eliminate, objects of type
1499         UserImplicitCast are born in a fully resolved state. 
1500         
1501         * typemanager.cs (InitCoreTypes): Init also value_type
1502         (System.ValueType). 
1503
1504         * expression.cs (Cast::Resolve): First resolve the child expression.
1505
1506         (LValue): Add new method AddressOf to be used by
1507         the `&' operator.  
1508
1509         Change the argument of Store to take an EmitContext instead of an
1510         ILGenerator, because things like FieldExpr need to be able to call
1511         their children expression to generate the instance code. 
1512
1513         (Expression::Error, Expression::Warning): Sugar functions for
1514         reporting errors.
1515
1516         (Expression::MemberLookup): Accept a TypeContainer instead of a
1517         Report as the first argument.
1518
1519         (Expression::ResolvePrimary): Killed.  I still want to improve
1520         this as currently the code is just not right.
1521
1522         (Expression::ResolveMemberAccess): Simplify, but it is still
1523         wrong. 
1524
1525         (Unary::Resolve): Catch errors in AddressOf operators.
1526
1527         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
1528         index to a byte for the short-version, or the compiler will choose
1529         the wrong Emit call, which generates the wrong data.
1530
1531         (ParameterReference::Emit, ::Store): same.
1532
1533         (FieldExpr::AddressOf): Implement.
1534         
1535         * typemanager.cs: TypeManager: made public variable instead of
1536         property.
1537         
1538         * driver.cs: document --fatal.
1539
1540         * report.cs (ErrorMessage, WarningMessage): new names for the old
1541         Error and Warning classes.
1542
1543         * cs-parser.jay (member_access): Turn built-in access to types
1544         into a normal simplename
1545
1546 2001-09-27  Ravi Pratap  <ravi@ximian.com>
1547
1548         * expression.cs (Invocation::BetterConversion): Fix to cope
1549         with q being null, since this was introducing a bug.
1550
1551         * expression.cs (ConvertImplicit): Do built-in conversions first.
1552
1553 2001-09-27  Ravi Pratap  <ravi@ximian.com>
1554
1555         * expression.cs (UserImplicitCast::Resolve): Fix bug.
1556
1557 2001-09-27  Ravi Pratap  <ravi@ximian.com>
1558
1559         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
1560         I had introduced long ago (what's new ?).
1561
1562         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
1563         the work of all the checking. 
1564         (ConvertImplicit): Call CanConvert and only then create object if necessary.
1565         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
1566
1567         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
1568         that is the right way. 
1569
1570         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
1571         overloading resolution. Use everywhere instead of cutting and pasting code.
1572
1573         (Binary::ResolveOperator): Use MakeUnionSet.
1574
1575         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
1576         we have to convert to bool types. Not complete yet.
1577         
1578 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
1579
1580         * typemanager.cs (TypeManager::CSharpName): support ushort.
1581
1582         * expression.cs (Expression::TryImplicitIntConversion): Attempts
1583         to provide an expression that performsn an implicit constant int
1584         conversion (section 6.1.6).
1585         (Expression::ConvertImplicitRequired): Reworked to include
1586         implicit constant expression conversions.
1587
1588         (Expression::ConvertNumericExplicit): Finished.
1589
1590         (Invocation::Emit): If InstanceExpression is null, then it means
1591         that we perform a call on this.
1592         
1593 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
1594
1595         * expression.cs (Unary::Emit): Remove some dead code.
1596         (Probe): Implement Resolve and Emit for `is'.
1597         (Expression::ConvertImplicitRequired): Attempt to do constant
1598         expression conversions here.  Maybe should be moved to
1599         ConvertImplicit, but I am not sure.
1600         (Expression::ImplicitLongConstantConversionPossible,
1601         Expression::ImplicitIntConstantConversionPossible): New functions
1602         that tell whether is it possible to apply an implicit constant
1603         expression conversion.
1604
1605         (ConvertNumericExplicit): Started work on explicit numeric
1606         conversions.
1607
1608         * cs-parser.jay: Update operator constants.
1609
1610         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
1611         (Parameters::GetSignature): Hook up VerifyArgs here.
1612         (Parameters::VerifyArgs): Verifies that no two arguments have the
1613         same name. 
1614
1615         * class.cs (Operator): Update the operator names to reflect the
1616         ones that the spec expects (as we are just stringizing the
1617         operator names).
1618         
1619         * expression.cs (Unary::ResolveOperator): Fix bug: Use
1620         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
1621         previous usage did only work for our methods.
1622         (Expression::ConvertImplicit): Handle decimal implicit numeric
1623         conversions as well.
1624         (Expression::InternalTypeConstructor): Used to invoke constructors
1625         on internal types for default promotions.
1626
1627         (Unary::Emit): Implement special handling for the pre/post
1628         increment/decrement for overloaded operators, as they need to have
1629         the same semantics as the other operators.
1630
1631         (Binary::ResolveOperator): ditto.
1632         (Invocation::ConversionExists): ditto.
1633         (UserImplicitCast::Resolve): ditto.
1634         
1635 2001-09-26  Ravi Pratap  <ravi@ximian.com>
1636
1637         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
1638         operator, return after emitting body. Regression tests pass again !
1639
1640         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
1641         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
1642         (Invocation::OverloadResolve): Ditto.
1643         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
1644
1645         * everywhere : update calls to the above methods accordingly.
1646
1647 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
1648
1649         * assign.cs (Assign): Make it inherit from ExpressionStatement.
1650
1651         * expression.cs (ExpressionStatement): New base class used for
1652         expressions that can appear in statements, so that we can provide
1653         an alternate path to generate expression that do not leave a value
1654         on the stack.
1655
1656         (Expression::Emit, and all the derivatives): We no longer return
1657         whether a value is left on the stack or not.  Every expression
1658         after being emitted leaves a single value on the stack.
1659
1660         * codegen.cs (EmitContext::EmitStatementExpression): Use the
1661         facilties of ExpressionStatement if possible.
1662
1663         * cs-parser.jay: Update statement_expression.
1664
1665 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
1666
1667         * driver.cs: Change the wording of message
1668
1669 2001-09-25  Ravi Pratap  <ravi@ximian.com>
1670
1671         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
1672         the type of the expression to the return type of the method if
1673         we have an overloaded operator match ! The regression tests pass again !
1674         (Unary::ResolveOperator): Ditto.
1675
1676         * expression.cs (Invocation::ConversionExists): Correct the member lookup
1677         to find "op_Implicit", not "implicit" ;-)
1678         (UserImplicitCast): New class to take care of user-defined implicit conversions.
1679         (ConvertImplicit, ForceConversion): Take TypeContainer argument
1680
1681         * everywhere : Correct calls to the above accordingly.
1682
1683         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
1684         (ConvertImplicit): Do user-defined conversion if it exists.
1685
1686 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
1687
1688         * assign.cs: track location.
1689         (Resolve): Use implicit conversions on assignment.
1690
1691         * literal.cs: Oops.  Not good, Emit of short access values should
1692         pass (Bytes) or the wrong argument will be selected.
1693
1694         * expression.cs (Unary::Emit): Emit code for -expr.
1695         
1696         (Unary::ResolveOperator): Handle `Substract' for non-constants
1697         (substract from zero from the non-constants).
1698         Deal with Doubles as well. 
1699         
1700         (Expression::ConvertImplicitRequired): New routine that reports an
1701         error if no implicit conversion exists. 
1702
1703         (Invocation::OverloadResolve): Store the converted implicit
1704         expressions if we make them
1705         
1706 2001-09-24  Ravi Pratap  <ravi@ximian.com>
1707
1708         * class.cs (ConstructorInitializer): Take a Location argument.
1709         (ConstructorBaseInitializer): Same here.
1710         (ConstructorThisInitializer): Same here.
1711
1712         * cs-parser.jay : Update all calls accordingly.
1713
1714         * expression.cs (Unary, Binary, New): Take location argument.
1715         Update accordingly everywhere.
1716
1717         * cs-parser.jay : Update all calls to the above to take a location
1718         argument.
1719
1720         * class.cs : Ditto.
1721
1722 2001-09-24  Ravi Pratap  <ravi@ximian.com>
1723
1724         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
1725         (Invocation::BetterConversion): Same here
1726         (Invocation::ConversionExists): Ditto.
1727
1728         (Invocation::ConversionExists): Implement.
1729
1730 2001-09-22  Ravi Pratap  <ravi@ximian.com>
1731
1732         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
1733         Also take an additional TypeContainer argument.
1734
1735         * All over : Pass in TypeContainer as argument to OverloadResolve.
1736
1737         * typemanager.cs (CSharpName): Update to check for the string type and return
1738         that too.
1739
1740         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
1741         a given method.
1742         
1743 2001-09-21  Ravi Pratap  <ravi@ximian.com>
1744
1745         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
1746         (Invocation::BetterFunction): Implement.
1747         (Invocation::BetterConversion): Implement.
1748         (Invocation::ConversionExists): Skeleton, no implementation yet.
1749
1750         Okay, things work fine !
1751
1752 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
1753
1754         * typemanager.cs: declare and load enum_type, delegate_type and
1755         void_type. 
1756
1757         * expression.cs (Expression::Emit): Now emit returns a value that
1758         tells whether a value is left on the stack or not.  This strategy
1759         might be reveted tomorrow with a mechanism that would address
1760         multiple assignments.
1761         (Expression::report118): Utility routine to report mismatches on
1762         the ExprClass.
1763
1764         (Unary::Report23): Report impossible type/operator combination
1765         utility function.
1766
1767         (Unary::IsIncrementableNumber): Whether the type can be
1768         incremented or decremented with add.
1769         (Unary::ResolveOperator): Also allow enumerations to be bitwise
1770         complemented. 
1771         (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
1772
1773         (Invocation::Emit): Deal with new Emit convetion.
1774         
1775         * All Expression derivatives: Updated their Emit method to return
1776         whether they leave values on the stack or not.
1777         
1778         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
1779         stack for expressions that are statements. 
1780
1781 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
1782
1783         * expression.cs (LValue): New interface.  Must be implemented by
1784         LValue objects.
1785         (LocalVariableReference, ParameterReference, FieldExpr): Implement
1786         LValue interface.
1787         
1788         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
1789         interface for generating code, simplifies the code.
1790
1791 2001-09-20  Ravi Pratap  <ravi@ximian.com>
1792
1793         * expression.cs (everywhere): Comment out return statements in ::Resolve
1794         methods to avoid the warnings.
1795
1796 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
1797
1798         * driver.cs (parse): Report error 2001 if we can not open the
1799         source file.
1800
1801         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
1802         not resolve it.
1803
1804         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
1805         object. 
1806
1807         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
1808         otherwise nested blocks end up with the same index.
1809
1810         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
1811
1812         * expression.cs:  Instead of having FIXMEs in the Resolve
1813         functions, throw exceptions so it is obvious that we are facing a
1814         bug. 
1815
1816         * cs-parser.jay (invocation_expression): Pass Location information.
1817
1818         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
1819         Use a basename for those routines because .NET does not like paths
1820         on them. 
1821
1822         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
1823         already defined.
1824
1825 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
1826
1827         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
1828         are loading the correct data types (throws an exception if not).
1829         (TypeManager::InitCoreTypes): Use CoreLookupType
1830
1831         * expression.cs (Unary::ResolveOperator): return the child
1832         expression for expressions which are just +expr.
1833         (Unary::ResolveOperator): Return negative literals for -LITERAL
1834         expressions (otherwise they are Unary {Literal}).
1835         (Invocation::Badness): Take into account `Implicit constant
1836         expression conversions'.
1837
1838         * literal.cs (LongLiteral): Implement long literal class.
1839         (IntLiteral): export the `Value' of the intliteral. 
1840
1841 2001-09-19  Ravi Pratap  <ravi@ximian.com>
1842
1843         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
1844
1845         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
1846         instead of 'Operator'
1847
1848         * expression.cs (Binary::ResolveOperator): Update accordingly.
1849         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
1850         and 'Minus'
1851
1852         * cs-parser.jay (unary_expression): Update to use the new names.
1853
1854         * gen-treedump.cs (GetUnary): Same here.
1855
1856         * expression.cs (Unary::Resolve): Implement.
1857         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
1858         operators are found instead of making noise ;-)
1859         (Unary::ResolveOperator): New method to do precisely the same thing which
1860         Binary::ResolveOperator does for Binary expressions.
1861         (Unary.method, .Arguments): Add.
1862         (Unary::OperName): Implement.   
1863         (Unary::ForceConversion): Copy and Paste !
1864
1865         * class.cs (Operator::Define): Fix a small bug for the case when we have 
1866         a unary operator.
1867
1868         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
1869         for the inbuilt operators. Only overloading works for now ;-)
1870
1871 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
1872
1873         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
1874         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
1875
1876         * expression.cs (This::Emit): Implement. 
1877         (This::Resolve): Implement.
1878         (TypeOf:Resolve): Implement.
1879         (Expression::ResolveSimpleName): Add an implicit this to instance
1880         field references. 
1881         (MemberAccess::Resolve): Deal with Parameters and Fields. 
1882         Bind instance variable to Field expressions.
1883         (FieldExpr::Instance): New field used to track the expression that
1884         represents the object instance.
1885         (FieldExpr::Resolve): Track potential errors from MemberLookup not
1886         binding 
1887         (FieldExpr::Emit): Implement.
1888
1889         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
1890         the last instruction contains a return opcode to avoid generating
1891         the last `ret' instruction (this generates correct code, and it is
1892         nice to pass the peverify output).
1893
1894         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
1895         initializer for static and instance variables.
1896         (Constructor::Emit): Allow initializer to be null in the case of
1897         static constructors.  Only emit initializer for instance
1898         constructors. 
1899
1900         (TypeContainer::FindMembers): Return a null array if there are no
1901         matches.
1902
1903         Also fix the code for the MemberTypes.Method branch, as it was not
1904         scanning that for operators (or tried to access null variables before).
1905
1906         * assign.cs (Assign::Emit): Handle instance and static fields. 
1907
1908         * TODO: Updated.
1909
1910         * driver.cs: Stop compilation if there are parse errors.
1911
1912         * cs-parser.jay (constructor_declaration): Provide default base
1913         initializer for non-static constructors.
1914         (constructor_declarator): Do not provide a default base
1915         initializers if none was specified.
1916         Catch the fact that constructors should not have parameters.
1917
1918         * class.cs: Do not emit parent class initializers for static
1919         constructors, that should be flagged as an error.
1920
1921 2001-09-18  Ravi Pratap  <ravi@ximian.com>
1922
1923         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
1924         Move back code into TypeContainer::Populate.
1925
1926 2001-09-18  Ravi Pratap  <ravi@ximian.com>
1927
1928         * class.cs (TypeContainer::AddConstructor): Fix the check to
1929         compare against Name, not Basename. 
1930         (Operator::OpType): Change Plus and Minus to Add and Subtract.
1931
1932         * cs-parser.jay : Update accordingly.
1933
1934         * class.cs (TypeContainer::FindMembers): For the case where we are searching
1935         for methods, don't forget to look into the operators too.
1936         (RegisterMethodBuilder): Helper method to take care of this for
1937         methods, constructors and operators.
1938         (Operator::Define): Completely revamp.
1939         (Operator.OperatorMethod, MethodName): New fields.
1940         (TypeContainer::Populate): Move the registering of builders into
1941         RegisterMethodBuilder.
1942         (Operator::Emit): Re-write.
1943
1944         * expression.cs (Binary::Emit): Comment out code path to emit method
1945         invocation stuff for the case when we have a user defined operator. I am
1946         just not able to get it right !
1947         
1948 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
1949
1950         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
1951         argument. 
1952
1953         (Expression::MemberLookup): Provide a version that allows to
1954         specify the MemberTypes and BindingFlags. 
1955
1956         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
1957         so it was not fetching variable information from outer blocks.
1958
1959         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
1960         Beforefieldinit as it was buggy.
1961
1962         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
1963         that Ravi put here.  
1964
1965         * class.cs (Constructor::Emit): Only emit if block is not null.
1966         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
1967         deal with this by semantically definining it as if the user had
1968         done it.
1969
1970         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
1971         constructors as we now "emit" them at a higher level.
1972
1973         (TypeContainer::DefineDefaultConstructor): Used to define the
1974         default constructors if none was provided.
1975
1976         (ConstructorInitializer): Add methods Resolve and Emit. 
1977         
1978         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
1979
1980 2001-09-17  Ravi Pratap  <ravi@ximian.com>
1981
1982         * class.cs (TypeContainer::EmitDefaultConstructor): Register
1983         the default constructor builder with our hashtable for methodbuilders
1984         to methodcores.
1985
1986         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
1987         and argument_count is 0 in which case we have a match.
1988         (Binary::ResolveOperator): More null checking and miscellaneous coding
1989         style cleanup.
1990
1991 2001-09-17  Ravi Pratap  <ravi@ximian.com>
1992
1993         * rootcontext.cs (IsNameSpace): Compare against null.
1994
1995         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
1996
1997         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
1998         and Unary::Operator.
1999
2000         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
2001         accordingly.
2002
2003         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
2004         we have overloaded operators.
2005         (Binary::ResolveOperator): Implement the part which does the operator overload
2006         resolution.
2007
2008         * class.cs (Operator::Emit): Implement.
2009         (TypeContainer::Emit): Emit the operators we have too.
2010
2011         * expression.cs (Binary::Emit): Update to emit the appropriate code for
2012         the case when we have a user-defined operator.
2013         
2014 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
2015
2016         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
2017
2018 2001-09-16  Ravi Pratap  <ravi@ximian.com>
2019
2020         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
2021         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
2022         (Constructor::Emit): Implement.
2023         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
2024         if we have no work to do. 
2025         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
2026         Emit method.
2027
2028         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
2029         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
2030
2031         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
2032         of parent.parent.
2033
2034 2001-09-15  Ravi Pratap  <ravi@ximian.com>
2035
2036         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
2037         in the source.
2038         (Tree::RecordNamespace): Method to do what the name says ;-)
2039         (Tree::Namespaces): Property to get at the namespaces hashtable.
2040
2041         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
2042         keep track.
2043
2044         * rootcontext.cs (IsNamespace): Fixed it :-)
2045
2046 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
2047
2048         * class.cs (TypeContainer::FindMembers): Add support for
2049         constructors. 
2050         (MethodCore): New class that encapsulates both the shared aspects
2051         of a Constructor and a Method.  
2052         (Method, Constructor): Factored pieces into MethodCore.
2053
2054         * driver.cs: Added --fatal which makes errors throw exceptions.
2055         Load System assembly as well as part of the standard library.
2056
2057         * report.cs: Allow throwing exceptions on errors for debugging.
2058
2059         * modifiers.cs: Do not use `parent', instead use the real type
2060         container to evaluate permission settings.
2061
2062         * class.cs: Put Ravi's patch back in.  He is right, and we will
2063         have to cope with the
2064
2065 2001-09-14  Ravi Pratap  <ravi@ximian.com>
2066
2067         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
2068         FamORAssem, not FamANDAssem.
2069         
2070 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
2071
2072         * driver.cs: Added --parse option that only parses its input files
2073         and terminates.
2074
2075         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
2076         incorrect.  IsTopLevel is not used to tell whether an object is
2077         root_types or not (that can be achieved by testing this ==
2078         root_types).  But to see if this is a top-level *class* (not
2079         necessarly our "toplevel" container). 
2080
2081 2001-09-14  Ravi Pratap  <ravi@ximian.com>
2082
2083         * enum.cs (Enum::Define): Modify to call the Lookup method on the
2084         parent instead of a direct call to GetType.
2085
2086 2001-09-14  Ravi Pratap  <ravi@ximian.com>
2087
2088         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
2089         Modifiers.TypeAttr. This should just be a call to that method.
2090
2091         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
2092         object so that we can determine if we are top-level or not.
2093
2094         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
2095         TypeContainer too.
2096
2097         * enum.cs (Enum::Define): Ditto.
2098
2099         * modifiers.cs (FieldAttr): Re-write.
2100
2101         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
2102         (TypeContainer::HaveStaticConstructor): New property to provide access
2103         to precisely that info.
2104
2105         * modifiers.cs (MethodAttr): Re-write.
2106         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
2107
2108         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
2109         of top-level types as claimed.
2110         
2111 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
2112
2113         * expression.cs (MemberLookup): Fruitless attempt to lookup
2114         constructors.  Maybe I need to emit default constructors?  That
2115         might be it (currently .NET emits this for me automatically).
2116         (Invocation::OverloadResolve): Cope with Arguments == null.
2117         (Invocation::EmitArguments): new function, shared by the new
2118         constructor and us.
2119         (Invocation::Emit): Handle static and instance methods.  Emit
2120         proper call instruction for virtual or non-virtual invocations.
2121         (New::Emit): Implement.
2122         (New::Resolve): Implement.
2123         (MemberAccess:Resolve): Implement.
2124         (MethodGroupExpr::InstanceExpression): used conforming to the spec
2125         to track instances.
2126         (FieldExpr::Resolve): Set type.
2127
2128         * support.cs: Handle empty arguments.
2129                 
2130         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
2131         SimpleLookup): Auxiliary routines to help parse a qualifier
2132         identifier.  
2133
2134         Update qualifier_identifier rule.
2135
2136         * codegen.cs: Removed debugging messages.
2137
2138         * class.cs: Make this a global thing, this acts just as a "key" to
2139         objects that we might have around.
2140
2141         (Populate): Only initialize method_builders_to_methods once.
2142
2143         * expression.cs (PropertyExpr): Initialize type from the
2144         PropertyType. 
2145
2146         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
2147         Resolve pattern.  Attempt to implicitly convert value to boolean.
2148         Emit code.
2149
2150         * expression.cs: Set the type for the int32/int32 argument case.
2151         (Binary::ResolveOperator): Set the return type to boolean for
2152         comparission operators
2153
2154         * typemanager.cs: Remove debugging print code.
2155
2156         (Invocation::Resolve): resolve type.
2157
2158         * class.cs: Allocate a MemberInfo of the correct size, as the code
2159         elsewhere depends on the test to reflect the correct contents.
2160
2161         (Method::) Keep track of parameters, due to System.Reflection holes
2162
2163         (TypeContainer::Populate): Keep track of MethodBuilders to Method
2164         mapping here.
2165
2166         (TypeContainer::FindMembers): Use ArrayList and then copy an array
2167         of the exact size and return that.
2168
2169         (Class::LookupMethodByBuilder): New function that maps
2170         MethodBuilders to its methods.  Required to locate the information
2171         on methods because System.Reflection bit us again.
2172
2173         * support.cs: New file, contains an interface ParameterData and
2174         two implementations: ReflectionParameters and InternalParameters
2175         used to access Parameter information.  We will need to grow this
2176         as required.
2177
2178         * expression.cs (Invocation::GetParameterData): implement a cache
2179         and a wrapper around the ParameterData creation for methods. 
2180         (Invocation::OverloadResolve): Use new code.
2181
2182 2001-09-13  Ravi Pratap  <ravi@ximian.com>
2183
2184         * class.cs (TypeContainer::EmitField): Remove and move into 
2185         (Field::Define): here and modify accordingly.
2186         (Field.FieldBuilder): New member.
2187         (TypeContainer::Populate): Update accordingly.
2188         (TypeContainer::FindMembers): Implement.
2189
2190 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
2191
2192         * statement.cs: (VariableInfo::VariableType): New field to be
2193         initialized with the full type once it is resolved. 
2194
2195 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
2196
2197         * parameter.cs (GetParameterInfo): Use a type cache to compute
2198         things only once, and to reuse this information
2199
2200         * expression.cs (LocalVariableReference::Emit): Implement.
2201         (OpcodeCast::Emit): fix.
2202
2203         (ParameterReference::Resolve): Implement.
2204         (ParameterReference::Emit): Implement.
2205
2206         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
2207         that are expressions need to stay as Expressions.
2208
2209         * typemanager.cs (CSharpName): Returns the C# name of a type if
2210         possible. 
2211
2212         * expression.cs (Expression::ConvertImplicit): New function that
2213         implements implicit type conversions.
2214
2215         (Expression::ImplicitReferenceConversion): Implements implicit
2216         reference conversions.
2217
2218         (EmptyCast): New type for transparent casts.
2219
2220         (OpcodeCast): New type for casts of types that are performed with
2221         a sequence of bytecodes.
2222         
2223         (BoxedCast): New type used for casting value types into reference
2224         types.  Emits a box opcode.
2225
2226         (Binary::DoNumericPromotions): Implements numeric promotions of
2227         and computation of the Binary::Type.
2228
2229         (Binary::EmitBranchable): Optimization.
2230
2231         (Binary::Emit): Implement code emission for expressions.
2232         
2233         * typemanager.cs (TypeManager): Added two new core types: sbyte
2234         and byte.
2235
2236 2001-09-12  Ravi Pratap  <ravi@ximian.com>
2237
2238         * class.cs (TypeContainer::FindMembers): Method which does exactly
2239         what Type.FindMembers does, only we don't have to use reflection. No
2240         implementation yet.
2241
2242         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
2243         typecontainer objects as we need to get at them.
2244         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
2245
2246         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
2247         typecontainer object.
2248
2249         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
2250         of just a Report object.
2251
2252 2001-09-11  Ravi Pratap  <ravi@ximian.com>
2253
2254         * class.cs (Event::Define): Go back to using the prefixes "add_" and
2255         "remove_"
2256         (TypeContainer::Populate): Now define the delegates of the type too.
2257         (TypeContainer.Delegates): Property to access the list of delegates defined
2258         in the type.
2259
2260         * delegates.cs (Delegate::Define): Implement partially.
2261
2262         * modifiers.cs (TypeAttr): Handle more flags.
2263
2264 2001-09-11  Ravi Pratap  <ravi@ximian.com>
2265
2266         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
2267         and not <=
2268         (Operator::Define): Re-write logic to get types by using the LookupType method
2269         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
2270         (Indexer::Define): Ditto.
2271         (Event::Define): Ditto.
2272         (Property::Define): Ditto.
2273         
2274 2001-09-10  Ravi Pratap  <ravi@ximian.com>
2275
2276         * class.cs (TypeContainer::Populate): Now define operators too. 
2277         (TypeContainer.Operators): New property to access the list of operators
2278         in a type.
2279         (Operator.OperatorMethodBuilder): New member to hold the method builder
2280         for the operator we are defining.
2281         (Operator::Define): Implement.
2282
2283 2001-09-10  Ravi Pratap  <ravi@ximian.com>
2284
2285         * class.cs (Event::Define): Make the prefixes of the accessor methods
2286         addOn_ and removeOn_ 
2287
2288         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
2289         of the location being passed in too. Ideally, this should go later since all
2290         error reporting should be done through the Report object.
2291
2292         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
2293         (Populate): Iterate thru the indexers we have and define them too.
2294         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
2295         for the get and set accessors.
2296         (Indexer::Define): Implement.
2297         
2298 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
2299
2300         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
2301         my previous implementation, did not work.
2302
2303         * typemanager.cs: Add a couple of missing types (the longs).
2304
2305         * literal.cs: Use TypeManager.bool_type instead of getting it.
2306
2307         * expression.cs (EventExpr): New kind of expressions.
2308         (Expressio::ExprClassFromMemberInfo): finish
2309
2310 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
2311
2312         * assign.cs: Emit stores to static fields differently.
2313
2314 2001-09-08  Ravi Pratap  <ravi@ximian.com>
2315
2316         * Merge in changes and adjust code to tackle conflicts. Backed out my
2317         code in Assign::Resolve ;-) 
2318
2319 2001-09-08  Ravi Pratap  <ravi@ximian.com>
2320
2321         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
2322         instead Report.Error and also pass in the location.
2323         (CSharpParser::Lexer): New readonly property to return the reference
2324         to the Tokenizer object.
2325         (declare_local_variables): Use Report.Error with location instead of plain 
2326         old error.
2327         (CheckDef): Ditto.
2328
2329         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
2330         (Operator.CheckBinaryOperator): Ditto.
2331
2332         * cs-parser.jay (operator_declarator): Update accordingly.
2333
2334         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
2335         (CheckBinaryOperator): Same here.
2336
2337         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
2338         on the name without any prefixes of namespace names etc. This is because we
2339         already might have something already fully qualified like 
2340         'System.Console.WriteLine'
2341
2342         * assign.cs (Resolve): Begin implementation. Stuck ;-)
2343
2344 2001-09-07  Ravi Pratap  <ravi@ximian.com>
2345
2346         * cs-tokenizer.cs (location): Return a string which also contains
2347         the file name.
2348
2349         * expression.cs (ElementAccess): New class for expressions of the
2350         type 'element access.'
2351         (BaseAccess): New class for expressions of the type 'base access.'
2352         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
2353         respectively.
2354         
2355         * cs-parser.jay (element_access): Implement action.
2356         (base_access): Implement actions.
2357         (checked_expression, unchecked_expression): Implement.
2358
2359         * cs-parser.jay (local_variable_type): Correct and implement.
2360         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
2361
2362         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
2363
2364         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
2365         name and the specifiers.
2366
2367         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
2368         
2369         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
2370         making them all public ;-)
2371
2372         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
2373         class anyways.
2374         
2375 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
2376
2377         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
2378         PropertyExprs.
2379         (FieldExpr, PropertyExprs): New resolved expressions.
2380         (SimpleName::MemberStaticCheck): Perform static checks for access
2381         to non-static fields on static methods. Maybe this should be
2382         generalized for MemberAccesses. 
2383         (SimpleName::ResolveSimpleName): More work on simple name
2384         resolution. 
2385
2386         * cs-parser.jay (primary_expression/qualified_identifier): track
2387         the parameter index.
2388
2389         * codegen.cs (CodeGen::Save): Catch save exception, report error.
2390         (EmitContext::EmitBoolExpression): Chain to expression generation
2391         instead of temporary hack.
2392         (::EmitStatementExpression): Put generic expression code generation.
2393
2394         * assign.cs (Assign::Emit): Implement variable assignments to
2395         local variables, parameters and fields.
2396
2397 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
2398
2399         * statement.cs (Block::GetVariableInfo): New method, returns the
2400         VariableInfo for a variable name in a block.
2401         (Block::GetVariableType): Implement in terms of GetVariableInfo
2402
2403         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
2404         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
2405
2406 2001-09-06  Ravi Pratap  <ravi@ximian.com>
2407
2408         * cs-parser.jay (operator_declaration): Continue on my quest : update
2409         to take attributes argument.
2410         (event_declaration): Ditto.
2411         (enum_declaration): Ditto.
2412         (indexer_declaration): Ditto.
2413         
2414         * class.cs (Operator::Operator): Update constructor accordingly.
2415         (Event::Event): Ditto.
2416
2417         * delegate.cs (Delegate::Delegate): Same here.
2418
2419         * enum.cs (Enum::Enum): Same here.
2420         
2421 2001-09-05  Ravi Pratap  <ravi@ximian.com>
2422
2423         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
2424
2425         * ../tests/cs0658.cs : New file to demonstrate error 0658.
2426
2427         * attribute.cs (Attributes): New class to encapsulate all attributes which were
2428         being passed around as an arraylist.
2429         (Attributes::AddAttribute): Method to add attribute sections.
2430
2431         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
2432         (struct_declaration): Update accordingly.
2433         (constant_declaration): Update.
2434         (field_declaration): Update.
2435         (method_header): Update.
2436         (fixed_parameter): Update.
2437         (parameter_array): Ditto.
2438         (property_declaration): Ditto.
2439         (destructor_declaration): Ditto.
2440         
2441         * class.cs (Struct::Struct): Update constructors accordingly.
2442         (Class::Class): Ditto.
2443         (Field::Field): Ditto.
2444         (Method::Method): Ditto.
2445         (Property::Property): Ditto.
2446         (TypeContainer::OptAttribute): update property's return type.
2447         
2448         * interface.cs (Interface.opt_attributes): New member.
2449         (Interface::Interface): Update to take the extra Attributes argument.
2450
2451         * parameter.cs (Parameter::Parameter): Ditto.
2452
2453         * constant.cs (Constant::Constant): Ditto.
2454
2455         * interface.cs (InterfaceMemberBase): New OptAttributes field.
2456         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
2457         the attributes as a parameter.
2458         (InterfaceProperty): Update constructor call.
2459         (InterfaceEvent): Ditto.
2460         (InterfaceMethod): Ditto.
2461         (InterfaceIndexer): Ditto.
2462
2463         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
2464         pass the attributes too.
2465         (interface_event_declaration): Ditto.
2466         (interface_property_declaration): Ditto.
2467         (interface_method_declaration): Ditto.
2468         (interface_declaration): Ditto.
2469
2470 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
2471
2472         * class.cs (Method::Define): Track the "static Main" definition to
2473         create an entry point. 
2474
2475         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
2476         EntryPoint if we find it. 
2477
2478         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
2479         (EmitContext::ig): Make this variable public.
2480
2481         * driver.cs: Make the default output file be the first file name
2482         with the .exe extension.  
2483
2484         Detect empty compilations
2485
2486         Handle various kinds of output targets.  Handle --target and
2487         rename -t to --dumper.
2488
2489         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
2490         methods inherited from Expression return now an Expression.  This
2491         will is used during the tree rewriting as we resolve them during
2492         semantic analysis.
2493
2494         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
2495         the spec.  Missing entirely is the information about
2496         accessability of elements of it.
2497
2498         (Expression::ExprClassFromMemberInfo): New constructor for
2499         Expressions that creates a fully initialized Expression based on
2500         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
2501         a Type.
2502
2503         (Invocation::Resolve): Begin implementing resolution of invocations.
2504         
2505         * literal.cs (StringLiteral):  Implement Emit.
2506
2507 2001-09-05  Ravi Pratap  <ravi@ximian.com>
2508
2509         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
2510         member.
2511         
2512 2001-09-04  Ravi Pratap  <ravi@ximian.com>
2513
2514         * cs-parser.jay (attribute_arguments): Implement actions.
2515         (attribute): Fix bug in production. Implement action.
2516         (attribute_list): Implement.
2517         (attribute_target): Implement.
2518         (attribute_target_specifier, opt_target_specifier): Implement
2519         (CheckAttributeTarget): New method to check if the attribute target
2520         is valid.
2521         (attribute_section): Implement.
2522         (opt_attributes): Implement.
2523
2524         * attribute.cs : New file to handle attributes.
2525         (Attribute): Class to hold attribute info.
2526
2527         * cs-parser.jay (opt_attribute_target_specifier): Remove production
2528         (attribute_section): Modify production to use 2 different rules to 
2529         achieve the same thing. 1 s/r conflict down !
2530         Clean out commented, useless, non-reducing dimension_separator rules.
2531         
2532         * class.cs (TypeContainer.attributes): New member to hold list
2533         of attributes for a type.
2534         (Struct::Struct): Modify to take one more argument, the attribute list.
2535         (Class::Class): Ditto.
2536         (Field::Field): Ditto.
2537         (Method::Method): Ditto.
2538         (Property::Property): Ditto.
2539         
2540         * cs-parser.jay (struct_declaration): Update constructor call to
2541         pass in the attributes too.
2542         (class_declaration): Ditto.
2543         (constant_declaration): Ditto.
2544         (field_declaration): Ditto.
2545         (method_header): Ditto.
2546         (fixed_parameter): Ditto.
2547         (parameter_array): Ditto.
2548         (property_declaration): Ditto.
2549
2550         * constant.cs (Constant::Constant): Update constructor similarly.
2551         Use System.Collections.
2552
2553         * parameter.cs (Parameter::Parameter): Update as above.
2554
2555 2001-09-02  Ravi Pratap  <ravi@ximian.com>
2556
2557         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
2558         (TypeContainer.delegates): New member to hold list of delegates.
2559
2560         * cs-parser.jay (delegate_declaration): Implement the action correctly 
2561         this time as I seem to be on crack ;-)
2562
2563 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
2564
2565         * rootcontext.cs (RootContext::IsNamespace): new function, used to
2566         tell whether an identifier represents a namespace.
2567
2568         * expression.cs (NamespaceExpr): A namespace expression, used only
2569         temporarly during expression resolution.
2570         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
2571         utility functions to resolve names on expressions.
2572
2573 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
2574
2575         * codegen.cs: Add hook for StatementExpressions. 
2576
2577         * class.cs: Fix inverted test for static flag in methods.
2578
2579 2001-09-02  Ravi Pratap  <ravi@ximian.com>
2580
2581         * class.cs (Operator::CheckUnaryOperator): Correct error number used
2582         to make it coincide with MS' number.
2583         (Operator::CheckBinaryOperator): Ditto.
2584
2585         * ../errors/errors.txt : Remove error numbers added earlier.
2586
2587         * ../errors/cs1019.cs : Test case for error # 1019
2588
2589         * ../errros/cs1020.cs : Test case for error # 1020
2590
2591         * cs-parser.jay : Clean out commented cruft.
2592         (dimension_separators, dimension_separator): Comment out. Ostensibly not
2593         used anywhere - non-reducing rule.
2594         (namespace_declarations): Non-reducing rule - comment out.
2595
2596         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
2597         with TypeContainer::AddEnum.
2598
2599         * delegate.cs : New file for delegate handling classes.
2600         (Delegate): Class for declaring delegates.
2601
2602         * makefile : Update.
2603
2604         * cs-parser.jay (delegate_declaration): Implement.
2605
2606 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
2607
2608         * class.cs (Event::Define): Implement.
2609         (Event.EventBuilder): New member.
2610
2611         * class.cs (TypeContainer::Populate): Update to define all enums and events
2612         we have.
2613         (Events): New property for the events arraylist we hold. Shouldn't we move to using
2614         readonly fields for all these cases ?
2615
2616 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
2617
2618         * class.cs (Property): Revamp to use the convention of making fields readonly.
2619         Accordingly modify code elsewhere.
2620
2621         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
2622         the Define method of the Property class.
2623
2624         * class.cs : Clean up applied patch and update references to variables etc. Fix 
2625         trivial bug.
2626         (TypeContainer::Populate): Update to define all the properties we have. Also
2627         define all enumerations.
2628
2629         * enum.cs (Define): Implement.
2630         
2631 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
2632
2633         * cs-parser.jay (overloadable_operator): The semantic value is an
2634         enum of the Operator class.
2635         (operator_declarator): Implement actions.
2636         (operator_declaration): Implement.
2637
2638         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
2639         validity of definitions.
2640         (Operator::CheckBinaryOperator): Static method to check for binary operators
2641         (TypeContainer::AddOperator): New method to add an operator to a type.
2642
2643         * cs-parser.jay (indexer_declaration): Added line to actually call the
2644         AddIndexer method so it gets added ;-)
2645
2646         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
2647         already taken care of by the MS compiler ?  
2648
2649 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
2650
2651         * class.cs (Operator): New class for operator declarations.
2652         (Operator::OpType): Enum for the various operators.
2653
2654 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
2655
2656         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
2657         ostensibly handle this in semantic analysis.
2658
2659         * cs-parser.jay (general_catch_clause): Comment out
2660         (specific_catch_clauses, specific_catch_clause): Ditto.
2661         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
2662         (catch_args, opt_catch_args): New productions.
2663         (catch_clause): Rewrite to use the new productions above
2664         (catch_clauses): Modify accordingly.
2665         (opt_catch_clauses): New production to use in try_statement
2666         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
2667         and re-write the code in the actions to extract the specific and
2668         general catch clauses by being a little smart ;-)
2669
2670         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
2671         Hooray, try and catch statements parse fine !
2672         
2673 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
2674
2675         * statement.cs (Block::GetVariableType): Fix logic to extract the type
2676         string from the hashtable of variables.
2677
2678         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
2679         I end up making that mistake ;-)
2680         (catch_clauses): Fixed gross error which made Key and Value of the 
2681         DictionaryEntry the same : $1 !!
2682
2683 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
2684
2685         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
2686
2687         * cs-parser.jay (event_declaration): Correct to remove the semicolon
2688         when the add and remove accessors are specified. 
2689
2690 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
2691
2692         * cs-parser.jay (IndexerDeclaration): New helper class to hold
2693         information about indexer_declarator.
2694         (indexer_declarator): Implement actions.
2695         (parsing_indexer): New local boolean used to keep track of whether
2696         we are parsing indexers or properties. This is necessary because 
2697         implicit_parameters come into picture even for the get accessor in the 
2698         case of an indexer.
2699         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
2700
2701         * class.cs (Indexer): New class for indexer declarations.
2702         (TypeContainer::AddIndexer): New method to add an indexer to a type.
2703         (TypeContainer::indexers): New member to hold list of indexers for the
2704         type.
2705
2706 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
2707
2708         * cs-parser.jay (add_accessor_declaration): Implement action.
2709         (remove_accessor_declaration): Implement action.
2710         (event_accessors_declaration): Implement
2711         (variable_declarators): swap statements for first rule - trivial.
2712
2713         * class.cs (Event): New class to hold information about event
2714         declarations.
2715         (TypeContainer::AddEvent): New method to add an event to a type
2716         (TypeContainer::events): New member to hold list of events.
2717
2718         * cs-parser.jay (event_declaration): Implement actions.
2719
2720 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
2721
2722         * cs-parser.jay (dim_separators): Implement. Make it a string
2723         concatenating all the commas together, just as they appear.
2724         (opt_dim_separators): Modify accordingly
2725         (rank_specifiers): Update accordingly. Basically do the same
2726         thing - instead, collect the brackets here.
2727         (opt_rank_sepcifiers): Modify accordingly.
2728         (array_type): Modify to actually return the complete type string
2729         instead of ignoring the rank_specifiers.
2730         (expression_list): Implement to collect the expressions
2731         (variable_initializer): Implement. We make it a list of expressions
2732         essentially so that we can handle the array_initializer case neatly too.
2733         (variable_initializer_list): Implement.
2734         (array_initializer): Make it a list of variable_initializers
2735         (opt_array_initializer): Modify accordingly.
2736
2737         * expression.cs (New::NType): Add enumeration to help us
2738         keep track of whether we have an object/delegate creation
2739         or an array creation.
2740         (New:NewType, New::Rank, New::Indices, New::Initializers): New
2741         members to hold data about array creation.
2742         (New:New): Modify to update NewType
2743         (New:New): New Overloaded contructor for the array creation
2744         case.
2745
2746         * cs-parser.jay (array_creation_expression): Implement to call
2747         the overloaded New constructor.
2748         
2749 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
2750
2751         * class.cs (TypeContainer::Constructors): Return member
2752         constructors instead of returning null.
2753
2754 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
2755
2756         * typemanager.cs (InitCoreTypes): Initialize the various core
2757         types after we have populated the type manager with the user
2758         defined types (this distinction will be important later while
2759         compiling corlib.dll)
2760
2761         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
2762         on Expression Classification.  Now all expressions have a method
2763         `Resolve' and a method `Emit'.
2764
2765         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
2766         generation from working.     Also add some temporary debugging
2767         code. 
2768         
2769 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
2770
2771         * codegen.cs: Lots of code generation pieces.  This is only the
2772         beginning, will continue tomorrow with more touches of polish.  We
2773         handle the fundamentals of if, while, do, for, return.  Others are
2774         trickier and I need to start working on invocations soon.
2775         
2776         * gen-treedump.cs: Bug fix, use s.Increment here instead of
2777         s.InitStatement. 
2778
2779         * codegen.cs (EmitContext): New struct, used during code
2780         emission to keep a context.   Most of the code generation will be
2781         here. 
2782
2783         * cs-parser.jay: Add embedded blocks to the list of statements of
2784         this block.  So code generation proceeds in a top down fashion.
2785
2786 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
2787
2788         * statement.cs: Add support for multiple child blocks.
2789
2790 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
2791
2792         * codegen.cs (EmitCode): New function, will emit the code for a
2793         Block of code given a TypeContainer and its ILGenerator. 
2794
2795         * statement.cs (Block): Standard public readonly optimization.
2796         (Block::Block constructors): Link children. 
2797         (Block::Child): Child Linker.
2798         (Block::EmitVariables): Emits IL variable declarations.
2799
2800         * class.cs: Drop support for MethodGroups here, delay until
2801         Semantic Analysis.
2802         (Method::): Applied the same simplification that I did before, and
2803         move from Properties to public readonly fields.
2804         (Method::ParameterTypes): Returns the parameter types for the
2805         function, and implements a cache that will be useful later when I
2806         do error checking and the semantic analysis on the methods is
2807         performed.
2808         (Constructor::GetCallingConvention): Renamed from CallingConvetion
2809         and made a method, optional argument tells whether this is a class
2810         or a structure to apply the `has-this' bit.
2811         (Method::GetCallingConvention): Implement, returns the calling
2812         convention. 
2813         (Method::Define): Defines the type, a second pass is performed
2814         later to populate the methods.
2815
2816         (Constructor::ParameterTypes): implement a cache similar to the
2817         one on Method::ParameterTypes, useful later when we do semantic
2818         analysis. 
2819
2820         (TypeContainer::EmitMethod):  New method.  Emits methods.
2821
2822         * expression.cs: Removed MethodGroup class from here.
2823         
2824         * parameter.cs (Parameters::GetCallingConvention): new method.
2825
2826 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
2827
2828         * class.cs (TypeContainer::Populate): Drop RootContext from the
2829         argument. 
2830
2831         (Constructor::CallingConvention): Returns the calling convention.
2832         (Constructor::ParameterTypes): Returns the constructor parameter
2833         types. 
2834         
2835         (TypeContainer::AddConstructor): Keep track of default constructor
2836         and the default static constructor.
2837
2838         (Constructor::) Another class that starts using `public readonly'
2839         instead of properties. 
2840
2841         (Constructor::IsDefault): Whether this is a default constructor. 
2842
2843         (Field::) use readonly public fields instead of properties also.
2844
2845         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
2846         track of static constructors;  If none is used, turn on
2847         BeforeFieldInit in the TypeAttributes. 
2848
2849         * cs-parser.jay (opt_argument_list): now the return can be null
2850         for the cases where there are no arguments. 
2851
2852         (constructor_declarator): If there is no implicit `base' or
2853         `this', then invoke the default parent constructor. 
2854         
2855         * modifiers.cs (MethodAttr): New static function maps a set of
2856         modifiers flags into a MethodAttributes enum
2857         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
2858         MethodAttr, TypeAttr to represent the various mappings where the
2859         modifiers are used.
2860         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
2861
2862 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
2863
2864         * parameter.cs (GetParameterInfo): Fix bug where there would be no
2865         method arguments.
2866
2867         * interface.cs (PopulateIndexer): Implemented the code generator
2868         for interface indexers.
2869
2870 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
2871
2872         * interface.cs (InterfaceMemberBase): Now we track the new status
2873         here.  
2874
2875         (PopulateProperty): Implement property population.  Woohoo!  Got
2876         Methods and Properties going today. 
2877
2878         Removed all the properties for interfaces, and replaced them with
2879         `public readonly' fields. 
2880
2881 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
2882
2883         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
2884         initialize their hashtables/arraylists only when they are needed
2885         instead of doing this always.
2886
2887         * parameter.cs: Handle refs and out parameters.
2888
2889         * cs-parser.jay: Use an ArrayList to construct the arguments
2890         instead of the ParameterCollection, and then cast that to a
2891         Parameter[] array.
2892
2893         * parameter.cs: Drop the use of ParameterCollection and use
2894         instead arrays of Parameters.
2895
2896         (GetParameterInfo): Use the Type, not the Name when resolving
2897         types. 
2898
2899 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
2900
2901         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
2902         and instead use public readonly fields.
2903
2904         * class.cs: Put back walking code for type containers.
2905
2906 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
2907
2908         * class.cs (MakeConstant): Code to define constants.
2909
2910         * rootcontext.cs (LookupType): New function.  Used to locate types 
2911
2912         
2913 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
2914
2915         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
2916         this System.Reflection code is.  Kudos to Microsoft
2917         
2918         * typemanager.cs: Implement a type cache and avoid loading all
2919         types at boot time.  Wrap in LookupType the internals.  This made
2920         the compiler so much faster.  Wow.  I rule!
2921         
2922         * driver.cs: Make sure we always load mscorlib first (for
2923         debugging purposes, nothing really important).
2924
2925         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
2926         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
2927
2928         * rootcontext.cs: Lookup types on their namespace;  Lookup types
2929         on namespaces that have been imported using the `using' keyword.
2930
2931         * class.cs (TypeContainer::TypeAttr): Virtualize.
2932         (Class::TypeAttr): Return attributes suitable for this bad boy.
2933         (Struct::TypeAttr): ditto.
2934         Handle nested classes.
2935         (TypeContainer::) Remove all the type visiting code, it is now
2936         replaced with the rootcontext.cs code
2937
2938         * rootcontext.cs (GetClassBases): Added support for structs. 
2939
2940 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
2941
2942         * interface.cs, statement.cs, class.cs, parameter.cs,
2943         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
2944         Drop use of TypeRefs, and use strings instead.
2945
2946 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
2947
2948         * rootcontext.cs: 
2949
2950         * class.cs (Struct::Struct): set the SEALED flags after
2951         checking the modifiers.
2952         (TypeContainer::TypeAttr): new property, returns the
2953         TypeAttributes for a class.  
2954
2955         * cs-parser.jay (type_list): Oops, list production was creating a
2956         new list of base types.
2957
2958         * rootcontext.cs (StdLib): New property.
2959         (GetInterfaceTypeByName): returns an interface by type name, and
2960         encapsulates error handling here.
2961         (GetInterfaces): simplified.
2962         (ResolveTree): Encapsulated all the tree resolution here.
2963         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
2964         types. 
2965         
2966         * driver.cs: Add support for --nostdlib, to avoid loading the
2967         default assemblies.
2968         (Main): Do not put tree resolution here. 
2969
2970         * rootcontext.cs: Beginning of the class resolution.
2971
2972 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
2973
2974         * rootcontext.cs: Provide better error reporting. 
2975
2976         * cs-parser.jay (interface_base): set our $$ to be interfaces.
2977
2978         * rootcontext.cs (CreateInterface): Handle the case where there
2979         are no parent interfaces.
2980         
2981         (CloseTypes): Routine to flush types at the end.
2982         (CreateInterface): Track types.
2983         (GetInterfaces): Returns an array of Types from the list of
2984         defined interfaces.
2985
2986         * typemanager.c (AddUserType): Mechanism to track user types (puts
2987         the type on the global type hash, and allows us to close it at the
2988         end). 
2989         
2990 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
2991
2992         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
2993         RecordInterface instead.
2994
2995         * cs-parser.jay: Updated to reflect changes above.
2996
2997         * decl.cs (Definition): Keep track of the TypeBuilder type that
2998         represents this type here.  Not sure we will use it in the long
2999         run, but wont hurt for now.
3000
3001         * driver.cs: Smaller changes to accomodate the new code.
3002
3003         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
3004         when done. 
3005
3006         * rootcontext.cs (CreateInterface):  New method, used to create
3007         the System.TypeBuilder type for interfaces.
3008         (ResolveInterfaces): new entry point to resolve the interface
3009         hierarchy. 
3010         (CodeGen): Property, used to keep track of the code generator.
3011
3012 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
3013
3014         * cs-parser.jay: Add a second production for delegate_declaration
3015         with `VOID'.
3016
3017         (enum_body): Put an opt_comma here instead of putting it on
3018         enum_body or enum_member_declarations so we can handle trailing
3019         commas on enumeration members.  Gets rid of a shift/reduce.
3020         
3021         (type_list): Need a COMMA in the middle.
3022
3023         (indexer_declaration): Tell tokenizer to recognize get/set
3024
3025         * Remove old targets.
3026
3027         * Re-add the parser target.
3028
3029 2001-07-13  Simon Cozens <simon@simon-cozens.org>
3030
3031         * cs-parser.jay: Add precendence rules for a number of operators
3032         ot reduce the number of shift/reduce conflicts in the grammar.
3033         
3034 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
3035
3036         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
3037         and put it here.
3038
3039         Get rid of old crufty code.
3040
3041         * rootcontext.cs: Use this to keep track of the parsed
3042         representation and the defined types available to the program. 
3043
3044         * gen-treedump.cs: adjust for new convention.
3045
3046         * type.cs: Split out the type manager, and the assembly builder
3047         from here. 
3048
3049         * typemanager.cs: the type manager will live here now.
3050
3051         * cil-codegen.cs: And the code generator here. 
3052
3053 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
3054
3055         * makefile: Fixed up for easy making.
3056
3057 2001-07-13  Simon Cozens <simon@simon-cozens.org>
3058
3059         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
3060         the 
3061
3062         (unary_expression): Expand pre_increment_expression and
3063         post_decrement_expression to reduce a shift/reduce.
3064
3065 2001-07-11  Simon Cozens
3066
3067         * cs-tokenizer.cs: Hex numbers should begin with a 0.
3068
3069         Improve allow_keyword_as_indent name.
3070
3071 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
3072
3073         * Adjustments for Beta2. 
3074
3075 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
3076
3077         * decl.cs: Added `Define' abstract method.
3078         (InTransit): new property, used to catch recursive definitions. 
3079
3080         * interface.cs: Implement `Define'. 
3081
3082         * modifiers.cs: Map Modifiers.constants to
3083         System.Reflection.TypeAttribute flags.
3084
3085         * class.cs: Keep track of types and user-defined types.
3086         (BuilderInit): New method for creating an assembly
3087         (ResolveType): New function to launch the resolution process, only
3088         used by interfaces for now.
3089
3090         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
3091         that are inserted into the name space. 
3092
3093 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
3094
3095         * ARGH.  I have screwed up my tree so many times due to the use of
3096         rsync rather than using CVS.  Going to fix this at once. 
3097
3098         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
3099         load types.
3100
3101 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
3102
3103         * Experiment successful: Use System.Type rather that our own
3104         version of Type.  
3105
3106 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
3107
3108         * cs-parser.jay: Removed nsAliases from here.
3109
3110         Use new namespaces, handle `using XXX;' 
3111
3112         * namespace.cs: Reimplemented namespace handling, use a recursive
3113         definition of the class.  Now we can keep track of using clauses
3114         and catch invalid using clauses.
3115
3116 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
3117
3118         * gen-treedump.cs: Adapted for all the renaming.
3119
3120         * expression.cs (Expression): this class now has a Type property
3121         which returns an expression Type.
3122
3123         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
3124         `Type', as this has a different meaning now in the base
3125
3126 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
3127
3128         * interface.cs, class.cs: Removed from all the sources the
3129         references to signature computation, as we can not do method
3130         signature computation during the parsing time, as we are not
3131         trying to solve at that point distinguishing:
3132
3133         class X {
3134                 void a (Blah x) {}
3135                 void a (NS.Blah x) {}
3136         }
3137
3138         Which depending on the context might be valid or not, as we do not
3139         know if Blah is the same thing as NS.Blah at that point.
3140
3141         * Redid everything so the code uses TypeRefs now instead of
3142         Types.  TypeRefs are just temporary type placeholders, that need
3143         to be resolved.  They initially have a pointer to a string and the
3144         current scope in which they are used.  This is used later by the
3145         compiler to resolve the reference to an actual Type. 
3146
3147         * DeclSpace is no longer a CIR.Type, and neither are
3148         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
3149         are all DeclSpaces, but no Types. 
3150
3151         * type.cs (TypeRefManager): This implements the TypeRef manager,
3152         which keeps track of all the types that need to be resolved after
3153         the parsing has finished. 
3154
3155 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
3156
3157         * ARGH.  We are going to have to store `foreach' as a class rather
3158         than resolving it, as we need to verify error 1579 after name
3159         resolution.   *OR* we could keep a flag that says `This request to
3160         IEnumerator comes from a foreach statement' which we can then use
3161         to generate the error.
3162
3163 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
3164
3165         * class.cs (TypeContainer.AddMethod): we now add methods to the
3166         MethodGroup instead of the method hashtable.  
3167
3168         * expression.cs: Add MethodGroup abstraction, which gets us one
3169         step closer to the specification in the way we handle method
3170         declarations.  
3171
3172         * cs-parser.jay (primary_expression): qualified_identifier now
3173         tried to match up an identifier to a local variable reference or
3174         to a parameter reference.
3175
3176         current_local_parameters is now a parser global variable that
3177         points to the current parameters for the block, used during name
3178         lookup.
3179
3180         (property_declaration): Now creates an implicit `value' argument to
3181         the set accessor.
3182
3183 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
3184
3185         * parameter.cs: Do not use `param' arguments as part of the
3186         signature, per the spec.
3187
3188 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
3189
3190         * decl.cs: Base class for classes, structs and interfaces.  This
3191         is the "Declaration Space" 
3192
3193         * cs-parser.jay: Use CheckDef for checking declaration errors
3194         instead of having one on each function.
3195
3196         * class.cs: Factor out some code for handling error handling in
3197         accordance to the "Declarations" section in the "Basic Concepts"
3198         chapter in the ECMA C# spec.
3199
3200         * interface.cs: Make all interface member classes derive from
3201         InterfaceMemberBase.
3202
3203 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
3204
3205         * Many things: all interfaces are parsed and generated in
3206         gen-treedump.  Support for member variables, constructors,
3207         destructors, properties, constants is there.
3208
3209         Beginning of the IL backend, but very little done, just there for
3210         testing purposes. 
3211
3212 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
3213
3214         * cs-parser.jay: Fix labeled statement.
3215
3216         * cs-tokenizer.cs (escape): Escape " and ' always.
3217         ref_line, ref_name: keep track of the line/filename as instructed
3218         by #line by the compiler.
3219         Parse #line.
3220
3221 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
3222
3223         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
3224         to match the values in System.CodeDOM.
3225
3226         Divid renamed to Divide.
3227
3228         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
3229         statements. 
3230         (Statements.set): remove.
3231
3232         * System.CodeDOM/CodeCatchClause.cs: always have a valid
3233         statements. 
3234
3235         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
3236         falseStatements always have valid values. 
3237
3238         * cs-parser.jay: Use System.CodeDOM now.
3239