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