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