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