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