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