web site updates
[mono.git] / mcs / mcs / ChangeLog
1 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
2
3         * driver.cs: Add support for --resources.
4
5         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6         Make all types for the various array helper methods be integer.
7
8         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
9         CheckState to ConvCast.
10
11         (ConvCast): Now it takes a `checked' state argument, to avoid
12         depending on the emit context for the conversion, and just using
13         the resolve time setting.
14
15         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16         instead of Invocation.EmitArguments.  We do not emit the original
17         arguments, instead we emit those which have been converted to
18         unsigned int expressions.
19
20         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21
22         * codegen.cs: ditto.
23
24         * expression.cs (LocalVariableReference): Drop the use of the
25         Store function that depended on the variable index.
26
27         * statement.cs (VariableInfo): Drop the `Idx' property from this
28         class, as this is not taking into account the indexes for
29         temporaries tat we generate during the execution, getting the
30         indexes wrong.
31
32         * class.cs: First emit class initializers, then call the parent
33         constructor. 
34
35         * expression.cs (Binary): Fix opcode emision.
36         (UnaryMutator.EmitCode): Support checked code generation
37
38         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
39         matches for events for both the Static and Instance scans,
40         pointing to the same element.   Fix that.
41
42 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
43
44         * rootcontext.cs (ResolveTree): Always set the
45         interface_resolve_order, because nested interfaces will be calling
46         into us.
47
48         * class.cs (GetInterfaceOrClass): Track the same resolution
49         process used by TypeManager.LookupType.  This fixes the nested
50         type lookups in class declarations (separate path from
51         LookupType). 
52
53         (TypeContainer.DefineType): Also define nested interfaces.
54         (TypeContainer.RegisterOrder): New public function used to
55         register the order in which child interfaces need to be closed.
56
57         Nested interfaces need to be closed after their parents have been
58         created. 
59         
60         * interface.cs (InterfaceAttr): Put all the logic for computing
61         the interface attribute here. 
62
63         (DefineInterface): Register our interface order with the
64         RootContext or with the TypeContainer depending on the case.
65
66 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
67
68         * cs-parser.jay: rework foreach statement to work with the new
69         changes to the policy on SimpleNames.
70         
71         * report.cs: support Stacktrace on warnings as well.
72
73         * makefile: drop --unsafe and /unsafe from the compile.
74
75 2002-03-13  Ravi Pratap  <ravi@ximian.com>
76
77         * ecore.cs (StandardConversionExists): Modify to take an Expression
78         as the first parameter. Ensure we do null -> reference type conversion
79         checking.
80
81         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
82         temporary Expression objects.
83
84 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
85
86         * interface.cs: workaround bug in method overloading resolution
87         (there is already a bugzilla bug for it).
88
89 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
90
91         We could also solve this problem by having a separate path for
92         performing type lookups, instead of DoResolve, we could have a
93         ResolveType entry point, and only participating pieces of the
94         production (simplename, deref, array) would implement this. 
95         
96         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
97         signal SimpleName to only resolve type names and not attempt to
98         resolve anything else.
99
100         * expression.cs (Cast): Set the flag.
101
102         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
103
104         * class.cs: Only report 108 if there is no `new' modifier.
105
106         * cs-parser.jay: rework foreach statement to work with the new
107         changes to the policy on SimpleNames.
108         
109         * report.cs: support Stacktrace on warnings as well.
110
111         * makefile: drop --unsafe and /unsafe from the compile.
112
113 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
114
115         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
116         lookups here, instead of doing that at parse time.  This means
117         that our grammar will not introduce `LocalVariableReferences' as
118         expressions at this point.  That solves the problem of code like
119         this:
120
121         class X {
122            static void Main ()
123            { int X = 1;
124             { X x = null }}}
125
126         This is only half the fix.  The full fix requires parameters to
127         also be handled in this way.
128
129         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
130         makes the use more obvious of the DeclSpace.  The
131         ec.TypeContainer.TypeBuilder is now only used to pull the
132         TypeBuilder for it.
133
134         My theory is that I can get rid of the TypeBuilder completely from
135         the EmitContext, and have typecasts where it is used (from
136         DeclSpace to where it matters).  
137
138         The only pending problem is that the code that implements Aliases
139         is on TypeContainer, and probably should go in DeclSpace.
140
141         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
142         lookups here, instead of doing that at parse time.  This means
143         that our grammar will not introduce `LocalVariableReferences' as
144         expressions at this point.  That solves the problem of code like
145         this:
146
147         class X {
148            static void Main ()
149            { int X = 1;
150             { X x = null }}}
151
152         This is only half the fix.  The full fix requires parameters to
153         also be handled in this way.
154
155         * class.cs (Property.DefineMethod): When implementing an interface
156         method, set newslot, when implementing an abstract method, do not
157         set the flag (before we tried never setting it, or always setting
158         it, which is the difference).
159         (Indexer.DefineMethod): same.
160         (Method.DefineMethod): same.
161
162         * ecore.cs: Only set the status used flag if we get back a Field.
163
164         * attribute.cs: Temporary hack, so Paolo can keep working.
165
166 2002-03-08  Ravi Pratap  <ravi@ximian.com>
167
168         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
169         the unmanaged type in the case we have a MarshalAs attribute.
170
171         (Resolve): Handle the case when we are parsing the special MarshalAs
172         attribute [we need to store the unmanaged type to use later]
173         
174         * typemanager.cs (marshal_as_attr_type): Built in type for the 
175         MarshalAs Attribute.
176
177         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
178         on parameters and accordingly set the marshalling info.
179         
180 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
181
182         * class.cs: Optimizing slightly by removing redundant code after
183         we switched to the `NoTypes' return value.
184         (Property.DefineMethod): use NoTypes here too.
185
186         This fixes the bug I introduced in my last batch of changes.
187
188 2002-03-05  Ravi Pratap  <ravi@ximian.com>
189
190         * tree.cs (RecordEnum): Add. We now keep track of enums too.
191
192         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
193         Enums since those are types too. 
194
195         * cs-parser.jay (enum_declaration): Record enums as we parse them.
196         
197         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
198         thanks to a call during the lookup process.
199
200 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
201
202         * statement.cs (Foreach): Lots of work to accomodate a particular
203         kind of foreach statement that I had not kept in mind.  It is
204         possible to have foreachs on classes that provide a GetEnumerator
205         method that return objects that implement the "pattern" for using
206         a foreach, there is no need to support GetEnumerator
207         specifically. 
208
209         This is needed to compile nant.
210
211         * decl.cs: Only report 114 if the member is not `Finalize' and if
212         the warning level is at least 2.
213
214         * class.cs: Moved the compare function from Method to
215         MethodSignature. 
216
217         (MethodSignature.InheritableMemberSignatureCompare): Add new
218         filter function that is used to extract inheritable methods from a
219         class. 
220
221         (Method.Define): Use the new `inheritable_method_signature_filter'
222         delegate
223
224         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
225         command. 
226
227 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
228
229         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
230
231         * cs-parser.jay: Add opt_semicolon to the interface declaration.
232
233         * expression.cs: Pass location information to
234         ConvertImplicitStandard. 
235
236         * class.cs: Added debugging code to track return values from
237         interfaces. 
238
239 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
240
241         * expression.cs (Is.DoResolve): If either side of the `is' is an
242         interface, do not flag the warning.
243
244         * ecore.cs (ImplicitReferenceConversion): We need a separate test
245         for interfaces
246
247         * report.cs: Allow for --fatal to be used with --probe.
248         
249         * typemanager.cs (NoTypes): Move the definition for the empty Type
250         array here. 
251
252         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
253         properties. 
254         (TypeContainer.DefineProxy): New function used to proxy to parent
255         implementations when implementing interfaces.
256         (TypeContainer.ParentImplements): used to lookup if our parent
257         implements a public function that is required by an interface.
258         (TypeContainer.VerifyPendingMethods): Hook this up.
259
260         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
261         `modules' and `assemblies' arraylists into arrays.  We only grow
262         these are the very early start up of the program, so this improves
263         the speedof LookupType (nicely measured).
264
265         * expression.cs (MakeByteBlob): Replaced unsafe code with
266         BitConverter, as suggested by Paolo.
267
268         * cfold.cs (ConstantFold.Binary): Special case: perform constant
269         folding of string concatenation, but if either side is a string,
270         and the other is not, then return null, and let the runtime use
271         the concatenation on the string plus the object (using
272         `Object.ToString'). 
273
274 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
275
276         Constant Folding has been implemented now.
277         
278         * expression.cs (Unary.Reduce): Do not throw an exception, catch
279         the error instead on types that are not supported in one's
280         complement. 
281
282         * constant.cs (Constant and all children): New set of functions to
283         perform implict and explicit conversions.
284         
285         * ecore.cs (EnumConstant): Implement the new functions to perform
286         conversion by proxying to the child expression.
287
288         * codegen.cs: (ConstantCheckState): Constant evaluation has its
289         own separate setting that can not be turned off from the command
290         line using --unchecked or --checked and is only controlled using
291         the checked/unchecked statements and expressions.  This setting is
292         used by the constant folder to flag errors.
293
294         * expression.cs (CheckedExpr, UncheckedExpr): Set the
295         ConstantCheckState as well.   
296
297         During Resolve, they also have to flag the state, because the
298         constant folder runs completely in the Resolve phase.
299
300         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
301         well.
302
303 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
304
305         * cfold.cs: New file, this file contains the constant folder.
306         
307         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
308         argument to track whether we are using the resulting address to
309         load or store a value and provide better error messages. 
310
311         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
312         new AddressOf arguments.
313
314         * statement.cs (Foreach.EmitCollectionForeach): Update
315
316         * expression.cs (Argument.Emit): Call AddressOf with proper
317         arguments to track usage.
318
319         (New.DoEmit): Call AddressOf with new arguments.
320
321         (Unary.Emit): Adjust AddressOf call.
322
323 2002-03-01  Ravi Pratap  <ravi@ximian.com>
324
325         * cs-parser.jay (member_access): Change the case for pre-defined types
326         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
327         this suggestion.
328
329         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
330         a method body.
331
332         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
333         essentially like methods and apply attributes like MethodImplOptions to them too.
334
335         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
336         not being null.
337
338         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
339         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
340         is the DeclSpace.
341
342         * Update code everywhere accordingly.
343
344         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
345
346         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
347
348 2002-02-28  Ravi Pratap  <ravi@ximian.com>
349
350         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
351         try performing lookups against those instead of jumping straight into using
352         the 'using' clauses.
353
354         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
355
356         (LookupType): Perform lookups in implicit parents too.
357
358         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
359         sequence as RootContext.LookupType. 
360
361         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
362         the various cases of namespace lookups into this method.
363
364 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
365
366         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
367         in positional arguments)
368
369         * class.cs (Operator): Update the AllowedModifiers to contain
370         extern. 
371
372         * cs-parser.jay: Update operator declaration to allow for the
373         operator body to be empty.
374
375         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
376         values. 
377
378 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
379
380         * class.cs (Method.Emit): Label parameters.
381
382         * driver.cs: Return 1 or 0 as the program exit code.
383
384 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
385
386         * expression.cs: Special case the `null' object when trying to
387         auto-compute the type, as anything can be explicitly converted to
388         that. 
389
390         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
391         spotting this Paolo.
392
393         (Expression.ImplicitNumericConversion): Perform comparissions of
394         the type using the underlying type in the case of an enumeration
395         rather than using the enumeration type for the compare.
396
397         Cope with the underlying == type case, which is not possible to
398         catch before. 
399
400         (Expression.ConvertNumericExplicit): Perform comparissions of
401         the type using the underlying type in the case of an enumeration
402         rather than using the enumeration type for the compare.
403
404         * driver.cs: If the user does not supply an extension, assume .exe
405
406         * cs-parser.jay (if_statement): Rewrote so that we can track the
407         location for the if statement.
408
409         * expression.cs (Binary.ConstantFold): Only concat strings when
410         the operation is "+", not everything ;-)
411
412         * statement.cs (Statement.EmitBoolExpression): Take a location
413         argument. 
414         (If, While, Do): Track location.
415
416         * expression.cs (Binary.ResolveOperator): In the object + string
417         case, I was missing a call to ConvertImplicit
418
419 2002-02-25  Ravi Pratap  <ravi@ximian.com>
420
421         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
422         Location arguments. Ensure we use RootContext.LookupType to do our work
423         and not try to do a direct Type.GetType and ModuleBuilder.GetType
424
425         * interface.cs (PopulateMethod): Handle the type of the parameter being
426         null gracefully.
427
428         * expression.cs (Invocation.BetterFunction): Handle the case when we 
429         have a params method with no fixed arguments and a call is made with no
430         arguments.
431
432 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
433
434         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
435         the verbatim-string-literal
436
437         * support.cs (InternalParameters.ParameterModifier): handle null
438         fixed parameters.
439         (InternalParameters.ParameterType): ditto.
440
441         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
442         duplicating the name of the variable parameter.
443         (GetParameterByName): Fix bug where we were not looking up array
444         paramters if they were the only present (thanks Paolo!).
445         (GetParameterInfo): We only have an empty set of types if both
446         fixed and array are set to null.
447         (GetParameterInfo-idx): Handle FixedParameter == null
448
449         * cs-parser.jay: Handle the case where there is no catch
450         statements (missing null test).
451
452 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
453
454         * driver.cs (MainDriver): Be conservative on our command line
455         handling.
456
457         Catch DirectoryNotFoundException when calling GetFiles.
458         
459         (SplitPathAndPattern): Used to split the input specification into
460         a path and a pattern that we can feed to Directory.GetFiles.
461
462 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
463
464         * statement.cs (Fixed): Implement the last case of the Fixed
465         statement (string handling).
466
467         * expression.cs (StringPtr): New class used to return a char * to
468         a string;  Used by the Fixed statement.
469
470         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
471
472         * expression.cs (Binary.ResolveOperator): Remove redundant
473         MemberLookup pn parent type.
474         Optimize union call, we do not need a union if the types are the same.
475         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
476         type.
477
478         Specialize the use of MemberLookup everywhere, instead of using
479         the default settings. 
480
481         (StackAlloc): Implement stackalloc keyword.
482
483         * cs-parser.jay: Add rule to parse stackalloc.
484         
485         * driver.cs: Handle /h, /help, /?
486
487         * expression.cs (MakeByteBlob): Removed the hacks we had in place
488         before we supported unsafe code.
489         
490         * makefile: add --unsafe to the self compilation of mcs.
491
492 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
493
494         * expression.cs (PointerArithmetic): New class that is used to
495         perform pointer arithmetic.
496         (Binary.Resolve): Handle pointer arithmetic
497         Handle pointer comparission.
498         (ArrayPtr): Utility expression class that is used to take the
499         address of an array.
500
501         (ElementAccess): Implement array access for pointers
502         
503         * statement.cs (Fixed): Implement fixed statement for arrays, we
504         are missing one more case before we are done.
505
506         * expression.cs (Indirection): Implement EmitAssign and set the
507         ExprClass to Variable.  This allows pointer dereferences to be
508         treated as variables, and to have values assigned to them.
509         
510         * ecore.cs (Expression.StoreFromPtr): New utility function to
511         store values dereferencing.
512
513 2002-02-20  Ravi Pratap  <ravi@ximian.com>
514
515         * expression.cs (Binary.ResolveOperator): Ensure that we are
516         not trying to operate on a void type - this fixes the reported
517         bug.
518
519         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
520         the parent implementation is sealed.
521
522         * ../errors/cs0239.cs : Add.
523
524         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
525
526         * typemanager.cs (unverifiable_code_type): Corresponds to 
527         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
528         which have unsafe code in them.
529
530         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
531         unsafe context.
532
533 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
534
535         * cs-tokenizer.cs: Add support for @"litreal strings"
536
537         Make tokenizer accept pre-processor directives
538         on any column (remove the old C-like limitation). 
539
540         * rootcontext.cs (EmitCode): Emit any global attributes.
541         (AddGlobalAttributes): Used to keep track of assembly attributes. 
542
543         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
544
545         * cs-parser.jay: Add support for global attributes.  
546
547 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
548
549         * expression.cs (Indirection): New helper class.  Unary will
550         create Indirection classes to be able to implement the
551         IMemoryLocation interface on it.
552
553 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
554
555         * cs-parser.jay (fixed_statement): reference the right statement.
556
557         * statement.cs (Fixed.Emit): Finish implementing the fixed
558         statement for the &x case.
559
560 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
561
562         * class.cs (Property.Define, Method.Define): Remove newslot when
563         `implementing'.  
564
565         * modifiers.cs: My use of NewSlot when `Abstract' was set was
566         wrong.  NewSlot should only be used if the `new' keyword is present.
567
568         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
569         locating our system dir.  Sorry about this.
570
571 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
572
573         * driver.cs (GetSystemDir): Compute correctly the location of our
574         system assemblies.  I was using the compiler directory instead of
575         the library directory.
576
577 2002-02-13  Ravi Pratap  <ravi@ximian.com>
578
579         * expression.cs (BetterFunction): Put back in what Miguel commented out
580         since it is the correct fix. The problem is elsewhere ;-)
581
582         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
583         parameters of the parms method are themselves compatible or not !
584
585         (StandardConversionExists): Fix very dangerous bug where we were forgetting
586         to check that a class implements an interface before saying that an implicit
587         conversion was allowed. Use ImplementsInterface to do the checking.
588
589 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
590
591         * class.cs (Method.Define): Track whether we are an explicit
592         implementation or not.  And only call DefineMethodOverride if we
593         are an explicit implementation.
594
595         (Property.DefineMethod): Ditto.
596
597 2002-02-11  Ravi Pratap  <ravi@ximian.com>
598
599         * expression.cs (BetterFunction): Catch hideous bug which was
600          preventing us from detecting ambiguous calls due to implicit casts i.e
601         cs0121.
602
603 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
604
605         * support.cs (Pair): Remove un-needed method.  I figured why I was
606         getting the error in cs-parser.jay, the variable in a foreach loop
607         is readonly, and the compiler does not really treat this as a variable.
608
609         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
610         instead of EQUALS in grammar.  
611
612         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
613
614         * expression.cs (Unary.DoResolve): Check whether the argument is
615         managed or not.
616
617 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
618
619         * support.cs: Api for Pair to set a value.  Despite the fact that
620         the variables are public the MS C# compiler refuses to compile
621         code that accesses the field if the variable is part of a foreach
622         statement. 
623
624         * statement.cs (Fixed): Begin implementation of the fixed
625         statement.
626
627         (Block.AddVariable): Return the VariableInfo on success and null
628         on failure instead of true/false. 
629
630         * cs-parser.jay (foreach): Catch errors on variables already
631         defined (we were ignoring this value before) and properly unwind
632         the block hierarchy
633
634         (fixed_statement): grammar for the fixed statement.
635
636 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
637
638         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
639         pointer types to be incretemented.
640
641         (SizeOf): Implement.
642
643         * cs-parser.jay (pointer_member_access): Implement
644         expr->IDENTIFIER production.
645
646         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
647         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
648         on safe contexts.
649
650         (Unary): Implement indirection.
651
652         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
653         use in non-unsafe context).
654
655         (SimpleName.DoResolve): Check for pointers in field access on safe
656         contexts. 
657
658         (Expression.LoadFromPtr): Factor the load-indirect code in this
659         function.  This was duplicated in UnboxCast and ParameterReference
660
661 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
662
663         * expression.cs (ComposedCast): report an error if a pointer cast
664         is used in a safe region.
665
666         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
667         pointer type casts in unsafe context.
668
669         * codegen.cs (EmitContext): Set up IsUnsafe.
670
671         * cs-parser.jay (non_expression_type): Add productions for pointer
672         casts. 
673
674         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
675         code.  We should not use force into static mode if the method is
676         not virtual.  Fixes bug in MIS
677
678         * statement.cs (Do.Emit, While.Emit, For.Emit,
679         Statement.EmitBoolExpression): Add support to Do and While to
680         propagate infinite loop as `I do return' semantics.
681
682         Improve the For case to also test for boolean constants.
683
684         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
685         to the list of attributes we can add.
686
687         Remove `EmitContext' argument.
688
689         * class.cs (Method.Define): Apply parameter attributes.
690         (Constructor.Define): Apply parameter attributes.
691         (MethodCore.LabelParameters): Move here the core of labeling
692         parameters. 
693
694         * support.cs (ReflectionParameters.ParameterModifier,
695         InternalParameters.ParameterModifier): Use IsByRef on the type and
696         only return the OUT bit for these parameters instead of in/out/ref
697         flags.
698
699         This is because I miss-understood things.  The ParameterInfo.IsIn
700         and IsOut represent whether the parameter has the [In] and [Out]
701         attributes set.  
702
703 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
704
705         * ecore.cs (FieldExpr.Emit): Release temporaries.
706
707         * assign.cs (LocalTemporary.Release): new function.
708
709         * codegen.cs (EmitContext.GetTemporaryStorage,
710         EmitContext.FreeTemporaryStorage): Rework the way we deal with
711         temporary storage.  Now we can "put back" localbuilders when we
712         are done with them
713
714 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
715
716         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
717         need to make a copy of the variable to generate verifiable code.
718
719 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
720
721         * driver.cs: Compute dynamically the system directory.
722
723         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
724         Slower, but more generally useful.  Used by the abstract
725         registering implementation. 
726
727         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
728         the rules for the special rule on Type/instances.  First check if
729         we have the same name, and if so, try that special static path
730         rather than the instance path.
731         
732 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
733
734         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
735         for, while and if.
736
737         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
738         Enum, ValueType, Delegate or Array for non-corlib compiles.
739
740         * cs-tokenizer.cs: Catch long identifiers (645)
741
742         * typemanager.cs (IndexerPropetyName): Ravi never tested this
743         piece of code.
744
745         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
746         fix, we were returning too early, so we were not registering
747         pending methods from abstract classes.
748
749         Do not register pending methods if the class is abstract.
750
751         * expression.cs (Conditional.DoResolve): Report circular implicit
752         conversions when we neecd to compute it for conditional
753         expressions. 
754
755         (Is.DoResolve): If the expression is always of the provided type,
756         flag warning 183.  If the expression can not ever be of the
757         provided type flag warning 184.
758
759         * class.cs: Catch 169 as well.
760
761         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
762         read. 
763
764 2002-01-18  Nick Drochak  <ndrochak@gol.com>
765
766         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
767
768 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
769
770         * interface.cs: (PopulateMethod): Check for pointers being defined
771         only if the unsafe context is active.
772         (PopulateProperty): ditto.
773         (PopulateIndexer): ditto.
774
775         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
776         specified.  If pointers are present, make sure that they are
777         present in an unsafe context.
778         (Constructor, Constructor.Define): ditto.
779         (Field, Field.Define): ditto.
780         (Property, Property.Define): ditto.
781         (Event, Event.Define): ditto.
782
783         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
784         hashtable if there are classes or structs defined.
785
786         * expression.cs (LocalVariableReference.DoResolve): Simplify this
787         code, as the constant resolution moved.
788
789         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
790         the metadata, so we can flag error 133. 
791
792         * decl.cs (MemberCore.UnsafeOK): New function to test that a
793         pointer is being declared in an unsafe context.
794
795 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
796
797         * modifiers.cs (Modifiers.Check): Require a Location argument.
798         Report error 227 for Unsafe use.
799
800         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
801
802         * statement.cs (For.Emit): If the test is null, then report that
803         we do `return', as we wont reach anything afterwards.
804
805         (Switch.SwitchGoverningType): Track the expression that matched
806         the conversion.
807
808         * driver.cs: Allow negative numbers as an error code to flag.
809
810         * cs-parser.jay: Handle 1551.
811
812         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
813
814 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
815
816         * cs-parser.jay: Report 1518 (type declaration can only contain
817         class, struct, interface, enum or delegate)
818
819         (switch_label): Report 1523 (keywords `case' or `default' must
820         preced code)
821
822         (opt_switch_sections): Report 1522 (empty switch)
823
824         * driver.cs: Report 1515 (response file specified multiple times)
825         Report 1516 (Source file specified multiple times).
826
827         * expression.cs (Argument.Resolve): Signal 1510
828
829         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
830         access not allowed in static code)
831
832 2002-01-11  Ravi Pratap  <ravi@ximian.com>
833
834         * typemanager.cs (IsPointerType): Utility method which we are going
835         to need a lot.
836
837         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
838         the object type, so we take care of that.
839
840         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
841         
842         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
843         added to non-params parameters :-)
844
845         * typemanager.cs (CSharpName): Include 'void' type too. 
846
847         (void_ptr_type): Include in the set of core types.
848
849         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
850         duplicating code.
851
852         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
853         an unsafe context.
854
855         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
856         completely forgotten about it.
857
858 2002-01-10  Ravi Pratap  <ravi@ximian.com>
859
860         * cs-parser.jay (pointer_type): Add. This begins our implementation
861         of parsing rules for unsafe code.
862
863         (unsafe_statement): Implement.
864
865         (embedded_statement): Modify to include the above.
866
867         * statement.cs (Unsafe): Implement new class for unsafe blocks.
868
869         * codegen.cs (EmitContext.InUnsafe): Add. This determines
870         if the current context is an unsafe one.
871
872         * cs-parser.jay (local_variable_pointer_type): Since local variable types
873         are handled differently, we need separate rules for them.
874
875         (local_variable_declaration): Update to use local_variable_pointer_type
876         to allow variable declarations of unmanaged pointer types.
877
878         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
879         in unsafe contexts.
880
881         * ../errors/cs0214.cs : Add.
882
883 2002-01-16  Nick Drochak  <ndrochak@gol.com>
884
885         * makefile: remove 'response' file when cleaning.
886
887 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
888
889         * cs-parser.jay: Report 1524.
890
891 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
892
893         * typemanager.cs (RegisterMethod): drop checking if we have
894         registered this from here
895
896 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
897
898         * class.cs (Method.EmitDestructor): Implement calling our base
899         destructor. 
900
901         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
902         value of InFinally.
903
904         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
905         this routine and will wrap the call in a try/catch block.  Deal
906         with the case.
907
908 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
909
910         * ecore.cs (Expression.MemberLookup): instead of taking a
911         parameter `same_type' that was used to tell whether we could
912         access private members we compute our containing type from the
913         EmitContext.
914
915         (FieldExpr): Added partial support for volatile fields.  This does
916         not work for volatile fields exposed from assemblies, as I can not
917         figure out how to extract the modreq from it.
918
919         Updated all the source files to use this.
920
921         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
922         because it is referenced by MemberLookup very often. 
923
924 2002-01-09  Ravi Pratap  <ravi@ximian.com>
925
926         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
927         TypeBuilder.GetCustomAttributes to retrieve what we need.
928
929         Get rid of redundant default_member_attr_type as this is the same as
930         default_member_type which already exists.
931
932         * interface.cs, attribute.cs : Update accordingly.
933         
934 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
935
936         * typemanager.cs: Enable IndexerPropertyName again.  It does not
937         work for TYpeBuilders though.  Ravi, can you please fix this?
938
939         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
940
941         * expression.cs (Argument.Emit): Handle the case of ref objects
942         being passed to ref functions;  
943
944         (ParameterReference.EmitLoad): Loads the content of the pointer
945         without dereferencing.
946
947 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
948
949         * cs-tokenizer.cs: Implemented the pre-processing expressions.
950
951 2002-01-08  Ravi Pratap  <ravi@ximian.com>
952
953         * class.cs (Indexer.DefineMethod): Incorporate the interface
954         type in the name of the method if we are doing explicit interface
955         implementation.
956
957         * expression.cs (ConversionExists): Remove as it is completely obsolete.
958
959         (BetterConversion): Fix extremely trivial bug where we were referring to
960         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
961         again !
962
963         * ../errors/bug16.cs : Add although we have fixed it.
964
965 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
966
967         * expression.cs (BaseIndexer): Begin implementation.
968
969         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
970
971         * cs-parser.jay (indexer_declarator): Use qualified_identifier
972         production directly to remove a shift/reduce, and implement
973         explicit interface implementation.
974
975         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
976         after a floating point suffix.
977
978         * expression.cs (DoNumericPromotions): Improved the conversion for
979         uint/uint.  If we have a constant, we avoid doing a typecast to a
980         larger type.
981
982         * class.cs (Indexer): Implement explicit interface implementation
983         for indexers.
984         
985 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
986
987         * class.cs: make the default instance constructor public and hidebysig.
988
989 2001-01-03  Ravi Pratap  <ravi@ximian.com>
990
991         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
992         so we can call it from elsewhere.
993
994         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
995         we emit it internally if the class has a defined indexer; otherwise the user
996         emits it by decorating the class definition with the DefaultMemberAttribute.
997
998         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
999         attribute is not used on a type which defines an indexer.
1000
1001         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
1002         character when we skip whitespace.
1003
1004         * ../errors/cs0646.cs : Add.
1005
1006 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
1007
1008         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
1009         again. 
1010
1011         * makefile: Add practical target `mcs3.exe' which builds the third
1012         generation compiler. 
1013
1014         * expression.cs (New): Fix structures constructor calling.
1015
1016         * class.cs (Property, Method, Indexer): Emit Final flag on the
1017         method if we are an interface implementation and we are not
1018         abstract. 
1019
1020         * ecore.cs (PropertyExpr): New public field `IsBase', tells
1021         whether this property is referencing a `base' method.
1022
1023         * expression.cs (Invocation.EmitCall): take an extra argument:
1024         is_base, this is used to determine whether the `call' or
1025         `callvirt' opcode should be used.
1026
1027         
1028         * delegate.cs: update EmitCall.
1029
1030         * class.cs (Method.Define): Set NewSlot for the cases where we are
1031         not implementing an interface method.
1032
1033         (Property.Define): ditto.
1034
1035 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
1036
1037         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
1038         'r'.  Allows mcs to parse itself fully.
1039
1040 2002-01-02  Ravi Pratap  <ravi@ximian.com>
1041
1042         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
1043         of the number of initializers that require the InitializeArray method.
1044
1045         (CheckIndices): Store the Expression in all cases - not the plain value. Also
1046         update the above field where necessary.
1047
1048         (MakeByteBlob): Update accordingly.
1049
1050         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
1051         greater than 2.
1052
1053         (EmitDynamicInitializers): Update in accordance with the new optimization.
1054
1055         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
1056         same OpCode applies.
1057
1058         * cs-parser.jay : Fix some glaring errors I introduced.
1059
1060 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
1061
1062         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
1063         so that we can check for name clashes there too.
1064
1065         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
1066         for interface indexers.
1067
1068         * interfaces.cs (Define): Emit the default member attribute.
1069
1070         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
1071         variable was being referred to while setting the value ;-)
1072
1073 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
1074
1075         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
1076         byte-by-byte information when we know the data is zero.
1077
1078         Make the block always a multiple of 4, because
1079         DefineInitializedData has a bug.
1080
1081         * assign.cs: Fix, we should assign from the temporary, not from
1082         the source. 
1083
1084         * expression.cs (MakeByteBlob): Fix my incorrect code.
1085
1086 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
1087
1088         * typemanager.cs (EnumToUnderlying): This function is used to get
1089         the underlying type from an enumeration, because it does not
1090         always work. 
1091
1092         * constant.cs: Use the I4_S form for values between -128 and 127.
1093
1094         * statement.cs (Block.LookupLabel): Looks up a label.
1095         (Block): Drop support for labeled blocks.
1096
1097         (LabeledStatement): New kind of statement that represents a label
1098         only.
1099
1100         (Goto): Finally implement this bad boy.
1101         
1102         * cs-parser.jay: Update to reflect new mechanism to implement
1103         labels.
1104
1105 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
1106
1107         * codegen.cs (EmitContext.This): a codegen property that keeps the
1108         a single instance of this instead of creating many different this
1109         instances. 
1110
1111         * delegate.cs (Delegate.DoResolve): Update to use the property;
1112
1113         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
1114
1115         * expression.cs (BaseAccess.DoResolve): Ditto.
1116
1117 2001-12-29  Ravi Pratap  <ravi@ximian.com>
1118
1119         * typemanager.cs (methodimpl_attr_type): Add to hold the type
1120         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
1121
1122         (InitCoreTypes): Update accordingly.
1123
1124         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
1125         so we can quickly store the state.
1126
1127         (ApplyAttributes): Set the correct implementation flags
1128         for InternalCall methods.
1129
1130 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
1131
1132         * expression.cs (EmitCall): if a method is not virtual, then do
1133         not use callvirt on it.
1134
1135         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
1136         user defined stuff) requires the use of stobj, which takes an
1137         address on the stack instead of an array and an index.  So emit
1138         the Ldelema operation for it.
1139
1140         (EmitStoreOpcode): Use stobj for valuetypes.
1141
1142         (UnaryMutator.EmitCode): Use the right 1 value depending on
1143         whether we are dealing with int64/uint64, float or doubles.
1144
1145         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
1146         constructors that I implemented last night.
1147
1148         (Constructor.IsDefault): Fix to work properly for static
1149         constructors.
1150
1151         * cs-parser.jay (CheckDef): report method signature errors.
1152         Update error number 103 to be 132.
1153
1154         * decl.cs: New AdditionResult enumeration value: MethodExists.
1155         Although we do this check for methods later on in the semantic
1156         analysis, catching repeated default constructors is so easy that
1157         we catch these here. 
1158         
1159         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
1160         promotions code.
1161
1162         (ParameterReference.EmitAssign, Emit): handle
1163         bools as bytes.
1164
1165         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
1166         (ArrayAccess.EmitStoreOpcode): ditto.
1167
1168         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
1169
1170         * expression.cs (MakeByteBlob): Complete all the missing types
1171         (uint, short, ushort, byte, sbyte)
1172
1173         * class.cs: Only init instance field initializers on instance
1174         constructors. 
1175
1176         Rename `constructors' to instance_constructors. 
1177
1178         (TypeContainer.AddConstructor): Only add constructors to the list
1179         if it is not static.
1180
1181         Make sure that we handle default_static_constructor independently
1182         everywhere where we handle instance_constructors
1183
1184 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
1185
1186         * class.cs: Do not lookup or create a base initializer for a
1187         static constructor.
1188
1189         (ConstructorInitializer.Resolve): use the proper type to lookup
1190         for constructors.
1191
1192         * cs-parser.jay: Report error 1585 (modifiers between type and name).
1193
1194         * enum.cs, interface.cs: Remove CloseType, this is taken care by
1195         in DeclSpace. 
1196
1197         * decl.cs: CloseType is now an virtual method, the default
1198         implementation just closes this type.
1199         
1200 2001-12-28  Ravi Pratap  <ravi@ximian.com>
1201
1202         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
1203         to PreserveSig by default. Also emit HideBySig on such methods.
1204
1205         Basically, set the defaults to standard values.
1206
1207         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
1208         argument, if candidate is better, it can't be worse than the best !
1209
1210         (Invocation): Re-write bits to differentiate between methods being
1211         applicable in their expanded form and their normal form - for params
1212         methods of course.
1213
1214         Get rid of use_standard everywhere as only standard conversions are allowed
1215         in overload resolution. 
1216
1217         More spec conformance.
1218         
1219 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
1220
1221         * driver.cs: Add --timestamp, to see where the compiler spends
1222         most of its time.
1223
1224         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
1225         `this' in static code.
1226
1227         (SimpleName.DoResolve): Implement in terms of a helper function
1228         that allows static-references to be passed upstream to
1229         MemberAccess.
1230
1231         (Expression.ResolveWithSimpleName): Resolve specially simple
1232         names when called by MemberAccess to implement the special
1233         semantics. 
1234
1235         (Expression.ImplicitReferenceConversion): Handle conversions from
1236         Null to reference types before others, as Null's type is
1237         System.Object. 
1238
1239         * expression.cs (Invocation.EmitCall): Handle the special case of
1240         calling methods declared on a reference type from a ValueType
1241         (Base classes System.Object and System.Enum)
1242
1243         (MemberAccess.Resolve): Only perform lookups on Enumerations if
1244         the left hand side is a TypeExpr, not on every enumeration. 
1245
1246         (Binary.Resolve): If types are reference types, then do a cast to
1247         object on operators != and == of both arguments.
1248         
1249         * typemanager.cs (FindMembers): Extract instance and static
1250         members if requested.
1251
1252         * interface.cs (PopulateProperty): Use void_type instead of null
1253         as the return type for the setter method.
1254
1255         (PopulateIndexer): ditto.
1256
1257 2001-12-27  Ravi Pratap  <ravi@ximian.com>
1258
1259         * support.cs (ReflectionParameters): Fix minor bug where we
1260         were examining the wrong parameter for the ParamArray attribute.
1261
1262         Cope with requests for the type of the parameter at position
1263         greater than the params parameter's. We now return the element
1264         type of the params array as that makes more sense.
1265
1266         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
1267         accordingly as we no longer have to extract the element type
1268         ourselves.
1269
1270         (Invocation.OverloadResolve): Update.
1271
1272 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
1273
1274         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
1275         against IEnumerator, test whether the return value is a descendant
1276         of the IEnumerator interface.
1277
1278         * class.cs (Indexer.Define): Use an auxiliary method to implement
1279         the other bits of the method definition.  Begin support for
1280         explicit interface implementation.
1281
1282         (Property.DefineMethod): Use TypeManager.void_type instead of null
1283         for an empty return value.
1284
1285 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
1286
1287         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
1288         dealing with a FieldExpr which is composed of a FieldBuilder, in
1289         the code path we did extract the constant, but we should have
1290         obtained the underlying value to be able to cast it (otherwise we
1291         end up in an infinite loop, this is what Ravi was running into).
1292
1293         (ArrayCreation.UpdateIndices): Arrays might be empty.
1294
1295         (MemberAccess.ResolveMemberAccess): Add support for section
1296         14.5.4.1 that deals with the special case of E.I when E is a type
1297         and something else, that I can be a reference to a static member.
1298
1299         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
1300         handle a particular array type to create byte blobs, it is just
1301         something we dont generate byteblobs for.
1302
1303         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
1304         arguments. 
1305
1306         * location.cs (Push): remove the key from the hashtable that we
1307         are about to add.   This happens for empty files.
1308
1309         * driver.cs: Dispose files after we have parsed them.
1310
1311         (tokenize): new function that only runs the tokenizer on its
1312         input, for speed testing.
1313
1314 2001-12-26  Ravi Pratap  <ravi@ximian.com>
1315
1316         * class.cs (Event.Define): Define the private field only if there
1317         are no accessors defined.
1318
1319         * expression.cs (ResolveMemberAccess): If there is no associated
1320         field with the event, that means we have an event defined with its
1321         own accessors and we should flag error cs0070 since transforming
1322         ourselves into a field is not valid in that case.
1323
1324         * ecore.cs (SimpleName.DoResolve): Same as above.
1325
1326         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
1327         and charset to sane values.
1328
1329 2001-12-25  Ravi Pratap  <ravi@ximian.com>
1330
1331         * assign.cs (DoResolve): Perform check on events only if they 
1332         are being accessed outside the declaring type.
1333
1334         * cs-parser.jay (event_declarations): Update rules to correctly
1335         set the type of the implicit parameter etc.
1336
1337         (add_accessor, remove_accessor): Set current local parameters.
1338
1339         * expression.cs (Binary): For delegate addition and subtraction,
1340         cast the return value from the method into the appropriate delegate
1341         type.
1342
1343 2001-12-24  Ravi Pratap  <ravi@ximian.com>
1344
1345         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
1346         of these as the workaround is unnecessary.
1347
1348         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
1349         delegate data - none of that is needed at all.
1350
1351         Re-write bits to extract the instance expression and the delegate method
1352         correctly.
1353
1354         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
1355         on delegates too.
1356
1357         * attribute.cs (ApplyAttributes): New method to take care of common tasks
1358         of attaching attributes instead of duplicating code everywhere.
1359
1360         * everywhere : Update code to do attribute emission using the above method.
1361
1362 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
1363
1364         * expression.cs (IsParamsMethodApplicable): if there are not
1365         parameters, return immediately.
1366
1367         * ecore.cs: The 0 literal can be implicity converted to an enum
1368         type. 
1369
1370         (SimpleName.DoResolve): First lookup the type, then lookup the
1371         members. 
1372
1373         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
1374         want to get its address.  If the InstanceExpression is not
1375         addressable, store the result in a temporary variable, then get
1376         the address of it.
1377
1378         * codegen.cs: Only display 219 errors on warning level or above. 
1379
1380         * expression.cs (ArrayAccess): Make it implement the
1381         IMemoryLocation interface.
1382
1383         (Binary.DoResolve): handle the operator == (object a, object b)
1384         and operator != (object a, object b) without incurring into a
1385         BoxedCast (because 5 != o should never be performed).
1386
1387         Handle binary enumerator operators.
1388
1389         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
1390         value type, otherwise use Ldelem_ref.
1391
1392         Use precomputed names;
1393
1394         (AddressOf): Implement address of
1395
1396         * cs-parser.jay (labeled_statement): Fix recursive block
1397         addition by reworking the production.
1398
1399         * expression.cs (New.DoEmit): New has a special case:
1400                 
1401                  If we are dealing with a ValueType, we have a few
1402                  situations to deal with:
1403                 
1404                     * The target of New is a ValueType variable, that is
1405                       easy, we just pass this as the variable reference
1406                 
1407                     * The target of New is being passed as an argument,
1408                       to a boxing operation or a function that takes a
1409                       ValueType.
1410                 
1411                       In this case, we need to create a temporary variable
1412                       that is the argument of New.
1413
1414
1415 2001-12-23  Ravi Pratap  <ravi@ximian.com>
1416
1417         * rootcontext.cs (LookupType): Check that current_type is not null before
1418         going about looking at nested types.
1419
1420         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
1421         not implement the IAssignMethod interface any more.
1422
1423         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
1424         where we tranform them into FieldExprs if they are being resolved from within
1425         the declaring type.
1426
1427         * ecore.cs (SimpleName.DoResolve): Do the same here.
1428
1429         * assign.cs (DoResolve, Emit): Clean up code considerably. 
1430
1431         * ../errors/bug10.cs : Add.
1432
1433         * ../errors/cs0070.cs : Add.
1434
1435         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
1436
1437         * assign.cs : Get rid of EventIsLocal everywhere.
1438         
1439 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
1440
1441         * ecore.cs (ConvertIntLiteral): finished the implementation.
1442
1443         * statement.cs (SwitchLabel): Convert the value we are using as a
1444         key before looking up the table.
1445
1446 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
1447
1448         * codegen.cs (EmitTopBlock): Require a Location argument now.
1449
1450         * cs-parser.jay (constructor_declarator): We need to setup
1451         current_local_parameters before we parse the
1452         opt_constructor_initializer, to allow the variables to be bound
1453         to the constructor arguments.
1454
1455         * rootcontext.cs (LookupType): First lookup nested classes in our
1456         class and our parents before we go looking outside our class.
1457
1458         * expression.cs (ConstantFold): Extract/debox the values at the
1459         beginnning. 
1460
1461         * rootcontext.cs (EmitCode): Resolve the constants first before we
1462         resolve the types.  This is not really needed, but it helps debugging.
1463
1464         * statement.cs: report location.
1465         
1466         * cs-parser.jay: pass location to throw statement.
1467
1468         * driver.cs: Small bug fix.
1469
1470         * report.cs: Updated format to be 4-zero filled digits.
1471
1472 2001-12-22  Ravi Pratap  <ravi@ximian.com>
1473
1474         * expression.cs (CheckIndices): Fix minor bug where the wrong
1475         variable was being referred to ;-)
1476
1477         (DoEmit): Do not call EmitStaticInitializers when the 
1478         underlying type is System.Object.
1479
1480 2001-12-21  Ravi Pratap  <ravi@ximian.com>
1481
1482         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
1483         and do the usual workaround for SRE.
1484
1485         * class.cs (MyEventBuilder.EventType): New member to get at the type
1486         of the event, quickly.
1487
1488         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
1489
1490         * assign.cs (Assign.DoResolve): Handle the case when the target
1491         is an EventExpr and perform the necessary checks.
1492
1493         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
1494         interface.
1495
1496         (SimpleName.MemberStaticCheck): Include check for EventExpr.
1497
1498         (EventExpr): Set the type in the constructor itself since we 
1499         are meant to be born fully resolved.
1500
1501         (EventExpr.Define): Revert code I wrote earlier.
1502                 
1503         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
1504         instance expression is null. The instance expression is a This in that case
1505         or a null, depending on whether it is a static method or not.
1506
1507         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
1508         refers to more than one method.
1509
1510         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
1511         and accordingly flag errors.
1512
1513 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
1514
1515         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
1516
1517 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
1518
1519         * location.cs (ToString): Provide useful rutine.
1520
1521 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
1522
1523         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
1524         objects, return the actual integral boxed.
1525
1526         * statement.cs (SwitchLabel): define an ILLabel for each
1527         SwitchLabel. 
1528         
1529         (Switch.CheckSwitch): If the value is a Literal, extract
1530         the underlying literal.
1531         
1532         Also in the unused hashtable we had, add the SwitchLabel so we can
1533         quickly look this value up.
1534
1535         * constant.cs: Implement a bunch of new constants.  Rewrite
1536         Literal based on this.  Made changes everywhere to adapt to this.
1537         
1538         * expression.cs (Expression.MakeByteBlob): Optimize routine by
1539         dereferencing array only once, and also copes with enumrations.
1540
1541         bytes are two bytes wide, not one.
1542
1543         (Cast): Perform constant conversions.
1544         
1545         * ecore.cs (TryImplicitIntConversion): Return literals instead of
1546         wrappers to the literals here.
1547
1548         * expression.cs (DoNumericPromotions): long literals can converted
1549         to ulong implicity (this is taken care of elsewhere, but I was
1550         missing this spot).
1551
1552         * ecore.cs (Expression.Literalize): Make the return type Literal,
1553         to improve type checking.
1554
1555         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
1556
1557 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
1558
1559         * literal.cs: Revert code from ravi that checked the bounds.  The
1560         bounds are sane by the definition of the type itself. 
1561
1562         * typemanager.cs: Fix implementation of ImplementsInterface.  We
1563         need to actually look up in our parent hierarchy for interfaces
1564         implemented. 
1565
1566         * const.cs: Use the underlying type for enumerations
1567
1568         * delegate.cs: Compute the basename for the delegate creation,
1569         that should fix the delegate test case, and restore the correct
1570         Type Lookup semantics in rootcontext
1571
1572         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
1573         referencing a nested type with the Reflection API is using the "+"
1574         sign. 
1575
1576         * cs-parser.jay: Do not require EOF token at the end.
1577
1578 2001-12-20  Ravi Pratap  <ravi@ximian.com>
1579
1580         * rootcontext.cs (LookupType): Concatenate type names with
1581         a '.' instead of a '+' The test suite passes again.
1582
1583         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
1584         field of the enumeration.
1585
1586         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
1587         the case when the member is an EventExpr.
1588
1589         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
1590         static has an associated instance expression.
1591
1592         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
1593
1594         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
1595
1596         * class.cs (Event.Define): Register event and perform appropriate checks
1597         for error #111.
1598
1599         We define the Add and Remove methods even if the use provides none because
1600         in that case, we provide default implementations ourselves.
1601
1602         Define a private field of the type of the event. This is done by the CSC compiler
1603         and we should be doing it too ;-)
1604
1605         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
1606         More methods we use in code we generate.
1607
1608         (multicast_delegate_type, delegate_type): Two separate types since the distinction
1609         is important.
1610
1611         (InitCoreTypes): Update accordingly for the above.
1612
1613         * class.cs (Event.Emit): Generate code for default accessors that we provide
1614
1615         (EmitDefaultMethod): Do the job in the above.
1616
1617         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
1618         appropriate place.
1619
1620 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
1621
1622         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
1623         builders even if we were missing one.
1624
1625         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
1626         pass the Basename as our class name instead of the Name.  The
1627         basename will be correctly composed for us.
1628
1629         * parameter.cs (Paramters): Now takes a Location argument.
1630
1631         * decl.cs (DeclSpace.LookupType): Removed convenience function and
1632         make all the code call directly LookupType in RootContext and take
1633         this chance to pass the Location information everywhere.
1634
1635         * Everywhere: pass Location information.
1636
1637 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
1638
1639         * class.cs (Constructor.Define): Updated way of detecting the
1640         length of the parameters.
1641
1642         (TypeContainer.DefineType): Use basename as the type name for
1643         nested types.
1644
1645         (TypeContainer.Define): Do not recursively define types here, as
1646         definition is taken care in order by the RootContext.
1647
1648         * tree.cs: Keep track of namespaces in a per-file basis.
1649
1650         * parameter.cs (Parameter.ComputeSignature): Update to use
1651         DeclSpace. 
1652
1653         (Parameters.GetSignature): ditto.
1654
1655         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
1656         instead of a TypeContainer.
1657
1658         (Interface.SemanticAnalysis): Use `this' instead of our parent to
1659         resolve names.  Because we need to be resolve in our context, not
1660         our parents.
1661         
1662         * driver.cs: Implement response files.
1663
1664         * class.cs (TypeContainer.DefineType): If we are defined, do not
1665         redefine ourselves.
1666         
1667         (Event.Emit): Emit the code for add/remove handlers.
1668         (Event.Define): Save the MethodBuilders for add/remove.
1669
1670         * typemanager.cs: Use pair here too.
1671
1672         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
1673         DictionaryEntry requires the first argument to be non-null.  
1674         
1675         (enum_declaration): Compute full name for registering the
1676         enumeration.
1677         
1678         (delegate_declaration): Instead of using
1679         formal_parameter_list, use opt_formal_parameter_list as the list
1680         can be empty.
1681
1682         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
1683         (EventParsing): New property that controls whether `add' and
1684         `remove' are returned as tokens or identifiers (for events);
1685
1686 2001-12-19  Ravi Pratap  <ravi@ximian.com>
1687
1688         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
1689         use MyEventBuilder only and let it wrap the real builder for us.
1690
1691         (MyEventBuilder): Revamp constructor etc.
1692
1693         Implement all operations that we perform on EventBuilder in precisely the same
1694         way here too.
1695
1696         (FindMembers): Update to use the EventBuilder member.
1697
1698         (Event.Emit): Update accordingly.
1699
1700 2001-12-18  Ravi Pratap  <ravi@ximian.com>
1701
1702         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
1703         by calling the appropriate methods.
1704
1705         (GetCustomAttributes): Make stubs as they cannot possibly do anything
1706         useful.
1707
1708         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
1709
1710 2001-12-17  Ravi Pratap  <ravi@ximian.com>
1711
1712         * delegate.cs (Delegate.Populate): Check that the return type
1713         and various parameters types are indeed accessible.
1714
1715         * class.cs (Constructor.Define): Same here.
1716
1717         (Field.Define): Ditto.
1718
1719         (Event.Define): Ditto.
1720
1721         (Operator.Define): Check that the underlying Method defined itself
1722         correctly - so it's MethodBuilder should not be null.
1723
1724         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
1725         expression happens to be null.
1726
1727         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
1728         members but as of now we don't seem to be able to do anything really useful with it.
1729
1730         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
1731         not the EventBuilder.
1732
1733 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
1734
1735         * cs-tokenizer.cs: Add support for defines.
1736         Add support for #if, #elif, #else, #endif
1737         
1738         (eval_var): evaluates a variable.
1739         (eval): stubbed for evaluating functions.
1740
1741         * cs-parser.jay: Pass the defines information
1742
1743         * driver.cs: Add --define command line option.
1744
1745         * decl.cs: Move MemberCore here.
1746
1747         Make it the base class for DeclSpace.  This allows us to catch and
1748         report 108 and 109 for everything now.
1749
1750         * class.cs (TypeContainer.Define): Extract all the members
1751         before populating and emit the warning 108 (new keyword required
1752         to override) instead of having each member implement this.
1753
1754         (MemberCore.Define): New abstract method, we will be using this in
1755         the warning reporting engine in Populate.
1756         
1757         (Operator.Define): Adjust to new MemberCore protocol. 
1758
1759         * const.cs (Const): This does not derive from Expression, it is a
1760         temporary object we use to create fields, it is a MemberCore. 
1761
1762         * class.cs (Method.Define): Allow the entry point to be in a
1763         specific class.
1764
1765         * driver.cs: Rewrite the argument handler to clean it up a bit.
1766
1767         * rootcontext.cs: Made it just an auxiliary namespace feature by
1768         making everything static.
1769
1770         * driver.cs: Adapt code to use RootContext type name instead of
1771         instance variable.
1772
1773         * delegate.cs: Remove RootContext argument.
1774
1775         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
1776         argument. 
1777
1778         * class.cs (Event.Define): The lookup can fail.
1779         
1780         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
1781
1782         * expression.cs: Resolve the this instance before invoking the code.
1783
1784 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
1785
1786         * cs-parser.jay: Add a production in element_access that allows
1787         the thing to become a "type" reference.  This way we can parse
1788         things like "(string [])" as a type.
1789
1790         Note that this still does not handle the more complex rules of
1791         casts. 
1792         
1793
1794         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
1795
1796         * ecore.cs: (CopyNewMethods): new utility function used to
1797         assemble the list of methods from running FindMembers.
1798
1799         (MemberLookup): Rework FindMembers so that 
1800
1801 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
1802
1803         * class.cs (TypeContainer): Remove Delegates who fail to be
1804         defined.
1805
1806         * delegate.cs (Populate): Verify that we dont get null return
1807         values.   TODO: Check for AsAccessible.
1808
1809         * cs-parser.jay: Use basename to emit error 574 (destructor should
1810         have the same name as container class), not the full name.
1811
1812         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
1813         possible representation.  
1814
1815         Also implements integer type suffixes U and L.
1816
1817 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
1818
1819         * expression.cs (ArrayCreation.DoResolve): We need to do the
1820         argument resolution *always*.
1821
1822         * decl.cs: Make this hold the namespace.  Hold the root context as
1823         well.
1824         (LookupType): Move here.
1825
1826         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
1827
1828         * location.cs (Row, Name): Fixed the code, it was always returning
1829         references to the first file.
1830
1831         * interface.cs: Register properties defined through interfaces.
1832
1833         * driver.cs: Add support for globbing on the command line
1834
1835         * class.cs (Field): Make it derive from MemberCore as well.
1836         (Event): ditto.
1837
1838 2001-12-15  Ravi Pratap  <ravi@ximian.com>
1839
1840         * class.cs (Event::Define): Check that the type of the event is a delegate
1841         type else flag error #66.
1842
1843         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
1844         same.
1845
1846         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
1847         values of EntryPoint, CharSet etc etc.
1848
1849         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
1850
1851         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
1852         be null and we should ignore this. I am not sure if this is really clean. Apparently,
1853         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
1854         which needs this to do its work.
1855
1856         * ../errors/cs0066.cs : Add.
1857
1858 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
1859
1860         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
1861         helper functions.
1862
1863         * class.cs: (MethodSignature.MethodSignature): Removed hack that
1864         clears out the parameters field.
1865         (MemberSignatureCompare): Cleanup
1866
1867         (MemberCore): New base class used to share code between MethodCore
1868         and Property.
1869
1870         (RegisterRequiredImplementations) BindingFlags.Public requires
1871         either BindingFlags.Instace or Static.  Use instance here.
1872
1873         (Property): Refactored code to cope better with the full spec.
1874
1875         * parameter.cs (GetParameterInfo): Return an empty array instead
1876         of null on error.
1877
1878         * class.cs (Property): Abstract or extern properties have no bodies.
1879
1880         * parameter.cs (GetParameterInfo): return a zero-sized array.
1881
1882         * class.cs (TypeContainer.MethodModifiersValid): Move all the
1883         method modifier validation to the typecontainer so we can reuse
1884         this on properties.
1885
1886         (MethodCore.ParameterTypes): return an empty sized array of types.
1887
1888         (Property.Define): Test property modifier validity.
1889
1890         Add tests for sealed/override too.
1891
1892         (Method.Emit): abstract or extern methods have no bodies.
1893
1894 2001-12-14  Ravi Pratap  <ravi@ximian.com>
1895
1896         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
1897         thing.
1898
1899         (Method::Define, ::Emit): Modify accordingly.
1900
1901         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
1902
1903         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
1904
1905         * makefile: Pass in /unsafe.
1906
1907 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
1908
1909         * class.cs (MakeKey): Kill routine.
1910         
1911         * class.cs (TypeContainer.Define): Correctly define explicit
1912         method implementations (they require the full interface name plus
1913         the method name).
1914
1915         * typemanager.cs: Deply the PtrHashtable here and stop using the
1916         lame keys.  Things work so much better.
1917
1918         This of course broke everyone who depended on `RegisterMethod' to
1919         do the `test for existance' test.  This has to be done elsewhere.
1920
1921         * support.cs (PtrHashtable): A hashtable that avoid comparing with
1922         the object stupid Equals method (because, that like fails all over
1923         the place).  We still do not use it.
1924
1925         * class.cs (TypeContainer.SetRequiredInterface,
1926         TypeContainer.RequireMethods): Killed these two routines and moved
1927         all the functionality to RegisterRequiredImplementations.
1928
1929         (TypeContainer.RegisterRequiredImplementations): This routine now
1930         registers all the implementations required in an array for the
1931         interfaces and abstract methods.  We use an array of structures
1932         which can be computed ahead of time to reduce memory usage and we
1933         also assume that lookups are cheap as most classes will not
1934         implement too many interfaces.
1935
1936         We also avoid creating too many MethodSignatures.
1937
1938         (TypeContainer.IsInterfaceMethod): Update and optionally does not
1939         clear the "pending" bit if we find that there are problems with
1940         the declaration.
1941
1942         (TypeContainer.VerifyPendingMethods): Update to report errors of
1943         methods that look like implementations but are not.
1944
1945         (TypeContainer.Define): Add support for explicit interface method
1946         implementation. 
1947         
1948 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
1949
1950         * typemanager.cs: Keep track of the parameters here instead of
1951         being a feature of the TypeContainer.
1952
1953         * class.cs: Drop the registration of parameters here, as
1954         InterfaceMethods are also interface declarations.
1955
1956         * delegate.cs: Register methods with the TypeManager not only with
1957         the TypeContainer.  This code was buggy.
1958
1959         * interface.cs: Full registation here.
1960
1961 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
1962
1963         * expression.cs: Remove reducer for binary expressions, it can not
1964         be done this way.
1965
1966         * const.cs: Put here the code that used to go into constant.cs
1967
1968         * constant.cs: Put here the code for constants, this is a new base
1969         class for Literals.
1970
1971         * literal.cs: Make Literal derive from Constant.
1972
1973 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
1974
1975         * statement.cs (Return.Emit): Report error 157 if the user
1976         attempts to return from a finally block.
1977
1978         (Return.Emit): Instead of emitting a return, jump to the end of
1979         the function.
1980
1981         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
1982         LocalBuilder to store the result of the function.  ReturnLabel is
1983         the target where we jump.
1984         
1985
1986 2001-12-09  Radek Doulik  <rodo@ximian.com>
1987
1988         * cs-parser.jay: remember alias in current namespace
1989
1990         * ecore.cs (SimpleName::DoResolve): use aliases for types or
1991         namespaces
1992
1993         * class.cs (LookupAlias): lookup alias in my_namespace
1994
1995         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
1996         aliases hashtable
1997         (LookupAlias): lookup alias in this and if needed in parent
1998         namespaces
1999
2000 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
2001
2002         * support.cs: 
2003
2004         * rootcontext.cs: (ModuleBuilder) Made static, first step into
2005         making things static.  I need this to avoid passing the
2006         TypeContainer when calling ParameterType.
2007
2008         * support.cs (InternalParameters.ParameterType): Remove ugly hack
2009         that did string manipulation to compute the type and then call
2010         GetType.  Use Parameter.ParameterType instead.
2011
2012         * cs-tokenizer.cs: Consume the suffix for floating values.
2013
2014         * expression.cs (ParameterReference): figure out whether this is a
2015         reference parameter or not.  Kill an extra variable by computing
2016         the arg_idx during emission.
2017
2018         * parameter.cs (Parameters.GetParameterInfo): New overloaded
2019         function that returns whether a parameter is an out/ref value or not.
2020
2021         (Parameter.ParameterType): The type of the parameter (base,
2022         without ref/out applied).
2023         
2024         (Parameter.Resolve): Perform resolution here.
2025         (Parameter.ExternalType): The full type (with ref/out applied).
2026
2027         * statement.cs (Using.Emit, Using.EmitExpression): Implement
2028         support for expressions on the using statement.
2029
2030 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
2031
2032         * statement.cs (Using.EmitLocalVariableDecls): Split the
2033         localvariable handling of the using statement.
2034
2035         (Block.EmitMeta): Keep track of variable count across blocks.  We
2036         were reusing slots on separate branches of blocks.
2037
2038         (Try.Emit): Emit the general code block, we were not emitting it. 
2039
2040         Check the type of the declaration to be an IDisposable or
2041         something that can be implicity converted to it. 
2042
2043         Emit conversions if required.
2044
2045         * ecore.cs (EmptyExpression): New utility class.
2046         (Expression.ImplicitConversionExists): New utility function.
2047
2048 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
2049
2050         * statement.cs (Using): Implement.
2051
2052         * expression.cs (LocalVariableReference): Support read only variables.
2053
2054         * statement.cs: Remove the explicit emit for the Leave opcode.
2055         (VariableInfo): Add a readonly field.
2056
2057 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
2058
2059         * ecore.cs (ConvCast): new class used to encapsulate the various
2060         explicit integer conversions that works in both checked and
2061         unchecked contexts.
2062
2063         (Expression.ConvertNumericExplicit): Use new ConvCast class to
2064         properly generate the overflow opcodes.
2065
2066 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
2067
2068         * statement.cs: The correct type for the EmptyExpression is the
2069         element_type, not the variable type.  Ravi pointed this out.
2070
2071 2001-12-04  Ravi Pratap  <ravi@ximian.com>
2072
2073         * class.cs (Method::Define): Handle PInvoke methods specially
2074         by using DefinePInvokeMethod instead of the usual one.
2075
2076         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
2077         above to do the task of extracting information and defining the method.
2078         
2079 2001-12-04  Ravi Pratap  <ravi@ximian.com>
2080
2081         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
2082         of the condition for string type.
2083
2084         (Emit): Move that here. 
2085
2086         (ArrayCreation::CheckIndices): Keep string literals in their expression
2087         form.
2088
2089         (EmitDynamicInitializers): Handle strings appropriately.
2090
2091 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
2092
2093         * codegen.cs (EmitContext): Replace multiple variables with a
2094         single pointer to the current Switch statement.
2095
2096         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
2097         EmitContext.
2098
2099 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
2100
2101         * statement.cs 
2102
2103         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
2104         default'.
2105         
2106         (Foreach.Emit): Foreach on arrays was not setting
2107         up the loop variables (for break/continue).
2108
2109         (GotoCase): Semi-implented.
2110         
2111 2001-12-03  Ravi Pratap  <ravi@ximian.com>
2112
2113         * attribute.cs (CheckAttribute): Handle system attributes by using
2114         Attribute.GetAttributes to examine information we need.
2115
2116         (GetValidPlaces): Same here.
2117
2118         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
2119
2120         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
2121
2122         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
2123
2124         (Method::Define): Set appropriate flags if we have a DllImport attribute.
2125
2126         (Method::Emit): Handle the case when we are a PInvoke method.
2127
2128 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
2129
2130         * expression.cs: Use ResolveWithSimpleName on compound names.
2131
2132 2001-12-02  Ravi Pratap  <ravi@ximian.com>
2133
2134         * constant.cs (EmitConstant): Make sure we resolve the associated expression
2135         before trying to reduce it.
2136
2137         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
2138
2139         * constant.cs (LookupConstantValue): Implement.
2140
2141         (EmitConstant): Use the above in emitting the constant.
2142
2143         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
2144         that are user-defined by doing a LookupConstantValue on them.
2145
2146         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
2147         too, like above.
2148
2149 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
2150
2151         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
2152
2153         (BaseAccess.DoResolve): Implement.
2154
2155         (MemberAccess.DoResolve): Split this routine into a
2156         ResolveMemberAccess routine that can be used independently
2157
2158 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
2159
2160         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
2161         As that share bits of the implementation.  Is returns a boolean,
2162         while As returns the Type that is being probed.
2163
2164 2001-12-01  Ravi Pratap  <ravi@ximian.com>
2165
2166         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
2167         instead of a Literal - much easier.
2168
2169         (EnumInTransit): Remove - utterly useless :-)
2170
2171         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
2172
2173         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
2174
2175         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
2176         chain when we have no associated expression.
2177
2178 2001-11-30  Ravi Pratap  <ravi@ximian.com>
2179
2180         * constant.cs (Define): Use Location while reporting the errror.
2181
2182         Also emit a warning when 'new' is used and there is no inherited
2183         member to hide.
2184
2185         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
2186         populated.
2187
2188         (LookupEnumValue): Implement to lookup an enum member's value and define it
2189         if necessary.
2190
2191         (Populate): Re-write accordingly to use the above routine.
2192
2193 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
2194
2195         * expression.cs (This): Fix prototype for DoResolveLValue to
2196         override the base class DoResolveLValue.
2197
2198         * cs-parser.cs: Report errors cs574 and cs575 (destructor
2199         declarations) 
2200
2201         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
2202         (we need to load the address of the field here).  This fixes
2203         test-22. 
2204         
2205         (FieldExpr.DoResolveLValue): Call the DoResolve
2206         function to initialize the Instance expression.
2207         
2208         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
2209         correctly the GetEnumerator operation on a value type.
2210
2211         * cs-parser.jay: Add more simple parsing error catches.
2212
2213         * statement.cs (Switch): Add support for string switches.
2214         Handle null specially.
2215
2216         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
2217
2218 2001-11-28  Ravi Pratap  <ravi@ximian.com>
2219
2220         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
2221
2222         (declare_local_constant): New helper function.
2223
2224         * statement.cs (AddConstant): Keep a separate record of constants
2225
2226         (IsConstant): Implement to determine if a variable is a constant.
2227
2228         (GetConstantExpression): Implement.
2229
2230         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
2231
2232         * statement.cs (IsVariableDefined): Re-write.
2233
2234 2001-11-27  Ravi Pratap  <ravi@ximian.com>
2235
2236         * class.cs (TypeContainer::FindMembers): Look for constants
2237         in the case when we are looking for MemberTypes.Field
2238
2239         * expression.cs (MemberAccess::DoResolve): Check that in the
2240         case we are a FieldExpr and a Literal, we are not being accessed
2241         by an instance reference.
2242
2243         * cs-parser.jay (local_constant_declaration): Implement.
2244
2245         (declaration_statement): Implement for constant declarations.
2246
2247 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
2248
2249         * statement.cs (Switch): Catch double defaults.
2250
2251         (Switch): More work on the switch() statement
2252         implementation.  It works for integral values now, need to finish
2253         string support.
2254
2255
2256 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
2257
2258         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
2259         integer literals into other integer literals.  To be used by
2260         switch. 
2261
2262 2001-11-24  Ravi Pratap  <ravi@ximian.com>
2263
2264         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
2265         some memory.
2266
2267         (EmitDynamicInitializers): Cope with the above since we extract data
2268         directly from ArrayData now.
2269
2270         (ExpectInitializers): Keep track of whether initializers are mandatory
2271         or not.
2272
2273         (Bounds): Make it a hashtable to prevent the same dimension being 
2274         recorded for every element in that dimension.
2275
2276         (EmitDynamicInitializers): Fix bug which prevented the Set array method
2277         from being found.
2278
2279         Also fix bug which was causing the indices to be emitted in the reverse
2280         order.
2281
2282 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
2283
2284         * expression.cs (ArrayCreation): Implement the bits that Ravi left
2285         unfinished.  They do not work, because the underlying code is
2286         sloppy.
2287
2288 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
2289
2290         * cs-parser.jay: Remove bogus fixme.
2291
2292         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
2293         on Switch statement.
2294         
2295 2001-11-23  Ravi Pratap  <ravi@ximian.com>
2296
2297         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
2298         the same. 
2299         
2300         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
2301         parameter. Apparently, any expression is allowed. 
2302
2303         (ValidateInitializers): Update accordingly.
2304
2305         (CheckIndices): Fix some tricky bugs thanks to recursion.
2306
2307         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
2308         I was being completely brain-dead.
2309
2310         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
2311         and re-write acordingly.
2312
2313         (DelegateInvocation): Re-write accordingly.
2314
2315         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
2316
2317         (MakeByteBlob): Handle types more correctly.
2318
2319         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
2320         initialization from expressions but it is incomplete because I am a complete
2321         Dodo :-|
2322
2323 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
2324
2325         * statement.cs (If.Emit): Fix a bug that generated incorrect code
2326         on If.  Basically, we have to return `true' (ie, we do return to
2327         our caller) only if both branches of the if return.
2328
2329         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
2330         short-circuit operators, handle them as short circuit operators. 
2331
2332         (Cast.DoResolve): Resolve type.
2333         (Cast.Cast): Take an expression as the target type.
2334
2335         * cs-parser.jay (cast_expression): Remove old hack that only
2336         allowed a limited set of types to be handled.  Now we take a
2337         unary_expression and we resolve to a type during semantic
2338         analysis.
2339
2340         Use the grammar productions from Rhys to handle casts (this is
2341         not complete like Rhys syntax yet, we fail to handle that corner
2342         case that C# has regarding (-x), but we will get there.
2343         
2344 2001-11-22  Ravi Pratap  <ravi@ximian.com>
2345
2346         * class.cs (EmitFieldInitializer): Take care of the case when we have a
2347         field which is an array type.
2348
2349         * cs-parser.jay (declare_local_variables): Support array initialization too.
2350
2351         * typemanager.cs (MakeKey): Implement.
2352
2353         (everywhere): Use the above appropriately.
2354
2355         * cs-parser.jay (for_statement): Update for array initialization while
2356         declaring variables.
2357
2358         * ecore.cs : The error message was correct, it's the variable's names that
2359         were misleading ;-) Make the code more readable.
2360
2361         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
2362         the correct type etc.
2363
2364         (ConvertExplicit): Handle Enum types by examining the underlying type.
2365
2366 2001-11-21  Ravi Pratap  <ravi@ximian.com>
2367
2368         * parameter.cs (GetCallingConvention): Always return
2369         CallingConventions.Standard for now.
2370
2371 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
2372
2373         * expression.cs (Binary.ResolveOperator): Update the values of `l'
2374         and `r' after calling DoNumericPromotions.
2375
2376         * ecore.cs: Fix error message (the types were in the wrong order).
2377
2378         * statement.cs (Foreach.ProbeCollectionType): Need to pass
2379         BindingFlags.Instance as well 
2380
2381         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
2382         implicit int literal conversion in an empty cast so that we
2383         propagate the right type upstream.
2384
2385         (UnboxCast): new class used to unbox value types.
2386         (Expression.ConvertExplicit): Add explicit type conversions done
2387         by unboxing.
2388
2389         (Expression.ImplicitNumericConversion): Oops, forgot to test for
2390         the target type before applying the implicit LongLiterals to ULong
2391         literal cast.
2392
2393 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
2394
2395         * cs-parser.jay (for_statement): Reworked the way For works: now
2396         we declare manually any variables that are introduced in
2397         for_initializer to solve the problem of having out-of-band code
2398         emition (that is what got for broken).
2399
2400         (declaration_statement): Perform the actual variable declaration
2401         that used to be done in local_variable_declaration here.
2402
2403         (local_variable_declaration): Do not declare anything, just pass
2404         the information on a DictionaryEntry
2405
2406 2001-11-20  Ravi Pratap  <ravi@ximian.com>
2407
2408         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
2409         re-write of the logic to now make it recursive.
2410
2411         (UpdateIndices): Re-write accordingly.
2412
2413         Store element data in a separate ArrayData list in the above methods.
2414
2415         (MakeByteBlob): Implement to dump the array data into a byte array.
2416
2417 2001-11-19  Ravi Pratap  <ravi@ximian.com>
2418
2419         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
2420         into CheckIndices.
2421
2422         * constant.cs (Define): Implement.
2423
2424         (EmitConstant): Re-write fully.
2425
2426         Pass in location info.
2427
2428         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
2429         respectively.
2430
2431         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
2432         DictionaryEntry since we need location info too.
2433
2434         (constant_declaration): Update accordingly.
2435
2436         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
2437         code into another method : UpdateIndices.
2438
2439 2001-11-18  Ravi Pratap  <ravi@ximian.com>
2440
2441         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
2442         some type checking etc.
2443
2444 2001-11-17  Ravi Pratap  <ravi@ximian.com>
2445
2446         * expression.cs (ArrayCreation::ValidateInitializers): Implement
2447         bits to provide dimension info if the user skips doing that.
2448
2449         Update second constructor to store the rank correctly.
2450
2451 2001-11-16  Ravi Pratap  <ravi@ximian.com>
2452
2453         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
2454         and try to implement.
2455
2456         * ../errors/cs0150.cs : Add.
2457
2458         * ../errors/cs0178.cs : Add.
2459
2460 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
2461
2462         * statement.cs: Implement foreach on multi-dimensional arrays. 
2463
2464         * parameter.cs (Parameters.GetParameterByName): Also lookup the
2465         name of the params argument.
2466
2467         * expression.cs: Use EmitStoreOpcode to get the right opcode while
2468         initializing the array.
2469
2470         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
2471         we can use this elsewhere.
2472
2473         * statement.cs: Finish implementation of foreach for single
2474         dimension arrays.
2475
2476         * cs-parser.jay: Use an out-of-band stack to pass information
2477         around, I wonder why I need this.
2478
2479         foreach_block: Make the new foreach_block the current_block.
2480
2481         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
2482         function used to return a static Parameters structure.  Used for
2483         empty parameters, as those are created very frequently.
2484
2485         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
2486
2487 2001-11-15  Ravi Pratap  <ravi@ximian.com>
2488
2489         * interface.cs : Default modifier is private, not public. The
2490         make verify test passes again.
2491
2492 2001-11-15  Ravi Pratap  <ravi@ximian.com>
2493
2494         * support.cs (ReflectionParameters): Fix logic to determine
2495         whether the last parameter is a params one. Test 9 passes again.
2496
2497         * delegate.cs (Populate): Register the builders we define with
2498         RegisterParameterForBuilder. Test 19 passes again.
2499
2500         * cs-parser.jay (property_declaration): Reference $6 instead
2501         of $$ to get at the location.
2502
2503         (indexer_declaration): Similar stuff.
2504
2505         (attribute): Ditto.
2506
2507         * class.cs (Property): Register parameters for the Get and Set methods
2508         if they exist. Test 23 passes again.
2509
2510         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
2511         call to EmitArguments as we are sure there aren't any params arguments. 
2512         Test 32 passes again.
2513
2514         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
2515         IndexOutOfRangeException. 
2516
2517         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
2518         Test 33 now passes again.
2519         
2520 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
2521
2522         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
2523         broke a bunch of things.  Will have to come up with a better way
2524         of tracking locations.
2525
2526         * statement.cs: Implemented foreach for single dimension arrays.
2527
2528 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
2529
2530         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
2531         an error.  This removes the lookup from the critical path.
2532
2533         * cs-parser.jay: Removed use of temporary_loc, which is completely
2534         broken. 
2535
2536 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
2537
2538         * support.cs (ReflectionParameters.ParameterModifier): Report
2539         whether the argument is a PARAMS argument or not.
2540
2541         * class.cs: Set the attribute `ParamArrayAttribute' on the
2542         parameter argument.
2543
2544         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
2545         and cons_param_array_attribute (ConstructorInfo for
2546         ParamArrayAttribute)., 
2547
2548         * codegen.cs: Emit the return using the `Return' statement, that
2549         way we can report the error correctly for missing return values. 
2550
2551         * class.cs (Method.Emit): Clean up.
2552
2553         * expression.cs (Argument.Resolve): Take another argument: the
2554         location where this argument is used.  Notice that this is not
2555         part of the "Argument" class as to reduce the size of the
2556         structure (we know the approximate location anyways).
2557
2558         Test if the argument is a variable-reference, if not, then
2559         complain with a 206.
2560
2561         (Argument.Emit): Emit addresses of variables.
2562
2563         (Argument.FullDesc): Simplify.
2564
2565         (Invocation.DoResolve): Update for Argument.Resolve.
2566
2567         (ElementAccess.DoResolve): ditto.
2568
2569         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
2570         method should be virtual, as this method is always virtual.
2571
2572         (NewDelegate.DoResolve): Update for Argument.Resolve.
2573
2574         * class.cs (ConstructorInitializer.DoResolve): ditto.
2575         
2576         * attribute.cs (Attribute.Resolve): ditto.
2577
2578 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
2579
2580         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
2581
2582         * expression.cs (ParameterReference): Drop IStackStorage and implement
2583         IAssignMethod instead. 
2584
2585         (LocalVariableReference): ditto.
2586         
2587         * ecore.cs (FieldExpr): Drop IStackStorage and implement
2588         IAssignMethod instead. 
2589
2590 2001-11-13  Miguel de Icaza <miguel@ximian.com>
2591
2592         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
2593         enumerations that are used in heavily used structures derive from
2594         byte in a laughable and pathetic attempt to reduce memory usage.
2595         This is the kind of pre-optimzations that you should not do at
2596         home without adult supervision.
2597
2598         * expression.cs (UnaryMutator): New class, used to handle ++ and
2599         -- separatedly from the other unary operators.  Cleans up the
2600         code, and kills the ExpressionStatement dependency in Unary.
2601
2602         (Unary): Removed `method' and `Arguments' from this class, making
2603         it smaller, and moving it all to SimpleCall, so I can reuse this
2604         code in other locations and avoid creating a lot of transient data
2605         strucutres when not required.
2606
2607         * cs-parser.jay: Adjust for new changes.
2608
2609 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
2610
2611         * enum.cs (Enum.Populate): If there is a failure during
2612         definition, return
2613
2614         * cs-parser.jay (opt_enum_base): we used to catch type errors
2615         here, but this is really incorrect.  The type error should be
2616         catched during semantic analysis.
2617
2618 2001-12-11  Ravi Pratap  <ravi@ximian.com>
2619
2620         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
2621         current_local_parameters as expected since I, in my stupidity, had forgotten
2622         to do this :-)
2623
2624         * attribute.cs (GetValidPlaces): Fix stupid bug.
2625
2626         * class.cs (Method::Emit): Perform check on applicability of attributes.
2627
2628         (Constructor::Emit): Ditto.
2629
2630         (Field::Emit): Ditto.
2631
2632         (Field.Location): Store location information.
2633
2634         (Property, Event, Indexer, Operator): Ditto.
2635
2636         * cs-parser.jay (field_declaration): Pass in location for each field.
2637
2638         * ../errors/cs0592.cs : Add.
2639
2640 2001-11-12  Ravi Pratap  <ravi@ximian.com>
2641
2642         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
2643
2644         (InitCoreTypes): Update accordingly.
2645
2646         (RegisterAttrType, LookupAttr): Implement.
2647
2648         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
2649         info about the same.
2650
2651         (Resolve): Update to populate the above as necessary.
2652
2653         (Error592): Helper.
2654
2655         (GetValidPlaces): Helper to the above.
2656
2657         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
2658
2659         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
2660
2661 2001-11-12  Ravi Pratap  <ravi@ximian.com>
2662
2663         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
2664
2665         * ../errors/cs0617.cs : Add.
2666
2667 2001-11-11  Ravi Pratap  <ravi@ximian.com>
2668
2669         * enum.cs (Emit): Rename to Populate to be more consistent with what
2670         we expect it to do and when exactly it is called.
2671
2672         * class.cs, rootcontext.cs : Update accordingly.
2673
2674         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
2675         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
2676
2677         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
2678
2679         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
2680         of a fieldinfo using the above, when dealing with a FieldBuilder.
2681
2682 2001-11-10  Ravi Pratap  <ravi@ximian.com>
2683
2684         * ../errors/cs0031.cs : Add.
2685
2686         * ../errors/cs1008.cs : Add.
2687
2688         * ../errrors/cs0543.cs : Add.
2689
2690         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
2691         enum type.
2692
2693         (FindMembers): Implement.
2694
2695         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
2696         enums and delegates too.
2697
2698         (enum_types): Rename to builder_to_enum.
2699
2700         (delegate_types): Rename to builder_to_delegate.
2701
2702         * delegate.cs (FindMembers): Implement.
2703
2704 2001-11-09  Ravi Pratap  <ravi@ximian.com>
2705
2706         * typemanager.cs (IsEnumType): Implement.
2707
2708         * enum.cs (Emit): Re-write parts to account for the underlying type
2709         better and perform checking etc.
2710
2711         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
2712         of the underlying type.
2713
2714         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
2715         value
2716
2717         * enum.cs (error31): Helper to report error #31.
2718
2719         * cs-parser.jay (enum_declaration): Store location of each member too.
2720
2721         * enum.cs (member_to_location): New hashtable. 
2722
2723         (AddEnumMember): Update location hashtable.
2724
2725         (Emit): Use the location of each member while reporting errors.
2726
2727 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
2728
2729         * cs-parser.jay: A for_initializer if is a
2730         local_variable_declaration really ammount to have an implicit
2731         block with the variable declaration and no initializer for for.
2732
2733         * statement.cs (For.Emit): Cope with null initializers.
2734
2735         This fixes the infinite loop on for initializers.
2736
2737 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
2738
2739         * enum.cs: More cleanup.
2740
2741         * ecore.cs: Remove dead code.
2742
2743         * class.cs (Property.Emit): More simplification.
2744         (Event.Emit): ditto.
2745
2746         Reworked to have less levels of indentation.
2747         
2748 2001-11-08  Ravi Pratap  <ravi@ximian.com>
2749
2750         * class.cs (Property): Emit attributes.
2751
2752         (Field): Ditto.
2753         
2754         (Event): Ditto.
2755
2756         (Indexer): Ditto.
2757
2758         (Operator): Ditto.
2759
2760         * enum.cs (Emit): Ditto.
2761
2762         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
2763         Enums too.
2764
2765         * class.cs (Field, Event, etc.): Move attribute generation into the
2766         Emit method everywhere.
2767
2768         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
2769         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
2770         as we had no way of defining nested enums !
2771
2772         * rootcontext.cs : Adjust code accordingly.
2773
2774         * typemanager.cs (AddEnumType): To keep track of enum types separately.
2775
2776 2001-11-07  Ravi Pratap  <ravi@ximian.com>
2777
2778         * expression.cs (EvalConstantExpression): Move into ecore.cs
2779         
2780         * enum.cs (Enum): Rename some members and make them public and readonly
2781         according to our convention.
2782
2783         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
2784         nothing else.
2785
2786         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
2787
2788         (Enum::Emit): Write a simple version for now which doesn't try to compute
2789         expressions. I shall modify this to be more robust in just a while.
2790
2791         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
2792
2793         (TypeContainer::CloseType): Create the Enum types too.
2794
2795         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
2796
2797         * expression.cs (EvalConstantExpression): Get rid of completely.
2798
2799         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
2800         user-defined values and other cases.
2801
2802         (IsValidEnumLiteral): Helper function.
2803
2804         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
2805         out there in the case we had a literal FieldExpr.
2806
2807         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
2808
2809         (Literalize): Revamp a bit to take two arguments.
2810         
2811         (EnumLiteral): New class which derives from Literal to wrap enum literals.
2812         
2813 2001-11-06  Ravi Pratap  <ravi@ximian.com>
2814
2815         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
2816
2817         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
2818
2819         (Resolve): Use the above to ensure we have proper initializers.
2820
2821 2001-11-05  Ravi Pratap  <ravi@ximian.com>
2822
2823         * expression.cs (Expression::EvalConstantExpression): New method to 
2824         evaluate constant expressions.
2825
2826         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
2827
2828 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
2829
2830         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
2831         in an array.
2832
2833         (Binary.ResolveOperator): Handle operator != (object a, object b)
2834         and operator == (object a, object b);
2835
2836         (Binary.DoNumericPromotions): Indicate whether the numeric
2837         promotion was possible.
2838
2839         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
2840         Implement.  
2841
2842         Made the ArrayAccess implement interface IAssignMethod instead of
2843         IStackStore as the order in which arguments are passed reflects
2844         this.
2845
2846         * assign.cs: Instead of using expr.ExprClass to select the way of
2847         assinging, probe for the IStackStore/IAssignMethod interfaces.
2848
2849         * typemanager.cs: Load InitializeArray definition.
2850
2851         * rootcontext.cs (RootContext.MakeStaticData): Used to define
2852         static data that can be used to initialize arrays. 
2853
2854 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
2855
2856         * expression.cs: Handle operator== and operator!= for booleans.
2857
2858         (Conditioal.Reduce): Implement reducer for the ?: operator.
2859
2860         (Conditional.Resolve): Implement dead code elimination.
2861
2862         (Binary.Resolve): Catch string literals and return a new
2863         concatenated string.
2864
2865         (Unary.Reduce): Implement reduction of unary expressions.
2866
2867         * ecore.cs: Split out the expression core handling here.
2868
2869         (Expression.Reduce): New method used to perform constant folding
2870         and CSE.  This is needed to support constant-expressions. 
2871         
2872         * statement.cs (Statement.EmitBoolExpression): Pass true and false
2873         targets, and optimize for !x.
2874
2875 2001-11-04  Ravi Pratap  <ravi@ximian.com>
2876
2877         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
2878         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
2879         set custom atttributes.
2880
2881         * literal.cs (Literal::GetValue): New abstract method to return the actual
2882         value of the literal, cast as an object.
2883
2884         (*Literal): Implement GetValue method.
2885
2886         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
2887         expressions to the arraylist but objects of type Argument.
2888
2889         * class.cs (TypeContainer::Emit): Emit our attributes too.
2890
2891         (Method::Emit, Constructor::Emit): Ditto.
2892
2893         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
2894         to be ignoring earlier.
2895
2896 2001-11-03  Ravi Pratap  <ravi@ximian.com>
2897
2898         * attribute.cs (AttributeSection::Define): Implement to do the business
2899         of constructing a CustomAttributeBuilder.
2900
2901         (Attribute): New trivial class. Increases readability of code.  
2902
2903         * cs-parser.jay : Update accordingly.
2904
2905         (positional_argument_list, named_argument_list, named_argument): New rules
2906
2907         (attribute_arguments): Use the above so that we are more correct.
2908         
2909 2001-11-02  Ravi Pratap  <ravi@ximian.com>
2910         
2911         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
2912         to perform all checks for a method with a params parameter.
2913
2914         (Invocation::OverloadResolve): Update to use the above method and therefore
2915         cope correctly with params method invocations.
2916
2917         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
2918         params too.
2919
2920         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
2921         constructors in our parent too because we can't afford to miss out on 
2922         protected ones ;-)
2923
2924         * attribute.cs (AttributeSection): New name for the class Attribute
2925
2926         Other trivial changes to improve readability.
2927
2928         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
2929         use the new class names.
2930         
2931 2001-11-01  Ravi Pratap  <ravi@ximian.com>
2932
2933         * class.cs (Method::Define): Complete definition for params types too
2934
2935         (Indexer::Define): Ditto.
2936
2937         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
2938         Cope everywhere with a request for info about the array parameter.
2939
2940 2001-11-01  Ravi Pratap  <ravi@ximian.com>
2941
2942         * tree.cs (RecordNamespace): Fix up to check for the correct key.
2943
2944         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
2945         local_variable_type to extract the string corresponding to the type.
2946
2947         (local_variable_type): Fixup the action to use the new helper method.
2948
2949         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
2950         go.
2951
2952         * expression.cs : Clean out code which uses the above.
2953
2954 2001-10-31  Ravi Pratap  <ravi@ximian.com>
2955         
2956         * typemanager.cs (RegisterMethod): Check if we already have an existing key
2957         and bale out if necessary by returning a false.
2958
2959         (RegisterProperty): Ditto.
2960
2961         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
2962         and print out appropriate error messages.
2963
2964         * interface.cs (everywhere): Ditto.
2965
2966         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
2967         location to constructor.
2968
2969         * class.cs (Property, Event, Indexer): Update accordingly.
2970
2971         * ../errors/cs111.cs : Added.
2972
2973         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
2974         of a method, as laid down by the spec.
2975
2976         (Invocation::OverloadResolve): Use the above method.
2977
2978 2001-10-31  Ravi Pratap  <ravi@ximian.com>
2979
2980         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
2981         now take a TypeContainer and a Parameters object.
2982
2983         (ParameterData): Modify return type of ParameterModifier method to be 
2984         Parameter.Modifier and not a string.
2985
2986         (ReflectionParameters, InternalParameters): Update accordingly.
2987
2988         * expression.cs (Argument::GetParameterModifier): Same here.
2989
2990         * support.cs (InternalParameters::ParameterType): Find a better way of determining
2991         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
2992         symbol in it at all so maybe this is only for now.
2993
2994 2001-10-30  Ravi Pratap  <ravi@ximian.com>
2995
2996         * support.cs (InternalParameters): Constructor now takes an extra argument 
2997         which is the actual Parameters class.
2998
2999         (ParameterDesc): Update to provide info on ref/out modifiers.
3000
3001         * class.cs (everywhere): Update call to InternalParameters to pass in
3002         the second argument too.
3003
3004         * support.cs (ParameterData): Add ParameterModifier, which is a method 
3005         to return the modifier info [ref/out etc]
3006
3007         (InternalParameters, ReflectionParameters): Implement the above.
3008
3009         * expression.cs (Argument::ParameterModifier): Similar function to return
3010         info about the argument's modifiers.
3011
3012         (Invocation::OverloadResolve): Update to take into account matching modifiers 
3013         too.
3014
3015         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
3016         a new SetFormalParameters object which we pass to InternalParameters.
3017
3018 2001-10-30  Ravi Pratap  <ravi@ximian.com>
3019
3020         * expression.cs (NewArray): Merge into the ArrayCreation class.
3021
3022 2001-10-29  Ravi Pratap  <ravi@ximian.com>
3023
3024         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
3025         NewUserdefinedArray into one as there wasn't much of a use in having
3026         two separate ones.
3027
3028         * expression.cs (Argument): Change field's name to ArgType from Type.
3029
3030         (Type): New readonly property which returns the proper type, taking into 
3031         account ref/out modifiers.
3032
3033         (everywhere): Adjust code accordingly for the above.
3034
3035         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
3036         whether we are emitting for a ref or out parameter.
3037
3038         * expression.cs (Argument::Emit): Use the above field to set the state.
3039
3040         (LocalVariableReference::Emit): Update to honour the flag and emit the
3041         right stuff.
3042
3043         * parameter.cs (Attributes): Set the correct flags for ref parameters.
3044
3045         * expression.cs (Argument::FullDesc): New function to provide a full desc.
3046
3047         * support.cs (ParameterData): Add method ParameterDesc to the interface.
3048
3049         (ReflectionParameters, InternalParameters): Implement the above method.
3050
3051         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
3052         reporting errors.
3053
3054         (Invocation::FullMethodDesc): Ditto. 
3055
3056 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
3057
3058         * cs-parser.jay: Add extra production for the second form of array
3059         creation. 
3060
3061         * expression.cs (ArrayCreation): Update to reflect the above
3062         change. 
3063
3064         * Small changes to prepare for Array initialization.
3065
3066 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
3067
3068         * typemanager.cs (ImplementsInterface): interface might be null;
3069         Deal with this problem;
3070
3071         Also, we do store negative hits on the cache (null values), so use
3072         this instead of calling t.GetInterfaces on the type everytime.
3073
3074 2001-10-28  Ravi Pratap  <ravi@ximian.com>
3075
3076         * typemanager.cs (IsBuiltinType): New method to help determine the same.
3077
3078         * expression.cs (New::DoResolve): Get rid of array creation code and instead
3079         split functionality out into different classes.
3080
3081         (New::FormArrayType): Move into NewBuiltinArray.
3082
3083         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
3084         quite useless.
3085
3086         (NewBuiltinArray): New class to handle creation of built-in arrays.
3087
3088         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
3089         account creation of one-dimensional arrays.
3090
3091         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
3092
3093         (NewUserdefinedArray::DoResolve): Implement.
3094
3095         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
3096
3097         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
3098         we maintain inside the TypeManager. This is necessary to perform lookups on the
3099         module builder.
3100
3101         (LookupType): Update to perform GetType on the module builders too.     
3102
3103         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
3104
3105         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
3106
3107 2001-10-23  Ravi Pratap  <ravi@ximian.com>
3108
3109         * expression.cs (New::DoResolve): Implement guts of array creation.
3110
3111         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
3112         
3113 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
3114
3115         * expression.cs: Fix bug I introduced lsat night that broke
3116         Delegates. 
3117
3118         (Expression.Resolve): Report a 246 error (can not resolve name)
3119         if we find a SimpleName in the stream.
3120         
3121         (Expression.ResolveLValue): Ditto.
3122         
3123         (Expression.ResolveWithSimpleName): This function is a variant of
3124         ResolveName, this one allows SimpleNames to be returned without a
3125         warning.  The only consumer of SimpleNames is MemberAccess
3126
3127 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
3128
3129         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
3130         might arrive here.  I have my doubts that this is correct.
3131
3132         * statement.cs (Lock): Implement lock statement.
3133
3134         * cs-parser.jay: Small fixes to support `lock' and `using'
3135
3136         * cs-tokenizer.cs: Remove extra space
3137
3138         * driver.cs: New flag --checked, allows to turn on integer math
3139         checking. 
3140
3141         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
3142         Threading.Monitor.Exit 
3143         
3144 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
3145
3146         * expression.cs (IndexerAccess::DoResolveLValue): Set the
3147         Expression Class to be IndexerAccess.
3148
3149         Notice that Indexer::DoResolve sets the eclass to Value.
3150
3151 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
3152
3153         * class.cs (TypeContainer::Emit): Emit code for indexers.
3154
3155         * assign.cs (IAssignMethod): New interface implemented by Indexers
3156         and Properties for handling assignment.
3157
3158         (Assign::Emit): Simplify and reuse code. 
3159         
3160         * expression.cs (IndexerAccess, PropertyExpr): Implement
3161         IAssignMethod, clean up old code. 
3162
3163 2001-10-22  Ravi Pratap  <ravi@ximian.com>
3164
3165         * typemanager.cs (ImplementsInterface): New method to determine if a type
3166         implements a given interface. Provides a nice cache too.
3167
3168         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
3169         method.
3170
3171         (ConvertReferenceExplicit): Ditto.
3172
3173         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
3174         various methods, with correct names etc.
3175
3176         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
3177         Operator.UnaryNegation.
3178
3179         * cs-parser.jay (operator_declarator): Be a little clever in the case where
3180         we have a unary plus or minus operator.
3181
3182         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
3183         UnaryMinus.
3184
3185         * everywhere : update accordingly.
3186
3187         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
3188         respectively.
3189
3190         * class.cs (Method::Define): For the case where we are implementing a method
3191         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
3192         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
3193         
3194 2001-10-21  Ravi Pratap  <ravi@ximian.com>
3195
3196         * interface.cs (FindMembers): Implement to work around S.R.E
3197         lameness.
3198
3199         * typemanager.cs (IsInterfaceType): Implement.
3200
3201         (FindMembers): Update to handle interface types too.
3202
3203         * expression.cs (ImplicitReferenceConversion): Re-write bits which
3204         use IsAssignableFrom as that is not correct - it doesn't work.
3205
3206         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
3207         and accordingly override EmitStatement.
3208
3209         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
3210         using the correct logic :-)
3211
3212 2001-10-19  Ravi Pratap  <ravi@ximian.com>
3213
3214         * ../errors/cs-11.cs : Add to demonstrate error -11 
3215
3216 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
3217
3218         * assign.cs (Assign::Resolve): Resolve right hand side first, and
3219         then pass this as a hint to ResolveLValue.
3220         
3221         * expression.cs (FieldExpr): Add Location information
3222
3223         (FieldExpr::LValueResolve): Report assignment to readonly
3224         variable. 
3225         
3226         (Expression::ExprClassFromMemberInfo): Pass location information.
3227
3228         (Expression::ResolveLValue): Add new method that resolves an
3229         LValue. 
3230
3231         (Expression::DoResolveLValue): Default invocation calls
3232         DoResolve. 
3233
3234         (Indexers): New class used to keep track of indexers in a given
3235         Type. 
3236
3237         (IStackStore): Renamed from LValue, as it did not really describe
3238         what this did.  Also ResolveLValue is gone from this interface and
3239         now is part of Expression.
3240
3241         (ElementAccess): Depending on the element access type
3242         
3243         * typemanager.cs: Add `indexer_name_type' as a Core type
3244         (System.Runtime.CompilerServices.IndexerNameAttribute)
3245
3246         * statement.cs (Goto): Take a location.
3247         
3248 2001-10-18  Ravi Pratap  <ravi@ximian.com>
3249
3250         * delegate.cs (Delegate::VerifyDelegate): New method to verify
3251         if two delegates are compatible.
3252
3253         (NewDelegate::DoResolve): Update to take care of the case when
3254         we instantiate a delegate from another delegate.
3255
3256         * typemanager.cs (FindMembers): Don't even try to look up members
3257         of Delegate types for now.
3258
3259 2001-10-18  Ravi Pratap  <ravi@ximian.com>
3260
3261         * delegate.cs (NewDelegate): New class to take care of delegate
3262         instantiation.
3263
3264         * expression.cs (New): Split the delegate related code out into 
3265         the NewDelegate class.
3266
3267         * delegate.cs (DelegateInvocation): New class to handle delegate 
3268         invocation.
3269
3270         * expression.cs (Invocation): Split out delegate related code into
3271         the DelegateInvocation class.
3272
3273 2001-10-17  Ravi Pratap  <ravi@ximian.com>
3274
3275         * expression.cs (New::DoResolve): Implement delegate creation fully
3276         and according to the spec.
3277
3278         (New::DoEmit): Update to handle delegates differently.
3279
3280         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
3281         because of which we were printing out arguments in reverse order !
3282
3283         * delegate.cs (VerifyMethod): Implement to check if the given method
3284         matches the delegate.
3285
3286         (FullDelegateDesc): Implement.
3287
3288         (VerifyApplicability): Implement.
3289
3290         * expression.cs (Invocation::DoResolve): Update to accordingly handle
3291         delegate invocations too.
3292
3293         (Invocation::Emit): Ditto.
3294
3295         * ../errors/cs1593.cs : Added.
3296
3297         * ../errors/cs1594.cs : Added.
3298
3299         * delegate.cs (InstanceExpression, TargetMethod): New properties.
3300
3301 2001-10-16  Ravi Pratap  <ravi@ximian.com>
3302
3303         * typemanager.cs (intptr_type): Core type for System.IntPtr
3304
3305         (InitCoreTypes): Update for the same.
3306
3307         (iasyncresult_type, asynccallback_type): Ditto.
3308
3309         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
3310         correct.
3311
3312         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
3313         too.
3314
3315         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
3316         the builders for the 4 members of a delegate type :-)
3317
3318         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
3319         type.
3320
3321         * expression.cs (New::DoResolve): Implement guts for delegate creation.
3322
3323         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
3324
3325 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
3326
3327         * statement.cs (Break::Emit): Implement.   
3328         (Continue::Emit): Implement.
3329
3330         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
3331         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
3332         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
3333         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
3334         end loop
3335         
3336         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
3337         properties that track the label for the current loop (begin of the
3338         loop and end of the loop).
3339
3340 2001-10-15  Ravi Pratap  <ravi@ximian.com>
3341
3342         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
3343         use of emitting anything at all.
3344
3345         * class.cs, rootcontext.cs : Get rid of calls to the same.
3346
3347         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
3348
3349         (Populate): Define the constructor correctly and set the implementation
3350         attributes.
3351
3352         * typemanager.cs (delegate_types): New hashtable to hold delegates that
3353         have been defined.
3354
3355         (AddDelegateType): Implement.
3356
3357         (IsDelegateType): Implement helper method.
3358
3359         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
3360
3361         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
3362         and accordingly handle it.
3363
3364         * delegate.cs (Populate): Take TypeContainer argument.
3365         Implement bits to define the Invoke method. However, I still haven't figured out
3366         how to take care of the native int bit :-(
3367
3368         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
3369         Qualify the name of the delegate, not its return type !
3370
3371         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
3372         conversion.
3373
3374         (StandardConversionExists): Checking for array types turns out to be recursive.
3375
3376         (ConvertReferenceExplicit): Implement array conversion.
3377
3378         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
3379         
3380 2001-10-12  Ravi Pratap  <ravi@ximian.com>
3381
3382         * cs-parser.jay (delegate_declaration): Store the fully qualified
3383         name as it is a type declaration.
3384
3385         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
3386         readonly.
3387
3388         (DefineDelegate): Renamed from Define. Does the same thing essentially,
3389         as TypeContainer::DefineType.
3390
3391         (Populate): Method in which all the definition of the various methods (Invoke)
3392         etc is done.
3393
3394         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
3395         see.
3396         
3397         (CloseDelegate): Finally creates the delegate.
3398
3399         * class.cs (TypeContainer::DefineType): Update to define delegates.
3400         (Populate, Emit and CloseType): Do the same thing here too.
3401
3402         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
3403         delegates in all these operations.
3404
3405 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
3406
3407         * expression.cs: LocalTemporary: a new expression used to
3408         reference a temporary that has been created.
3409
3410         * assign.cs: Handle PropertyAccess back here, so that we can
3411         provide the proper semantic access to properties.
3412
3413         * expression.cs (Expression::ConvertReferenceExplicit): Implement
3414         a few more explicit conversions. 
3415
3416         * modifiers.cs: `NEW' modifier maps to HideBySig.
3417
3418         * expression.cs (PropertyExpr): Make this into an
3419         ExpressionStatement, and support the EmitStatement code path. 
3420
3421         Perform get/set error checking, clean up the interface.
3422
3423         * assign.cs: recognize PropertyExprs as targets, and if so, turn
3424         them into toplevel access objects.
3425
3426 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
3427
3428         * expression.cs: PropertyExpr::PropertyExpr: use work around the
3429         SRE.
3430
3431         * typemanager.cs: Keep track here of our PropertyBuilders again to
3432         work around lameness in SRE.
3433
3434 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
3435
3436         * expression.cs (LValue::LValueResolve): New method in the
3437         interface, used to perform a second resolution pass for LValues. 
3438         
3439         (This::DoResolve): Catch the use of this in static methods.
3440
3441         (This::LValueResolve): Implement.
3442
3443         (This::Store): Remove warning, assigning to `this' in structures
3444         is 
3445
3446         (Invocation::Emit): Deal with invocation of
3447         methods on value types.  We need to pass the address to structure
3448         methods rather than the object itself.  (The equivalent code to
3449         emit "this" for structures leaves the entire structure on the
3450         stack instead of a pointer to it). 
3451
3452         (ParameterReference::DoResolve): Compute the real index for the
3453         argument based on whether the method takes or not a `this' pointer
3454         (ie, the method is static).
3455
3456         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
3457         value types returned from functions when we need to invoke a
3458         method on the sturcture.
3459         
3460
3461 2001-10-11  Ravi Pratap  <ravi@ximian.com>
3462
3463         * class.cs (TypeContainer::DefineType): Method to actually do the business of
3464         defining the type in the Modulebuilder or Typebuilder. This is to take
3465         care of nested types which need to be defined on the TypeBuilder using
3466         DefineNestedMethod.
3467
3468         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
3469         methods in RootContext, only ported to be part of TypeContainer.
3470
3471         (TypeContainer::GetInterfaceOrClass): Ditto.
3472
3473         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
3474
3475         * interface.cs (Interface::DefineInterface): New method. Does exactly
3476         what RootContext.CreateInterface did earlier, only it takes care of nested types 
3477         too.
3478
3479         (Interface::GetInterfaces): Move from RootContext here and port.
3480
3481         (Interface::GetInterfaceByName): Same here.
3482
3483         * rootcontext.cs (ResolveTree): Re-write.
3484
3485         (PopulateTypes): Re-write.
3486
3487         * class.cs (TypeContainer::Populate): Populate nested types too.
3488         (TypeContainer::Emit): Emit nested members too.
3489
3490         * typemanager.cs (AddUserType): Do not make use of the FullName property,
3491         instead just use the name argument passed in as it is already fully
3492         qualified.
3493
3494         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
3495         to TypeContainer mapping to see if a type is user-defined.
3496
3497         * class.cs (TypeContainer::CloseType): Implement. 
3498
3499         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
3500         the default constructor.
3501         
3502         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
3503         twice.
3504
3505         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
3506
3507         * interface.cs (CloseType): Create the type here.
3508         
3509         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
3510         the hierarchy.
3511
3512         Remove all the methods which are now in TypeContainer.
3513
3514 2001-10-10  Ravi Pratap  <ravi@ximian.com>
3515
3516         * delegate.cs (Define): Re-write bits to define the delegate
3517         correctly.
3518
3519 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
3520
3521         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
3522
3523         * expression.cs (ImplicitReferenceConversion): handle null as well
3524         as a source to convert to any reference type.
3525
3526         * statement.cs (Return): Perform any implicit conversions to
3527         expected return type.  
3528
3529         Validate use of return statement.  
3530
3531         * codegen.cs (EmitContext): Pass the expected return type here.
3532
3533         * class.cs (Method, Constructor, Property): Pass expected return
3534         type to EmitContext.
3535
3536 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
3537
3538         * expression.cs: Make DoResolve take an EmitContext instead of a
3539         TypeContainer.
3540
3541         Replaced `l' and `location' for `loc', for consistency.
3542         
3543         (Error, Warning): Remove unneeded Tc argument.
3544
3545         * assign.cs, literal.cs, constant.cs: Update to new calling
3546         convention. 
3547         
3548         * codegen.cs: EmitContext now contains a flag indicating whether
3549         code is being generated in a static method or not.
3550
3551         * cs-parser.jay: DecomposeQI, new function that replaces the old
3552         QualifiedIdentifier.  Now we always decompose the assembled
3553         strings from qualified_identifier productions into a group of
3554         memberaccesses.
3555
3556 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
3557
3558         * rootcontext.cs: Deal with field-less struct types correctly now
3559         by passing the size option to Define Type.
3560
3561         * class.cs: Removed hack that created one static field. 
3562
3563 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
3564
3565         * statement.cs: Moved most of the code generation here. 
3566
3567 2001-10-09  Ravi Pratap  <ravi@ximian.com>
3568
3569         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
3570         seem very right.
3571
3572         (ElementAccess): Remove useless bits for now - keep checks as the spec
3573         says.
3574
3575 2001-10-08  Ravi Pratap  <ravi@ximian.com>
3576
3577         * expression.cs (ElementAccess::DoResolve): Remove my crap code
3578         and start performing checks according to the spec.
3579
3580 2001-10-07  Ravi Pratap  <ravi@ximian.com>
3581
3582         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
3583         rank_specifiers instead.
3584
3585         (rank_specifiers): Change the order in which the rank specifiers are stored
3586
3587         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
3588
3589         * expression.cs (ElementAccess): Implement the LValue interface too.
3590         
3591 2001-10-06  Ravi Pratap  <ravi@ximian.com>
3592         
3593         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
3594         except that user defined conversions are not included.
3595
3596         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
3597         perform the conversion of the return type, if necessary.
3598
3599         (New::DoResolve): Check whether we are creating an array or an object
3600         and accordingly do the needful.
3601
3602         (New::Emit): Same here.
3603
3604         (New::DoResolve): Implement guts of array creation.
3605
3606         (New::FormLookupType): Helper function.
3607
3608 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
3609
3610         * codegen.cs: Removed most of the code generation here, and move the
3611         corresponding code generation bits to the statement classes. 
3612
3613         Added support for try/catch/finalize and throw.
3614         
3615         * cs-parser.jay: Added support for try/catch/finalize.
3616
3617         * class.cs: Catch static methods having the flags override,
3618         virtual or abstract.
3619
3620         * expression.cs (UserCast): This user cast was not really doing
3621         what it was supposed to do.  Which is to be born in fully resolved
3622         state.  Parts of the resolution were being performed at Emit time! 
3623
3624         Fixed this code.
3625
3626 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
3627
3628         * expression.cs: Implicity convert the result from UserCast.
3629
3630 2001-10-05  Ravi Pratap  <ravi@ximian.com>
3631
3632         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
3633         prevented it from working correctly. 
3634
3635         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
3636         merely ConvertImplicit.
3637
3638 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
3639
3640         * typemanager.cs: Make the LookupTypeContainer function static,
3641         and not per-instance.  
3642
3643         * class.cs: Make static FindMembers (the one that takes a Type
3644         argument). 
3645
3646         * codegen.cs: Add EmitForeach here.
3647
3648         * cs-parser.jay: Make foreach a toplevel object instead of the
3649         inline expansion, as we need to perform semantic analysis on it. 
3650
3651 2001-10-05  Ravi Pratap  <ravi@ximian.com>
3652
3653         * expression.cs (Expression::ImplicitUserConversion): Rename to
3654         UserDefinedConversion.
3655
3656         (Expression::UserDefinedConversion): Take an extra argument specifying 
3657         whether we look for explicit user conversions too.
3658
3659         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
3660
3661         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
3662
3663         (ExplicitUserConversion): Make it a call to UserDefinedConversion
3664         with the appropriate arguments.
3665
3666         * cs-parser.jay (cast_expression): Record location too.
3667
3668         * expression.cs (Cast): Record location info.
3669
3670         (Expression::ConvertExplicit): Take location argument.
3671
3672         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
3673         to determine if we are doing explicit conversions.
3674
3675         (UserCast::Emit): Update accordingly.
3676
3677         (Expression::ConvertExplicit): Report an error if everything fails.
3678
3679         * ../errors/cs0030.cs : Add.
3680
3681 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
3682
3683         * modifiers.cs: If the ABSTRACT keyword is present, also set the
3684         virtual and newslot bits. 
3685
3686         * class.cs (TypeContainer::RegisterRequiredImplementations):
3687         Record methods we need.
3688
3689         (TypeContainer::MakeKey): Helper function to make keys for
3690         MethodBases, since the Methodbase key is useless.
3691
3692         (TypeContainer::Populate): Call RegisterRequiredImplementations
3693         before defining the methods.   
3694
3695         Create a mapping for method_builders_to_methods ahead of time
3696         instead of inside a tight loop.
3697
3698         (::RequireMethods):  Accept an object as the data to set into the
3699         hashtable so we can report interface vs abstract method mismatch.
3700
3701 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
3702
3703         * report.cs: Make all of it static.
3704
3705         * rootcontext.cs: Drop object_type and value_type computations, as
3706         we have those in the TypeManager anyways.
3707
3708         Drop report instance variable too, now it is a global.
3709
3710         * driver.cs: Use try/catch on command line handling.
3711
3712         Add --probe option to debug the error reporting system with a test
3713         suite. 
3714
3715         * report.cs: Add support for exiting program when a probe
3716         condition is reached.
3717
3718 2001-10-03  Ravi Pratap  <ravi@ximian.com>
3719
3720         * expression.cs (Binary::DoNumericPromotions): Fix the case when
3721         we do a forcible conversion regardless of type, to check if 
3722         ForceConversion returns a null.
3723
3724         (Binary::error19): Use location to report error.
3725
3726         (Unary::error23): Use location here too.
3727
3728         * ../errors/cs0019.cs : Check in.
3729
3730         * ../errors/cs0023.cs : Check in.
3731
3732         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
3733         case of a non-null MethodInfo object with a length of 0 !
3734
3735         (Binary::ResolveOperator): Flag error if overload resolution fails to find
3736         an applicable member - according to the spec :-)
3737         Also fix logic to find members in base types.
3738
3739         (Unary::ResolveOperator): Same here.
3740
3741         (Unary::report23): Change name to error23 and make first argument a TypeContainer
3742         as I was getting thoroughly confused between this and error19 :-)
3743         
3744         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
3745         (::FindMostEncompassedType): Implement.
3746         (::FindMostEncompassingType): Implement.
3747         (::StandardConversionExists): Implement.
3748
3749         (UserImplicitCast): Re-vamp. We now need info about most specific
3750         source and target types so that we can do the necessary conversions.
3751
3752         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
3753         mathematical union with no duplicates.
3754
3755 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
3756
3757         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
3758         in order from base classes to child classes, so that we can in
3759         child classes look up in our parent for method names and
3760         attributes (required for handling abstract, virtual, new, override
3761         constructs: we need to instrospect our base class, and if we dont
3762         populate the classes in order, the introspection might be
3763         incorrect.  For example, a method could query its parent before
3764         the parent has any methods and would determine that the parent has
3765         no abstract methods (while it could have had them)).
3766
3767         (RootContext::CreateType): Record the order in which we define the
3768         classes.
3769
3770 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
3771
3772         * class.cs (TypeContainer::Populate): Also method definitions can
3773         fail now, keep track of this.
3774
3775         (TypeContainer::FindMembers): Implement support for
3776         DeclaredOnly/noDeclaredOnly flag.
3777
3778         (Constructor::Emit) Return the ConstructorBuilder.
3779
3780         (Method::Emit) Return the MethodBuilder. 
3781         Check for abstract or virtual methods to be public.
3782
3783         * rootcontext.cs (RootContext::CreateType): Register all the
3784         abstract methods required for the class to be complete and the
3785         interface methods that must be implemented. 
3786
3787         * cs-parser.jay: Report error 501 (method requires body if it is
3788         not marked abstract or extern).
3789
3790         * expression.cs (TypeOf::Emit): Implement.
3791
3792         * typemanager.cs: runtime_handle_type, new global type.
3793
3794         * class.cs (Property::Emit): Generate code for properties.
3795
3796 2001-10-02  Ravi Pratap  <ravi@ximian.com>
3797
3798         * expression.cs (Unary::ResolveOperator): Find operators on base type
3799         too - we now conform exactly to the spec.
3800
3801         (Binary::ResolveOperator): Same here.
3802
3803         * class.cs (Operator::Define): Fix minor quirk in the tests.
3804
3805         * ../errors/cs0215.cs : Added.
3806
3807         * ../errors/cs0556.cs : Added.
3808
3809         * ../errors/cs0555.cs : Added.
3810
3811 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
3812
3813         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
3814         single integer which is really efficient
3815
3816 2001-10-01  Ravi Pratap  <ravi@ximian.com>
3817
3818         *  expression.cs (Expression::ImplicitUserConversion): Use location
3819         even in the case when we are examining True operators.
3820  
3821         * class.cs (Operator::Define): Perform extensive checks to conform
3822         with the rules for operator overloading in the spec.
3823
3824         * expression.cs (Expression::ImplicitReferenceConversion): Implement
3825         some of the other conversions mentioned in the spec.
3826
3827         * typemanager.cs (array_type): New static member for the System.Array built-in
3828         type.
3829
3830         (cloneable_interface): For System.ICloneable interface.
3831
3832         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
3833         we start resolving the tree and populating types.
3834
3835         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
3836  
3837 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
3838
3839         * expression.cs (Expression::ExprClassFromMemberInfo,
3840         Expression::Literalize): Create literal expressions from
3841         FieldInfos which are literals.
3842
3843         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
3844         type casts, because they were wrong.  The test suite in tests
3845         caught these ones.
3846
3847         (ImplicitNumericConversion): ushort to ulong requires a widening
3848         cast. 
3849
3850         Int32 constant to long requires widening cast as well.
3851
3852         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
3853         for integers because the type on the stack is not i4.
3854
3855 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
3856
3857         * expression.cs (report118): require location argument. 
3858
3859         * parameter.cs: Do not dereference potential null value.
3860
3861         * class.cs: Catch methods that lack the `new' keyword when
3862         overriding a name.  Report warnings when `new' is used without
3863         anything being there to override.
3864
3865         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
3866
3867         * class.cs: Only add constructor to hashtable if it is non-null
3868         (as now constructors can fail on define).
3869
3870         (TypeManager, Class, Struct): Take location arguments.
3871
3872         Catch field instance initialization in structs as errors.
3873
3874         accepting_filter: a new filter for FindMembers that is static so
3875         that we dont create an instance per invocation.
3876
3877         (Constructor::Define): Catch errors where a struct constructor is
3878         parameterless 
3879
3880         * cs-parser.jay: Pass location information for various new
3881         constructs. 
3882         
3883         * delegate.cs (Delegate): take a location argument.
3884
3885         * driver.cs: Do not call EmitCode if there were problesm in the
3886         Definition of the types, as many Builders wont be there. 
3887
3888         * decl.cs (Decl::Decl): Require a location argument.
3889
3890         * cs-tokenizer.cs: Handle properly hex constants that can not fit
3891         into integers, and find the most appropiate integer for it.
3892
3893         * literal.cs: Implement ULongLiteral.
3894
3895         * rootcontext.cs: Provide better information about the location of
3896         failure when CreateType fails.
3897         
3898 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
3899
3900         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
3901         as well.
3902
3903         * expression.cs (Binary::CheckShiftArguments): Add missing type
3904         computation.
3905         (Binary::ResolveOperator): Add type to the logical and and logical
3906         or, Bitwise And/Or and Exclusive Or code paths, it was missing
3907         before.
3908
3909         (Binary::DoNumericPromotions): In the case where either argument
3910         is ulong (and most signed types combined with ulong cause an
3911         error) perform implicit integer constant conversions as well.
3912
3913 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
3914
3915         * expression.cs (UserImplicitCast): Method should always be
3916         non-null. 
3917         (Invocation::BetterConversion): Simplified test for IntLiteral.
3918
3919         (Expression::ImplicitNumericConversion): Split this routine out.
3920         Put the code that performs implicit constant integer conversions
3921         here. 
3922
3923         (Expression::Resolve): Become a wrapper around DoResolve so we can
3924         check eclass and type being set after resolve.
3925
3926         (Invocation::Badness): Remove this dead function
3927
3928         (Binary::ResolveOperator): Do not compute the expensive argumnets
3929         unless we have a union for it.
3930
3931         (Probe::Emit): Is needs to do an isinst and then
3932         compare against null.
3933
3934         (::CanConvert): Added Location argument.  If the Location argument
3935         is null (Location.Null), then we do not report errors.  This is
3936         used by the `probe' mechanism of the Explicit conversion.  We do
3937         not want to generate an error for something that the user
3938         explicitly requested to be casted.  But the pipeline for an
3939         explicit cast first tests for potential implicit casts.
3940
3941         So for now, if the Location is null, it means `Probe only' to
3942         avoid adding another argument.   Might have to revise this
3943         strategy later.
3944
3945         (ClassCast): New class used to type cast objects into arbitrary
3946         classes (used in Explicit Reference Conversions).
3947
3948         Implement `as' as well.
3949
3950         Reverted all the patches from Ravi below: they were broken:
3951
3952                 * The use of `level' as a mechanism to stop recursive
3953                   invocations is wrong.  That was there just to catch the
3954                   bug with a strack trace but not as a way of addressing
3955                   the problem.
3956
3957                   To fix the problem we have to *understand* what is going
3958                   on and the interactions and come up with a plan, not
3959                   just get things going.
3960
3961                 * The use of the type conversion cache that I proposed
3962                   last night had an open topic: How does this work across
3963                   protection domains.  A user defined conversion might not
3964                   be public in the location where we are applying the
3965                   conversion, a different conversion might be selected
3966                   (ie, private A->B (better) but public B->A (worse),
3967                   inside A, A->B applies, but outside it, B->A will
3968                   apply).
3969
3970                 * On top of that (ie, even if the above is solved),
3971                   conversions in a cache need to be abstract.  Ie, `To
3972                   convert from an Int to a Short use an OpcodeCast', not
3973                   `To convert from an Int to a Short use the OpcodeCast on
3974                   the variable 5' (which is what this patch was doing).
3975         
3976 2001-09-28  Ravi Pratap  <ravi@ximian.com>
3977
3978         * expression.cs (Invocation::ConversionExists): Re-write to use
3979         the conversion cache
3980         
3981         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
3982         cache all conversions done, not just user-defined ones.
3983
3984         (Invocation::BetterConversion): The real culprit. Use ConversionExists
3985         to determine if a conversion exists instead of acutually trying to 
3986         perform the conversion. It's faster too.
3987
3988         (Expression::ConvertExplicit): Modify to use ConversionExists to check
3989         and only then attempt the implicit conversion.
3990
3991 2001-09-28  Ravi Pratap  <ravi@ximian.com>
3992
3993         * expression.cs (ConvertImplicit): Use a cache for conversions
3994         already found. Check level of recursion and bail out if necessary.
3995         
3996 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
3997
3998         * typemanager.cs (string_concat_string_string, string_concat_object_object):
3999         Export standard methods that we expect for string operations.
4000         
4001         * statement.cs (Block::UsageWarning): Track usage of variables and
4002         report the errors for not used variables.
4003
4004         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
4005         operator. 
4006
4007 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
4008
4009         * codegen.cs: remove unnneded code 
4010
4011         * expression.cs: Removed BuiltinTypeAccess class
4012
4013         Fix the order in which implicit conversions are
4014         done.  
4015
4016         The previous fixed dropped support for boxed conversions (adding a
4017         test to the test suite now)
4018
4019         (UserImplicitCast::CanConvert): Remove test for source being null,
4020         that code is broken.  We should not feed a null to begin with, if
4021         we do, then we should track the bug where the problem originates
4022         and not try to cover it up here.
4023
4024         Return a resolved expression of type UserImplicitCast on success
4025         rather than true/false.  Ravi: this is what I was talking about,
4026         the pattern is to use a static method as a "constructor" for
4027         objects. 
4028
4029         Also, do not create arguments until the very last minute,
4030         otherwise we always create the arguments even for lookups that
4031         will never be performed. 
4032
4033         (UserImplicitCast::Resolve): Eliminate, objects of type
4034         UserImplicitCast are born in a fully resolved state. 
4035         
4036         * typemanager.cs (InitCoreTypes): Init also value_type
4037         (System.ValueType). 
4038
4039         * expression.cs (Cast::Resolve): First resolve the child expression.
4040
4041         (LValue): Add new method AddressOf to be used by
4042         the `&' operator.  
4043
4044         Change the argument of Store to take an EmitContext instead of an
4045         ILGenerator, because things like FieldExpr need to be able to call
4046         their children expression to generate the instance code. 
4047
4048         (Expression::Error, Expression::Warning): Sugar functions for
4049         reporting errors.
4050
4051         (Expression::MemberLookup): Accept a TypeContainer instead of a
4052         Report as the first argument.
4053
4054         (Expression::ResolvePrimary): Killed.  I still want to improve
4055         this as currently the code is just not right.
4056
4057         (Expression::ResolveMemberAccess): Simplify, but it is still
4058         wrong. 
4059
4060         (Unary::Resolve): Catch errors in AddressOf operators.
4061
4062         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
4063         index to a byte for the short-version, or the compiler will choose
4064         the wrong Emit call, which generates the wrong data.
4065
4066         (ParameterReference::Emit, ::Store): same.
4067
4068         (FieldExpr::AddressOf): Implement.
4069         
4070         * typemanager.cs: TypeManager: made public variable instead of
4071         property.
4072         
4073         * driver.cs: document --fatal.
4074
4075         * report.cs (ErrorMessage, WarningMessage): new names for the old
4076         Error and Warning classes.
4077
4078         * cs-parser.jay (member_access): Turn built-in access to types
4079         into a normal simplename
4080
4081 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4082
4083         * expression.cs (Invocation::BetterConversion): Fix to cope
4084         with q being null, since this was introducing a bug.
4085
4086         * expression.cs (ConvertImplicit): Do built-in conversions first.
4087
4088 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4089
4090         * expression.cs (UserImplicitCast::Resolve): Fix bug.
4091
4092 2001-09-27  Ravi Pratap  <ravi@ximian.com>
4093
4094         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
4095         I had introduced long ago (what's new ?).
4096
4097         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
4098         the work of all the checking. 
4099         (ConvertImplicit): Call CanConvert and only then create object if necessary.
4100         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
4101
4102         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
4103         that is the right way. 
4104
4105         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
4106         overloading resolution. Use everywhere instead of cutting and pasting code.
4107
4108         (Binary::ResolveOperator): Use MakeUnionSet.
4109
4110         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
4111         we have to convert to bool types. Not complete yet.
4112         
4113 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
4114
4115         * typemanager.cs (TypeManager::CSharpName): support ushort.
4116
4117         * expression.cs (Expression::TryImplicitIntConversion): Attempts
4118         to provide an expression that performsn an implicit constant int
4119         conversion (section 6.1.6).
4120         (Expression::ConvertImplicitRequired): Reworked to include
4121         implicit constant expression conversions.
4122
4123         (Expression::ConvertNumericExplicit): Finished.
4124
4125         (Invocation::Emit): If InstanceExpression is null, then it means
4126         that we perform a call on this.
4127         
4128 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
4129
4130         * expression.cs (Unary::Emit): Remove some dead code.
4131         (Probe): Implement Resolve and Emit for `is'.
4132         (Expression::ConvertImplicitRequired): Attempt to do constant
4133         expression conversions here.  Maybe should be moved to
4134         ConvertImplicit, but I am not sure.
4135         (Expression::ImplicitLongConstantConversionPossible,
4136         Expression::ImplicitIntConstantConversionPossible): New functions
4137         that tell whether is it possible to apply an implicit constant
4138         expression conversion.
4139
4140         (ConvertNumericExplicit): Started work on explicit numeric
4141         conversions.
4142
4143         * cs-parser.jay: Update operator constants.
4144
4145         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
4146         (Parameters::GetSignature): Hook up VerifyArgs here.
4147         (Parameters::VerifyArgs): Verifies that no two arguments have the
4148         same name. 
4149
4150         * class.cs (Operator): Update the operator names to reflect the
4151         ones that the spec expects (as we are just stringizing the
4152         operator names).
4153         
4154         * expression.cs (Unary::ResolveOperator): Fix bug: Use
4155         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
4156         previous usage did only work for our methods.
4157         (Expression::ConvertImplicit): Handle decimal implicit numeric
4158         conversions as well.
4159         (Expression::InternalTypeConstructor): Used to invoke constructors
4160         on internal types for default promotions.
4161
4162         (Unary::Emit): Implement special handling for the pre/post
4163         increment/decrement for overloaded operators, as they need to have
4164         the same semantics as the other operators.
4165
4166         (Binary::ResolveOperator): ditto.
4167         (Invocation::ConversionExists): ditto.
4168         (UserImplicitCast::Resolve): ditto.
4169         
4170 2001-09-26  Ravi Pratap  <ravi@ximian.com>
4171
4172         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
4173         operator, return after emitting body. Regression tests pass again !
4174
4175         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
4176         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
4177         (Invocation::OverloadResolve): Ditto.
4178         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
4179
4180         * everywhere : update calls to the above methods accordingly.
4181
4182 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
4183
4184         * assign.cs (Assign): Make it inherit from ExpressionStatement.
4185
4186         * expression.cs (ExpressionStatement): New base class used for
4187         expressions that can appear in statements, so that we can provide
4188         an alternate path to generate expression that do not leave a value
4189         on the stack.
4190
4191         (Expression::Emit, and all the derivatives): We no longer return
4192         whether a value is left on the stack or not.  Every expression
4193         after being emitted leaves a single value on the stack.
4194
4195         * codegen.cs (EmitContext::EmitStatementExpression): Use the
4196         facilties of ExpressionStatement if possible.
4197
4198         * cs-parser.jay: Update statement_expression.
4199
4200 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
4201
4202         * driver.cs: Change the wording of message
4203
4204 2001-09-25  Ravi Pratap  <ravi@ximian.com>
4205
4206         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
4207         the type of the expression to the return type of the method if
4208         we have an overloaded operator match ! The regression tests pass again !
4209         (Unary::ResolveOperator): Ditto.
4210
4211         * expression.cs (Invocation::ConversionExists): Correct the member lookup
4212         to find "op_Implicit", not "implicit" ;-)
4213         (UserImplicitCast): New class to take care of user-defined implicit conversions.
4214         (ConvertImplicit, ForceConversion): Take TypeContainer argument
4215
4216         * everywhere : Correct calls to the above accordingly.
4217
4218         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
4219         (ConvertImplicit): Do user-defined conversion if it exists.
4220
4221 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
4222
4223         * assign.cs: track location.
4224         (Resolve): Use implicit conversions on assignment.
4225
4226         * literal.cs: Oops.  Not good, Emit of short access values should
4227         pass (Bytes) or the wrong argument will be selected.
4228
4229         * expression.cs (Unary::Emit): Emit code for -expr.
4230         
4231         (Unary::ResolveOperator): Handle `Substract' for non-constants
4232         (substract from zero from the non-constants).
4233         Deal with Doubles as well. 
4234         
4235         (Expression::ConvertImplicitRequired): New routine that reports an
4236         error if no implicit conversion exists. 
4237
4238         (Invocation::OverloadResolve): Store the converted implicit
4239         expressions if we make them
4240         
4241 2001-09-24  Ravi Pratap  <ravi@ximian.com>
4242
4243         * class.cs (ConstructorInitializer): Take a Location argument.
4244         (ConstructorBaseInitializer): Same here.
4245         (ConstructorThisInitializer): Same here.
4246
4247         * cs-parser.jay : Update all calls accordingly.
4248
4249         * expression.cs (Unary, Binary, New): Take location argument.
4250         Update accordingly everywhere.
4251
4252         * cs-parser.jay : Update all calls to the above to take a location
4253         argument.
4254
4255         * class.cs : Ditto.
4256
4257 2001-09-24  Ravi Pratap  <ravi@ximian.com>
4258
4259         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
4260         (Invocation::BetterConversion): Same here
4261         (Invocation::ConversionExists): Ditto.
4262
4263         (Invocation::ConversionExists): Implement.
4264
4265 2001-09-22  Ravi Pratap  <ravi@ximian.com>
4266
4267         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
4268         Also take an additional TypeContainer argument.
4269
4270         * All over : Pass in TypeContainer as argument to OverloadResolve.
4271
4272         * typemanager.cs (CSharpName): Update to check for the string type and return
4273         that too.
4274
4275         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
4276         a given method.
4277         
4278 2001-09-21  Ravi Pratap  <ravi@ximian.com>
4279
4280         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
4281         (Invocation::BetterFunction): Implement.
4282         (Invocation::BetterConversion): Implement.
4283         (Invocation::ConversionExists): Skeleton, no implementation yet.
4284
4285         Okay, things work fine !
4286
4287 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
4288
4289         * typemanager.cs: declare and load enum_type, delegate_type and
4290         void_type. 
4291
4292         * expression.cs (Expression::Emit): Now emit returns a value that
4293         tells whether a value is left on the stack or not.  This strategy
4294         might be reveted tomorrow with a mechanism that would address
4295         multiple assignments.
4296         (Expression::report118): Utility routine to report mismatches on
4297         the ExprClass.
4298
4299         (Unary::Report23): Report impossible type/operator combination
4300         utility function.
4301
4302         (Unary::IsIncrementableNumber): Whether the type can be
4303         incremented or decremented with add.
4304         (Unary::ResolveOperator): Also allow enumerations to be bitwise
4305         complemented. 
4306         (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
4307
4308         (Invocation::Emit): Deal with new Emit convetion.
4309         
4310         * All Expression derivatives: Updated their Emit method to return
4311         whether they leave values on the stack or not.
4312         
4313         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
4314         stack for expressions that are statements. 
4315
4316 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
4317
4318         * expression.cs (LValue): New interface.  Must be implemented by
4319         LValue objects.
4320         (LocalVariableReference, ParameterReference, FieldExpr): Implement
4321         LValue interface.
4322         
4323         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
4324         interface for generating code, simplifies the code.
4325
4326 2001-09-20  Ravi Pratap  <ravi@ximian.com>
4327
4328         * expression.cs (everywhere): Comment out return statements in ::Resolve
4329         methods to avoid the warnings.
4330
4331 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
4332
4333         * driver.cs (parse): Report error 2001 if we can not open the
4334         source file.
4335
4336         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
4337         not resolve it.
4338
4339         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
4340         object. 
4341
4342         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
4343         otherwise nested blocks end up with the same index.
4344
4345         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
4346
4347         * expression.cs:  Instead of having FIXMEs in the Resolve
4348         functions, throw exceptions so it is obvious that we are facing a
4349         bug. 
4350
4351         * cs-parser.jay (invocation_expression): Pass Location information.
4352
4353         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
4354         Use a basename for those routines because .NET does not like paths
4355         on them. 
4356
4357         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
4358         already defined.
4359
4360 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
4361
4362         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
4363         are loading the correct data types (throws an exception if not).
4364         (TypeManager::InitCoreTypes): Use CoreLookupType
4365
4366         * expression.cs (Unary::ResolveOperator): return the child
4367         expression for expressions which are just +expr.
4368         (Unary::ResolveOperator): Return negative literals for -LITERAL
4369         expressions (otherwise they are Unary {Literal}).
4370         (Invocation::Badness): Take into account `Implicit constant
4371         expression conversions'.
4372
4373         * literal.cs (LongLiteral): Implement long literal class.
4374         (IntLiteral): export the `Value' of the intliteral. 
4375
4376 2001-09-19  Ravi Pratap  <ravi@ximian.com>
4377
4378         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
4379
4380         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
4381         instead of 'Operator'
4382
4383         * expression.cs (Binary::ResolveOperator): Update accordingly.
4384         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
4385         and 'Minus'
4386
4387         * cs-parser.jay (unary_expression): Update to use the new names.
4388
4389         * gen-treedump.cs (GetUnary): Same here.
4390
4391         * expression.cs (Unary::Resolve): Implement.
4392         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
4393         operators are found instead of making noise ;-)
4394         (Unary::ResolveOperator): New method to do precisely the same thing which
4395         Binary::ResolveOperator does for Binary expressions.
4396         (Unary.method, .Arguments): Add.
4397         (Unary::OperName): Implement.   
4398         (Unary::ForceConversion): Copy and Paste !
4399
4400         * class.cs (Operator::Define): Fix a small bug for the case when we have 
4401         a unary operator.
4402
4403         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
4404         for the inbuilt operators. Only overloading works for now ;-)
4405
4406 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
4407
4408         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
4409         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
4410
4411         * expression.cs (This::Emit): Implement. 
4412         (This::Resolve): Implement.
4413         (TypeOf:Resolve): Implement.
4414         (Expression::ResolveSimpleName): Add an implicit this to instance
4415         field references. 
4416         (MemberAccess::Resolve): Deal with Parameters and Fields. 
4417         Bind instance variable to Field expressions.
4418         (FieldExpr::Instance): New field used to track the expression that
4419         represents the object instance.
4420         (FieldExpr::Resolve): Track potential errors from MemberLookup not
4421         binding 
4422         (FieldExpr::Emit): Implement.
4423
4424         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
4425         the last instruction contains a return opcode to avoid generating
4426         the last `ret' instruction (this generates correct code, and it is
4427         nice to pass the peverify output).
4428
4429         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
4430         initializer for static and instance variables.
4431         (Constructor::Emit): Allow initializer to be null in the case of
4432         static constructors.  Only emit initializer for instance
4433         constructors. 
4434
4435         (TypeContainer::FindMembers): Return a null array if there are no
4436         matches.
4437
4438         Also fix the code for the MemberTypes.Method branch, as it was not
4439         scanning that for operators (or tried to access null variables before).
4440
4441         * assign.cs (Assign::Emit): Handle instance and static fields. 
4442
4443         * TODO: Updated.
4444
4445         * driver.cs: Stop compilation if there are parse errors.
4446
4447         * cs-parser.jay (constructor_declaration): Provide default base
4448         initializer for non-static constructors.
4449         (constructor_declarator): Do not provide a default base
4450         initializers if none was specified.
4451         Catch the fact that constructors should not have parameters.
4452
4453         * class.cs: Do not emit parent class initializers for static
4454         constructors, that should be flagged as an error.
4455
4456 2001-09-18  Ravi Pratap  <ravi@ximian.com>
4457
4458         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
4459         Move back code into TypeContainer::Populate.
4460
4461 2001-09-18  Ravi Pratap  <ravi@ximian.com>
4462
4463         * class.cs (TypeContainer::AddConstructor): Fix the check to
4464         compare against Name, not Basename. 
4465         (Operator::OpType): Change Plus and Minus to Add and Subtract.
4466
4467         * cs-parser.jay : Update accordingly.
4468
4469         * class.cs (TypeContainer::FindMembers): For the case where we are searching
4470         for methods, don't forget to look into the operators too.
4471         (RegisterMethodBuilder): Helper method to take care of this for
4472         methods, constructors and operators.
4473         (Operator::Define): Completely revamp.
4474         (Operator.OperatorMethod, MethodName): New fields.
4475         (TypeContainer::Populate): Move the registering of builders into
4476         RegisterMethodBuilder.
4477         (Operator::Emit): Re-write.
4478
4479         * expression.cs (Binary::Emit): Comment out code path to emit method
4480         invocation stuff for the case when we have a user defined operator. I am
4481         just not able to get it right !
4482         
4483 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
4484
4485         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
4486         argument. 
4487
4488         (Expression::MemberLookup): Provide a version that allows to
4489         specify the MemberTypes and BindingFlags. 
4490
4491         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
4492         so it was not fetching variable information from outer blocks.
4493
4494         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
4495         Beforefieldinit as it was buggy.
4496
4497         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
4498         that Ravi put here.  
4499
4500         * class.cs (Constructor::Emit): Only emit if block is not null.
4501         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
4502         deal with this by semantically definining it as if the user had
4503         done it.
4504
4505         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
4506         constructors as we now "emit" them at a higher level.
4507
4508         (TypeContainer::DefineDefaultConstructor): Used to define the
4509         default constructors if none was provided.
4510
4511         (ConstructorInitializer): Add methods Resolve and Emit. 
4512         
4513         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
4514
4515 2001-09-17  Ravi Pratap  <ravi@ximian.com>
4516
4517         * class.cs (TypeContainer::EmitDefaultConstructor): Register
4518         the default constructor builder with our hashtable for methodbuilders
4519         to methodcores.
4520
4521         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
4522         and argument_count is 0 in which case we have a match.
4523         (Binary::ResolveOperator): More null checking and miscellaneous coding
4524         style cleanup.
4525
4526 2001-09-17  Ravi Pratap  <ravi@ximian.com>
4527
4528         * rootcontext.cs (IsNameSpace): Compare against null.
4529
4530         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
4531
4532         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
4533         and Unary::Operator.
4534
4535         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
4536         accordingly.
4537
4538         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
4539         we have overloaded operators.
4540         (Binary::ResolveOperator): Implement the part which does the operator overload
4541         resolution.
4542
4543         * class.cs (Operator::Emit): Implement.
4544         (TypeContainer::Emit): Emit the operators we have too.
4545
4546         * expression.cs (Binary::Emit): Update to emit the appropriate code for
4547         the case when we have a user-defined operator.
4548         
4549 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
4550
4551         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
4552
4553 2001-09-16  Ravi Pratap  <ravi@ximian.com>
4554
4555         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
4556         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
4557         (Constructor::Emit): Implement.
4558         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
4559         if we have no work to do. 
4560         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
4561         Emit method.
4562
4563         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
4564         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
4565
4566         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
4567         of parent.parent.
4568
4569 2001-09-15  Ravi Pratap  <ravi@ximian.com>
4570
4571         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
4572         in the source.
4573         (Tree::RecordNamespace): Method to do what the name says ;-)
4574         (Tree::Namespaces): Property to get at the namespaces hashtable.
4575
4576         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
4577         keep track.
4578
4579         * rootcontext.cs (IsNamespace): Fixed it :-)
4580
4581 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
4582
4583         * class.cs (TypeContainer::FindMembers): Add support for
4584         constructors. 
4585         (MethodCore): New class that encapsulates both the shared aspects
4586         of a Constructor and a Method.  
4587         (Method, Constructor): Factored pieces into MethodCore.
4588
4589         * driver.cs: Added --fatal which makes errors throw exceptions.
4590         Load System assembly as well as part of the standard library.
4591
4592         * report.cs: Allow throwing exceptions on errors for debugging.
4593
4594         * modifiers.cs: Do not use `parent', instead use the real type
4595         container to evaluate permission settings.
4596
4597         * class.cs: Put Ravi's patch back in.  He is right, and we will
4598         have to cope with the
4599
4600 2001-09-14  Ravi Pratap  <ravi@ximian.com>
4601
4602         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
4603         FamORAssem, not FamANDAssem.
4604         
4605 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
4606
4607         * driver.cs: Added --parse option that only parses its input files
4608         and terminates.
4609
4610         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
4611         incorrect.  IsTopLevel is not used to tell whether an object is
4612         root_types or not (that can be achieved by testing this ==
4613         root_types).  But to see if this is a top-level *class* (not
4614         necessarly our "toplevel" container). 
4615
4616 2001-09-14  Ravi Pratap  <ravi@ximian.com>
4617
4618         * enum.cs (Enum::Define): Modify to call the Lookup method on the
4619         parent instead of a direct call to GetType.
4620
4621 2001-09-14  Ravi Pratap  <ravi@ximian.com>
4622
4623         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
4624         Modifiers.TypeAttr. This should just be a call to that method.
4625
4626         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
4627         object so that we can determine if we are top-level or not.
4628
4629         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
4630         TypeContainer too.
4631
4632         * enum.cs (Enum::Define): Ditto.
4633
4634         * modifiers.cs (FieldAttr): Re-write.
4635
4636         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
4637         (TypeContainer::HaveStaticConstructor): New property to provide access
4638         to precisely that info.
4639
4640         * modifiers.cs (MethodAttr): Re-write.
4641         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
4642
4643         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
4644         of top-level types as claimed.
4645         
4646 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
4647
4648         * expression.cs (MemberLookup): Fruitless attempt to lookup
4649         constructors.  Maybe I need to emit default constructors?  That
4650         might be it (currently .NET emits this for me automatically).
4651         (Invocation::OverloadResolve): Cope with Arguments == null.
4652         (Invocation::EmitArguments): new function, shared by the new
4653         constructor and us.
4654         (Invocation::Emit): Handle static and instance methods.  Emit
4655         proper call instruction for virtual or non-virtual invocations.
4656         (New::Emit): Implement.
4657         (New::Resolve): Implement.
4658         (MemberAccess:Resolve): Implement.
4659         (MethodGroupExpr::InstanceExpression): used conforming to the spec
4660         to track instances.
4661         (FieldExpr::Resolve): Set type.
4662
4663         * support.cs: Handle empty arguments.
4664                 
4665         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
4666         SimpleLookup): Auxiliary routines to help parse a qualifier
4667         identifier.  
4668
4669         Update qualifier_identifier rule.
4670
4671         * codegen.cs: Removed debugging messages.
4672
4673         * class.cs: Make this a global thing, this acts just as a "key" to
4674         objects that we might have around.
4675
4676         (Populate): Only initialize method_builders_to_methods once.
4677
4678         * expression.cs (PropertyExpr): Initialize type from the
4679         PropertyType. 
4680
4681         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
4682         Resolve pattern.  Attempt to implicitly convert value to boolean.
4683         Emit code.
4684
4685         * expression.cs: Set the type for the int32/int32 argument case.
4686         (Binary::ResolveOperator): Set the return type to boolean for
4687         comparission operators
4688
4689         * typemanager.cs: Remove debugging print code.
4690
4691         (Invocation::Resolve): resolve type.
4692
4693         * class.cs: Allocate a MemberInfo of the correct size, as the code
4694         elsewhere depends on the test to reflect the correct contents.
4695
4696         (Method::) Keep track of parameters, due to System.Reflection holes
4697
4698         (TypeContainer::Populate): Keep track of MethodBuilders to Method
4699         mapping here.
4700
4701         (TypeContainer::FindMembers): Use ArrayList and then copy an array
4702         of the exact size and return that.
4703
4704         (Class::LookupMethodByBuilder): New function that maps
4705         MethodBuilders to its methods.  Required to locate the information
4706         on methods because System.Reflection bit us again.
4707
4708         * support.cs: New file, contains an interface ParameterData and
4709         two implementations: ReflectionParameters and InternalParameters
4710         used to access Parameter information.  We will need to grow this
4711         as required.
4712
4713         * expression.cs (Invocation::GetParameterData): implement a cache
4714         and a wrapper around the ParameterData creation for methods. 
4715         (Invocation::OverloadResolve): Use new code.
4716
4717 2001-09-13  Ravi Pratap  <ravi@ximian.com>
4718
4719         * class.cs (TypeContainer::EmitField): Remove and move into 
4720         (Field::Define): here and modify accordingly.
4721         (Field.FieldBuilder): New member.
4722         (TypeContainer::Populate): Update accordingly.
4723         (TypeContainer::FindMembers): Implement.
4724
4725 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
4726
4727         * statement.cs: (VariableInfo::VariableType): New field to be
4728         initialized with the full type once it is resolved. 
4729
4730 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
4731
4732         * parameter.cs (GetParameterInfo): Use a type cache to compute
4733         things only once, and to reuse this information
4734
4735         * expression.cs (LocalVariableReference::Emit): Implement.
4736         (OpcodeCast::Emit): fix.
4737
4738         (ParameterReference::Resolve): Implement.
4739         (ParameterReference::Emit): Implement.
4740
4741         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
4742         that are expressions need to stay as Expressions.
4743
4744         * typemanager.cs (CSharpName): Returns the C# name of a type if
4745         possible. 
4746
4747         * expression.cs (Expression::ConvertImplicit): New function that
4748         implements implicit type conversions.
4749
4750         (Expression::ImplicitReferenceConversion): Implements implicit
4751         reference conversions.
4752
4753         (EmptyCast): New type for transparent casts.
4754
4755         (OpcodeCast): New type for casts of types that are performed with
4756         a sequence of bytecodes.
4757         
4758         (BoxedCast): New type used for casting value types into reference
4759         types.  Emits a box opcode.
4760
4761         (Binary::DoNumericPromotions): Implements numeric promotions of
4762         and computation of the Binary::Type.
4763
4764         (Binary::EmitBranchable): Optimization.
4765
4766         (Binary::Emit): Implement code emission for expressions.
4767         
4768         * typemanager.cs (TypeManager): Added two new core types: sbyte
4769         and byte.
4770
4771 2001-09-12  Ravi Pratap  <ravi@ximian.com>
4772
4773         * class.cs (TypeContainer::FindMembers): Method which does exactly
4774         what Type.FindMembers does, only we don't have to use reflection. No
4775         implementation yet.
4776
4777         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
4778         typecontainer objects as we need to get at them.
4779         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
4780
4781         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
4782         typecontainer object.
4783
4784         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
4785         of just a Report object.
4786
4787 2001-09-11  Ravi Pratap  <ravi@ximian.com>
4788
4789         * class.cs (Event::Define): Go back to using the prefixes "add_" and
4790         "remove_"
4791         (TypeContainer::Populate): Now define the delegates of the type too.
4792         (TypeContainer.Delegates): Property to access the list of delegates defined
4793         in the type.
4794
4795         * delegates.cs (Delegate::Define): Implement partially.
4796
4797         * modifiers.cs (TypeAttr): Handle more flags.
4798
4799 2001-09-11  Ravi Pratap  <ravi@ximian.com>
4800
4801         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
4802         and not <=
4803         (Operator::Define): Re-write logic to get types by using the LookupType method
4804         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
4805         (Indexer::Define): Ditto.
4806         (Event::Define): Ditto.
4807         (Property::Define): Ditto.
4808         
4809 2001-09-10  Ravi Pratap  <ravi@ximian.com>
4810
4811         * class.cs (TypeContainer::Populate): Now define operators too. 
4812         (TypeContainer.Operators): New property to access the list of operators
4813         in a type.
4814         (Operator.OperatorMethodBuilder): New member to hold the method builder
4815         for the operator we are defining.
4816         (Operator::Define): Implement.
4817
4818 2001-09-10  Ravi Pratap  <ravi@ximian.com>
4819
4820         * class.cs (Event::Define): Make the prefixes of the accessor methods
4821         addOn_ and removeOn_ 
4822
4823         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
4824         of the location being passed in too. Ideally, this should go later since all
4825         error reporting should be done through the Report object.
4826
4827         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
4828         (Populate): Iterate thru the indexers we have and define them too.
4829         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
4830         for the get and set accessors.
4831         (Indexer::Define): Implement.
4832         
4833 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
4834
4835         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
4836         my previous implementation, did not work.
4837
4838         * typemanager.cs: Add a couple of missing types (the longs).
4839
4840         * literal.cs: Use TypeManager.bool_type instead of getting it.
4841
4842         * expression.cs (EventExpr): New kind of expressions.
4843         (Expressio::ExprClassFromMemberInfo): finish
4844
4845 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
4846
4847         * assign.cs: Emit stores to static fields differently.
4848
4849 2001-09-08  Ravi Pratap  <ravi@ximian.com>
4850
4851         * Merge in changes and adjust code to tackle conflicts. Backed out my
4852         code in Assign::Resolve ;-) 
4853
4854 2001-09-08  Ravi Pratap  <ravi@ximian.com>
4855
4856         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
4857         instead Report.Error and also pass in the location.
4858         (CSharpParser::Lexer): New readonly property to return the reference
4859         to the Tokenizer object.
4860         (declare_local_variables): Use Report.Error with location instead of plain 
4861         old error.
4862         (CheckDef): Ditto.
4863
4864         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
4865         (Operator.CheckBinaryOperator): Ditto.
4866
4867         * cs-parser.jay (operator_declarator): Update accordingly.
4868
4869         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
4870         (CheckBinaryOperator): Same here.
4871
4872         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
4873         on the name without any prefixes of namespace names etc. This is because we
4874         already might have something already fully qualified like 
4875         'System.Console.WriteLine'
4876
4877         * assign.cs (Resolve): Begin implementation. Stuck ;-)
4878
4879 2001-09-07  Ravi Pratap  <ravi@ximian.com>
4880
4881         * cs-tokenizer.cs (location): Return a string which also contains
4882         the file name.
4883
4884         * expression.cs (ElementAccess): New class for expressions of the
4885         type 'element access.'
4886         (BaseAccess): New class for expressions of the type 'base access.'
4887         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
4888         respectively.
4889         
4890         * cs-parser.jay (element_access): Implement action.
4891         (base_access): Implement actions.
4892         (checked_expression, unchecked_expression): Implement.
4893
4894         * cs-parser.jay (local_variable_type): Correct and implement.
4895         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
4896
4897         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
4898
4899         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
4900         name and the specifiers.
4901
4902         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
4903         
4904         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
4905         making them all public ;-)
4906
4907         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
4908         class anyways.
4909         
4910 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
4911
4912         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
4913         PropertyExprs.
4914         (FieldExpr, PropertyExprs): New resolved expressions.
4915         (SimpleName::MemberStaticCheck): Perform static checks for access
4916         to non-static fields on static methods. Maybe this should be
4917         generalized for MemberAccesses. 
4918         (SimpleName::ResolveSimpleName): More work on simple name
4919         resolution. 
4920
4921         * cs-parser.jay (primary_expression/qualified_identifier): track
4922         the parameter index.
4923
4924         * codegen.cs (CodeGen::Save): Catch save exception, report error.
4925         (EmitContext::EmitBoolExpression): Chain to expression generation
4926         instead of temporary hack.
4927         (::EmitStatementExpression): Put generic expression code generation.
4928
4929         * assign.cs (Assign::Emit): Implement variable assignments to
4930         local variables, parameters and fields.
4931
4932 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
4933
4934         * statement.cs (Block::GetVariableInfo): New method, returns the
4935         VariableInfo for a variable name in a block.
4936         (Block::GetVariableType): Implement in terms of GetVariableInfo
4937
4938         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
4939         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
4940
4941 2001-09-06  Ravi Pratap  <ravi@ximian.com>
4942
4943         * cs-parser.jay (operator_declaration): Continue on my quest : update
4944         to take attributes argument.
4945         (event_declaration): Ditto.
4946         (enum_declaration): Ditto.
4947         (indexer_declaration): Ditto.
4948         
4949         * class.cs (Operator::Operator): Update constructor accordingly.
4950         (Event::Event): Ditto.
4951
4952         * delegate.cs (Delegate::Delegate): Same here.
4953
4954         * enum.cs (Enum::Enum): Same here.
4955         
4956 2001-09-05  Ravi Pratap  <ravi@ximian.com>
4957
4958         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
4959
4960         * ../tests/cs0658.cs : New file to demonstrate error 0658.
4961
4962         * attribute.cs (Attributes): New class to encapsulate all attributes which were
4963         being passed around as an arraylist.
4964         (Attributes::AddAttribute): Method to add attribute sections.
4965
4966         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
4967         (struct_declaration): Update accordingly.
4968         (constant_declaration): Update.
4969         (field_declaration): Update.
4970         (method_header): Update.
4971         (fixed_parameter): Update.
4972         (parameter_array): Ditto.
4973         (property_declaration): Ditto.
4974         (destructor_declaration): Ditto.
4975         
4976         * class.cs (Struct::Struct): Update constructors accordingly.
4977         (Class::Class): Ditto.
4978         (Field::Field): Ditto.
4979         (Method::Method): Ditto.
4980         (Property::Property): Ditto.
4981         (TypeContainer::OptAttribute): update property's return type.
4982         
4983         * interface.cs (Interface.opt_attributes): New member.
4984         (Interface::Interface): Update to take the extra Attributes argument.
4985
4986         * parameter.cs (Parameter::Parameter): Ditto.
4987
4988         * constant.cs (Constant::Constant): Ditto.
4989
4990         * interface.cs (InterfaceMemberBase): New OptAttributes field.
4991         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
4992         the attributes as a parameter.
4993         (InterfaceProperty): Update constructor call.
4994         (InterfaceEvent): Ditto.
4995         (InterfaceMethod): Ditto.
4996         (InterfaceIndexer): Ditto.
4997
4998         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
4999         pass the attributes too.
5000         (interface_event_declaration): Ditto.
5001         (interface_property_declaration): Ditto.
5002         (interface_method_declaration): Ditto.
5003         (interface_declaration): Ditto.
5004
5005 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
5006
5007         * class.cs (Method::Define): Track the "static Main" definition to
5008         create an entry point. 
5009
5010         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
5011         EntryPoint if we find it. 
5012
5013         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
5014         (EmitContext::ig): Make this variable public.
5015
5016         * driver.cs: Make the default output file be the first file name
5017         with the .exe extension.  
5018
5019         Detect empty compilations
5020
5021         Handle various kinds of output targets.  Handle --target and
5022         rename -t to --dumper.
5023
5024         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
5025         methods inherited from Expression return now an Expression.  This
5026         will is used during the tree rewriting as we resolve them during
5027         semantic analysis.
5028
5029         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
5030         the spec.  Missing entirely is the information about
5031         accessability of elements of it.
5032
5033         (Expression::ExprClassFromMemberInfo): New constructor for
5034         Expressions that creates a fully initialized Expression based on
5035         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
5036         a Type.
5037
5038         (Invocation::Resolve): Begin implementing resolution of invocations.
5039         
5040         * literal.cs (StringLiteral):  Implement Emit.
5041
5042 2001-09-05  Ravi Pratap  <ravi@ximian.com>
5043
5044         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
5045         member.
5046         
5047 2001-09-04  Ravi Pratap  <ravi@ximian.com>
5048
5049         * cs-parser.jay (attribute_arguments): Implement actions.
5050         (attribute): Fix bug in production. Implement action.
5051         (attribute_list): Implement.
5052         (attribute_target): Implement.
5053         (attribute_target_specifier, opt_target_specifier): Implement
5054         (CheckAttributeTarget): New method to check if the attribute target
5055         is valid.
5056         (attribute_section): Implement.
5057         (opt_attributes): Implement.
5058
5059         * attribute.cs : New file to handle attributes.
5060         (Attribute): Class to hold attribute info.
5061
5062         * cs-parser.jay (opt_attribute_target_specifier): Remove production
5063         (attribute_section): Modify production to use 2 different rules to 
5064         achieve the same thing. 1 s/r conflict down !
5065         Clean out commented, useless, non-reducing dimension_separator rules.
5066         
5067         * class.cs (TypeContainer.attributes): New member to hold list
5068         of attributes for a type.
5069         (Struct::Struct): Modify to take one more argument, the attribute list.
5070         (Class::Class): Ditto.
5071         (Field::Field): Ditto.
5072         (Method::Method): Ditto.
5073         (Property::Property): Ditto.
5074         
5075         * cs-parser.jay (struct_declaration): Update constructor call to
5076         pass in the attributes too.
5077         (class_declaration): Ditto.
5078         (constant_declaration): Ditto.
5079         (field_declaration): Ditto.
5080         (method_header): Ditto.
5081         (fixed_parameter): Ditto.
5082         (parameter_array): Ditto.
5083         (property_declaration): Ditto.
5084
5085         * constant.cs (Constant::Constant): Update constructor similarly.
5086         Use System.Collections.
5087
5088         * parameter.cs (Parameter::Parameter): Update as above.
5089
5090 2001-09-02  Ravi Pratap  <ravi@ximian.com>
5091
5092         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
5093         (TypeContainer.delegates): New member to hold list of delegates.
5094
5095         * cs-parser.jay (delegate_declaration): Implement the action correctly 
5096         this time as I seem to be on crack ;-)
5097
5098 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
5099
5100         * rootcontext.cs (RootContext::IsNamespace): new function, used to
5101         tell whether an identifier represents a namespace.
5102
5103         * expression.cs (NamespaceExpr): A namespace expression, used only
5104         temporarly during expression resolution.
5105         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
5106         utility functions to resolve names on expressions.
5107
5108 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
5109
5110         * codegen.cs: Add hook for StatementExpressions. 
5111
5112         * class.cs: Fix inverted test for static flag in methods.
5113
5114 2001-09-02  Ravi Pratap  <ravi@ximian.com>
5115
5116         * class.cs (Operator::CheckUnaryOperator): Correct error number used
5117         to make it coincide with MS' number.
5118         (Operator::CheckBinaryOperator): Ditto.
5119
5120         * ../errors/errors.txt : Remove error numbers added earlier.
5121
5122         * ../errors/cs1019.cs : Test case for error # 1019
5123
5124         * ../errros/cs1020.cs : Test case for error # 1020
5125
5126         * cs-parser.jay : Clean out commented cruft.
5127         (dimension_separators, dimension_separator): Comment out. Ostensibly not
5128         used anywhere - non-reducing rule.
5129         (namespace_declarations): Non-reducing rule - comment out.
5130
5131         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
5132         with TypeContainer::AddEnum.
5133
5134         * delegate.cs : New file for delegate handling classes.
5135         (Delegate): Class for declaring delegates.
5136
5137         * makefile : Update.
5138
5139         * cs-parser.jay (delegate_declaration): Implement.
5140
5141 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
5142
5143         * class.cs (Event::Define): Implement.
5144         (Event.EventBuilder): New member.
5145
5146         * class.cs (TypeContainer::Populate): Update to define all enums and events
5147         we have.
5148         (Events): New property for the events arraylist we hold. Shouldn't we move to using
5149         readonly fields for all these cases ?
5150
5151 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
5152
5153         * class.cs (Property): Revamp to use the convention of making fields readonly.
5154         Accordingly modify code elsewhere.
5155
5156         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
5157         the Define method of the Property class.
5158
5159         * class.cs : Clean up applied patch and update references to variables etc. Fix 
5160         trivial bug.
5161         (TypeContainer::Populate): Update to define all the properties we have. Also
5162         define all enumerations.
5163
5164         * enum.cs (Define): Implement.
5165         
5166 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
5167
5168         * cs-parser.jay (overloadable_operator): The semantic value is an
5169         enum of the Operator class.
5170         (operator_declarator): Implement actions.
5171         (operator_declaration): Implement.
5172
5173         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
5174         validity of definitions.
5175         (Operator::CheckBinaryOperator): Static method to check for binary operators
5176         (TypeContainer::AddOperator): New method to add an operator to a type.
5177
5178         * cs-parser.jay (indexer_declaration): Added line to actually call the
5179         AddIndexer method so it gets added ;-)
5180
5181         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
5182         already taken care of by the MS compiler ?  
5183
5184 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
5185
5186         * class.cs (Operator): New class for operator declarations.
5187         (Operator::OpType): Enum for the various operators.
5188
5189 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
5190
5191         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
5192         ostensibly handle this in semantic analysis.
5193
5194         * cs-parser.jay (general_catch_clause): Comment out
5195         (specific_catch_clauses, specific_catch_clause): Ditto.
5196         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
5197         (catch_args, opt_catch_args): New productions.
5198         (catch_clause): Rewrite to use the new productions above
5199         (catch_clauses): Modify accordingly.
5200         (opt_catch_clauses): New production to use in try_statement
5201         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
5202         and re-write the code in the actions to extract the specific and
5203         general catch clauses by being a little smart ;-)
5204
5205         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
5206         Hooray, try and catch statements parse fine !
5207         
5208 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5209
5210         * statement.cs (Block::GetVariableType): Fix logic to extract the type
5211         string from the hashtable of variables.
5212
5213         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
5214         I end up making that mistake ;-)
5215         (catch_clauses): Fixed gross error which made Key and Value of the 
5216         DictionaryEntry the same : $1 !!
5217
5218 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5219
5220         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
5221
5222         * cs-parser.jay (event_declaration): Correct to remove the semicolon
5223         when the add and remove accessors are specified. 
5224
5225 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
5226
5227         * cs-parser.jay (IndexerDeclaration): New helper class to hold
5228         information about indexer_declarator.
5229         (indexer_declarator): Implement actions.
5230         (parsing_indexer): New local boolean used to keep track of whether
5231         we are parsing indexers or properties. This is necessary because 
5232         implicit_parameters come into picture even for the get accessor in the 
5233         case of an indexer.
5234         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
5235
5236         * class.cs (Indexer): New class for indexer declarations.
5237         (TypeContainer::AddIndexer): New method to add an indexer to a type.
5238         (TypeContainer::indexers): New member to hold list of indexers for the
5239         type.
5240
5241 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
5242
5243         * cs-parser.jay (add_accessor_declaration): Implement action.
5244         (remove_accessor_declaration): Implement action.
5245         (event_accessors_declaration): Implement
5246         (variable_declarators): swap statements for first rule - trivial.
5247
5248         * class.cs (Event): New class to hold information about event
5249         declarations.
5250         (TypeContainer::AddEvent): New method to add an event to a type
5251         (TypeContainer::events): New member to hold list of events.
5252
5253         * cs-parser.jay (event_declaration): Implement actions.
5254
5255 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
5256
5257         * cs-parser.jay (dim_separators): Implement. Make it a string
5258         concatenating all the commas together, just as they appear.
5259         (opt_dim_separators): Modify accordingly
5260         (rank_specifiers): Update accordingly. Basically do the same
5261         thing - instead, collect the brackets here.
5262         (opt_rank_sepcifiers): Modify accordingly.
5263         (array_type): Modify to actually return the complete type string
5264         instead of ignoring the rank_specifiers.
5265         (expression_list): Implement to collect the expressions
5266         (variable_initializer): Implement. We make it a list of expressions
5267         essentially so that we can handle the array_initializer case neatly too.
5268         (variable_initializer_list): Implement.
5269         (array_initializer): Make it a list of variable_initializers
5270         (opt_array_initializer): Modify accordingly.
5271
5272         * expression.cs (New::NType): Add enumeration to help us
5273         keep track of whether we have an object/delegate creation
5274         or an array creation.
5275         (New:NewType, New::Rank, New::Indices, New::Initializers): New
5276         members to hold data about array creation.
5277         (New:New): Modify to update NewType
5278         (New:New): New Overloaded contructor for the array creation
5279         case.
5280
5281         * cs-parser.jay (array_creation_expression): Implement to call
5282         the overloaded New constructor.
5283         
5284 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
5285
5286         * class.cs (TypeContainer::Constructors): Return member
5287         constructors instead of returning null.
5288
5289 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
5290
5291         * typemanager.cs (InitCoreTypes): Initialize the various core
5292         types after we have populated the type manager with the user
5293         defined types (this distinction will be important later while
5294         compiling corlib.dll)
5295
5296         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
5297         on Expression Classification.  Now all expressions have a method
5298         `Resolve' and a method `Emit'.
5299
5300         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
5301         generation from working.     Also add some temporary debugging
5302         code. 
5303         
5304 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
5305
5306         * codegen.cs: Lots of code generation pieces.  This is only the
5307         beginning, will continue tomorrow with more touches of polish.  We
5308         handle the fundamentals of if, while, do, for, return.  Others are
5309         trickier and I need to start working on invocations soon.
5310         
5311         * gen-treedump.cs: Bug fix, use s.Increment here instead of
5312         s.InitStatement. 
5313
5314         * codegen.cs (EmitContext): New struct, used during code
5315         emission to keep a context.   Most of the code generation will be
5316         here. 
5317
5318         * cs-parser.jay: Add embedded blocks to the list of statements of
5319         this block.  So code generation proceeds in a top down fashion.
5320
5321 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
5322
5323         * statement.cs: Add support for multiple child blocks.
5324
5325 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
5326
5327         * codegen.cs (EmitCode): New function, will emit the code for a
5328         Block of code given a TypeContainer and its ILGenerator. 
5329
5330         * statement.cs (Block): Standard public readonly optimization.
5331         (Block::Block constructors): Link children. 
5332         (Block::Child): Child Linker.
5333         (Block::EmitVariables): Emits IL variable declarations.
5334
5335         * class.cs: Drop support for MethodGroups here, delay until
5336         Semantic Analysis.
5337         (Method::): Applied the same simplification that I did before, and
5338         move from Properties to public readonly fields.
5339         (Method::ParameterTypes): Returns the parameter types for the
5340         function, and implements a cache that will be useful later when I
5341         do error checking and the semantic analysis on the methods is
5342         performed.
5343         (Constructor::GetCallingConvention): Renamed from CallingConvetion
5344         and made a method, optional argument tells whether this is a class
5345         or a structure to apply the `has-this' bit.
5346         (Method::GetCallingConvention): Implement, returns the calling
5347         convention. 
5348         (Method::Define): Defines the type, a second pass is performed
5349         later to populate the methods.
5350
5351         (Constructor::ParameterTypes): implement a cache similar to the
5352         one on Method::ParameterTypes, useful later when we do semantic
5353         analysis. 
5354
5355         (TypeContainer::EmitMethod):  New method.  Emits methods.
5356
5357         * expression.cs: Removed MethodGroup class from here.
5358         
5359         * parameter.cs (Parameters::GetCallingConvention): new method.
5360
5361 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
5362
5363         * class.cs (TypeContainer::Populate): Drop RootContext from the
5364         argument. 
5365
5366         (Constructor::CallingConvention): Returns the calling convention.
5367         (Constructor::ParameterTypes): Returns the constructor parameter
5368         types. 
5369         
5370         (TypeContainer::AddConstructor): Keep track of default constructor
5371         and the default static constructor.
5372
5373         (Constructor::) Another class that starts using `public readonly'
5374         instead of properties. 
5375
5376         (Constructor::IsDefault): Whether this is a default constructor. 
5377
5378         (Field::) use readonly public fields instead of properties also.
5379
5380         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
5381         track of static constructors;  If none is used, turn on
5382         BeforeFieldInit in the TypeAttributes. 
5383
5384         * cs-parser.jay (opt_argument_list): now the return can be null
5385         for the cases where there are no arguments. 
5386
5387         (constructor_declarator): If there is no implicit `base' or
5388         `this', then invoke the default parent constructor. 
5389         
5390         * modifiers.cs (MethodAttr): New static function maps a set of
5391         modifiers flags into a MethodAttributes enum
5392         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
5393         MethodAttr, TypeAttr to represent the various mappings where the
5394         modifiers are used.
5395         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
5396
5397 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
5398
5399         * parameter.cs (GetParameterInfo): Fix bug where there would be no
5400         method arguments.
5401
5402         * interface.cs (PopulateIndexer): Implemented the code generator
5403         for interface indexers.
5404
5405 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
5406
5407         * interface.cs (InterfaceMemberBase): Now we track the new status
5408         here.  
5409
5410         (PopulateProperty): Implement property population.  Woohoo!  Got
5411         Methods and Properties going today. 
5412
5413         Removed all the properties for interfaces, and replaced them with
5414         `public readonly' fields. 
5415
5416 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
5417
5418         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
5419         initialize their hashtables/arraylists only when they are needed
5420         instead of doing this always.
5421
5422         * parameter.cs: Handle refs and out parameters.
5423
5424         * cs-parser.jay: Use an ArrayList to construct the arguments
5425         instead of the ParameterCollection, and then cast that to a
5426         Parameter[] array.
5427
5428         * parameter.cs: Drop the use of ParameterCollection and use
5429         instead arrays of Parameters.
5430
5431         (GetParameterInfo): Use the Type, not the Name when resolving
5432         types. 
5433
5434 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
5435
5436         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
5437         and instead use public readonly fields.
5438
5439         * class.cs: Put back walking code for type containers.
5440
5441 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
5442
5443         * class.cs (MakeConstant): Code to define constants.
5444
5445         * rootcontext.cs (LookupType): New function.  Used to locate types 
5446
5447         
5448 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
5449
5450         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
5451         this System.Reflection code is.  Kudos to Microsoft
5452         
5453         * typemanager.cs: Implement a type cache and avoid loading all
5454         types at boot time.  Wrap in LookupType the internals.  This made
5455         the compiler so much faster.  Wow.  I rule!
5456         
5457         * driver.cs: Make sure we always load mscorlib first (for
5458         debugging purposes, nothing really important).
5459
5460         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
5461         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
5462
5463         * rootcontext.cs: Lookup types on their namespace;  Lookup types
5464         on namespaces that have been imported using the `using' keyword.
5465
5466         * class.cs (TypeContainer::TypeAttr): Virtualize.
5467         (Class::TypeAttr): Return attributes suitable for this bad boy.
5468         (Struct::TypeAttr): ditto.
5469         Handle nested classes.
5470         (TypeContainer::) Remove all the type visiting code, it is now
5471         replaced with the rootcontext.cs code
5472
5473         * rootcontext.cs (GetClassBases): Added support for structs. 
5474
5475 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
5476
5477         * interface.cs, statement.cs, class.cs, parameter.cs,
5478         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
5479         Drop use of TypeRefs, and use strings instead.
5480
5481 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
5482
5483         * rootcontext.cs: 
5484
5485         * class.cs (Struct::Struct): set the SEALED flags after
5486         checking the modifiers.
5487         (TypeContainer::TypeAttr): new property, returns the
5488         TypeAttributes for a class.  
5489
5490         * cs-parser.jay (type_list): Oops, list production was creating a
5491         new list of base types.
5492
5493         * rootcontext.cs (StdLib): New property.
5494         (GetInterfaceTypeByName): returns an interface by type name, and
5495         encapsulates error handling here.
5496         (GetInterfaces): simplified.
5497         (ResolveTree): Encapsulated all the tree resolution here.
5498         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
5499         types. 
5500         
5501         * driver.cs: Add support for --nostdlib, to avoid loading the
5502         default assemblies.
5503         (Main): Do not put tree resolution here. 
5504
5505         * rootcontext.cs: Beginning of the class resolution.
5506
5507 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
5508
5509         * rootcontext.cs: Provide better error reporting. 
5510
5511         * cs-parser.jay (interface_base): set our $$ to be interfaces.
5512
5513         * rootcontext.cs (CreateInterface): Handle the case where there
5514         are no parent interfaces.
5515         
5516         (CloseTypes): Routine to flush types at the end.
5517         (CreateInterface): Track types.
5518         (GetInterfaces): Returns an array of Types from the list of
5519         defined interfaces.
5520
5521         * typemanager.c (AddUserType): Mechanism to track user types (puts
5522         the type on the global type hash, and allows us to close it at the
5523         end). 
5524         
5525 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
5526
5527         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
5528         RecordInterface instead.
5529
5530         * cs-parser.jay: Updated to reflect changes above.
5531
5532         * decl.cs (Definition): Keep track of the TypeBuilder type that
5533         represents this type here.  Not sure we will use it in the long
5534         run, but wont hurt for now.
5535
5536         * driver.cs: Smaller changes to accomodate the new code.
5537
5538         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
5539         when done. 
5540
5541         * rootcontext.cs (CreateInterface):  New method, used to create
5542         the System.TypeBuilder type for interfaces.
5543         (ResolveInterfaces): new entry point to resolve the interface
5544         hierarchy. 
5545         (CodeGen): Property, used to keep track of the code generator.
5546
5547 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
5548
5549         * cs-parser.jay: Add a second production for delegate_declaration
5550         with `VOID'.
5551
5552         (enum_body): Put an opt_comma here instead of putting it on
5553         enum_body or enum_member_declarations so we can handle trailing
5554         commas on enumeration members.  Gets rid of a shift/reduce.
5555         
5556         (type_list): Need a COMMA in the middle.
5557
5558         (indexer_declaration): Tell tokenizer to recognize get/set
5559
5560         * Remove old targets.
5561
5562         * Re-add the parser target.
5563
5564 2001-07-13  Simon Cozens <simon@simon-cozens.org>
5565
5566         * cs-parser.jay: Add precendence rules for a number of operators
5567         ot reduce the number of shift/reduce conflicts in the grammar.
5568         
5569 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
5570
5571         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
5572         and put it here.
5573
5574         Get rid of old crufty code.
5575
5576         * rootcontext.cs: Use this to keep track of the parsed
5577         representation and the defined types available to the program. 
5578
5579         * gen-treedump.cs: adjust for new convention.
5580
5581         * type.cs: Split out the type manager, and the assembly builder
5582         from here. 
5583
5584         * typemanager.cs: the type manager will live here now.
5585
5586         * cil-codegen.cs: And the code generator here. 
5587
5588 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
5589
5590         * makefile: Fixed up for easy making.
5591
5592 2001-07-13  Simon Cozens <simon@simon-cozens.org>
5593
5594         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
5595         the 
5596
5597         (unary_expression): Expand pre_increment_expression and
5598         post_decrement_expression to reduce a shift/reduce.
5599
5600 2001-07-11  Simon Cozens
5601
5602         * cs-tokenizer.cs: Hex numbers should begin with a 0.
5603
5604         Improve allow_keyword_as_indent name.
5605
5606 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
5607
5608         * Adjustments for Beta2. 
5609
5610 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
5611
5612         * decl.cs: Added `Define' abstract method.
5613         (InTransit): new property, used to catch recursive definitions. 
5614
5615         * interface.cs: Implement `Define'. 
5616
5617         * modifiers.cs: Map Modifiers.constants to
5618         System.Reflection.TypeAttribute flags.
5619
5620         * class.cs: Keep track of types and user-defined types.
5621         (BuilderInit): New method for creating an assembly
5622         (ResolveType): New function to launch the resolution process, only
5623         used by interfaces for now.
5624
5625         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
5626         that are inserted into the name space. 
5627
5628 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
5629
5630         * ARGH.  I have screwed up my tree so many times due to the use of
5631         rsync rather than using CVS.  Going to fix this at once. 
5632
5633         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
5634         load types.
5635
5636 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
5637
5638         * Experiment successful: Use System.Type rather that our own
5639         version of Type.  
5640
5641 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
5642
5643         * cs-parser.jay: Removed nsAliases from here.
5644
5645         Use new namespaces, handle `using XXX;' 
5646
5647         * namespace.cs: Reimplemented namespace handling, use a recursive
5648         definition of the class.  Now we can keep track of using clauses
5649         and catch invalid using clauses.
5650
5651 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
5652
5653         * gen-treedump.cs: Adapted for all the renaming.
5654
5655         * expression.cs (Expression): this class now has a Type property
5656         which returns an expression Type.
5657
5658         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
5659         `Type', as this has a different meaning now in the base
5660
5661 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
5662
5663         * interface.cs, class.cs: Removed from all the sources the
5664         references to signature computation, as we can not do method
5665         signature computation during the parsing time, as we are not
5666         trying to solve at that point distinguishing:
5667
5668         class X {
5669                 void a (Blah x) {}
5670                 void a (NS.Blah x) {}
5671         }
5672
5673         Which depending on the context might be valid or not, as we do not
5674         know if Blah is the same thing as NS.Blah at that point.
5675
5676         * Redid everything so the code uses TypeRefs now instead of
5677         Types.  TypeRefs are just temporary type placeholders, that need
5678         to be resolved.  They initially have a pointer to a string and the
5679         current scope in which they are used.  This is used later by the
5680         compiler to resolve the reference to an actual Type. 
5681
5682         * DeclSpace is no longer a CIR.Type, and neither are
5683         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
5684         are all DeclSpaces, but no Types. 
5685
5686         * type.cs (TypeRefManager): This implements the TypeRef manager,
5687         which keeps track of all the types that need to be resolved after
5688         the parsing has finished. 
5689
5690 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
5691
5692         * ARGH.  We are going to have to store `foreach' as a class rather
5693         than resolving it, as we need to verify error 1579 after name
5694         resolution.   *OR* we could keep a flag that says `This request to
5695         IEnumerator comes from a foreach statement' which we can then use
5696         to generate the error.
5697
5698 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
5699
5700         * class.cs (TypeContainer.AddMethod): we now add methods to the
5701         MethodGroup instead of the method hashtable.  
5702
5703         * expression.cs: Add MethodGroup abstraction, which gets us one
5704         step closer to the specification in the way we handle method
5705         declarations.  
5706
5707         * cs-parser.jay (primary_expression): qualified_identifier now
5708         tried to match up an identifier to a local variable reference or
5709         to a parameter reference.
5710
5711         current_local_parameters is now a parser global variable that
5712         points to the current parameters for the block, used during name
5713         lookup.
5714
5715         (property_declaration): Now creates an implicit `value' argument to
5716         the set accessor.
5717
5718 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
5719
5720         * parameter.cs: Do not use `param' arguments as part of the
5721         signature, per the spec.
5722
5723 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * decl.cs: Base class for classes, structs and interfaces.  This
5726         is the "Declaration Space" 
5727
5728         * cs-parser.jay: Use CheckDef for checking declaration errors
5729         instead of having one on each function.
5730
5731         * class.cs: Factor out some code for handling error handling in
5732         accordance to the "Declarations" section in the "Basic Concepts"
5733         chapter in the ECMA C# spec.
5734
5735         * interface.cs: Make all interface member classes derive from
5736         InterfaceMemberBase.
5737
5738 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
5739
5740         * Many things: all interfaces are parsed and generated in
5741         gen-treedump.  Support for member variables, constructors,
5742         destructors, properties, constants is there.
5743
5744         Beginning of the IL backend, but very little done, just there for
5745         testing purposes. 
5746
5747 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
5748
5749         * cs-parser.jay: Fix labeled statement.
5750
5751         * cs-tokenizer.cs (escape): Escape " and ' always.
5752         ref_line, ref_name: keep track of the line/filename as instructed
5753         by #line by the compiler.
5754         Parse #line.
5755
5756 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
5757
5758         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
5759         to match the values in System.CodeDOM.
5760
5761         Divid renamed to Divide.
5762
5763         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
5764         statements. 
5765         (Statements.set): remove.
5766
5767         * System.CodeDOM/CodeCatchClause.cs: always have a valid
5768         statements. 
5769
5770         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
5771         falseStatements always have valid values. 
5772
5773         * cs-parser.jay: Use System.CodeDOM now.
5774