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