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