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