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