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