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