2001-09-25 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2001-09-25  Ravi Pratap  <ravi@ximian.com>
2
3         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
4         the type of the expression to the return type of the method if
5         we have an overloaded operator match ! The regression tests pass again !
6         (Unary::ResolveOperator): Ditto.
7
8         * expression.cs (Invocation::ConversionExists): Correct the member lookup
9         to find "op_Implicit", not "implicit" ;-)
10         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11         (ConvertImplicit, ForceConversion): Take TypeContainer argument
12
13         * everywhere : Correct calls to the above accordingly.
14
15         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
16         (ConvertImplicit): Do user-defined conversion if it exists.
17
18 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19
20         * assign.cs: track location.
21         (Resolve): Use implicit conversions on assignment.
22
23         * literal.cs: Oops.  Not good, Emit of short access values should
24         pass (Bytes) or the wrong argument will be selected.
25
26         * expression.cs (Unary::Emit): Emit code for -expr.
27         
28         (Unary::ResolveOperator): Handle `Substract' for non-constants
29         (substract from zero from the non-constants).
30         Deal with Doubles as well. 
31         
32         (Expression::ConvertImplicitRequired): New routine that reports an
33         error if no implicit conversion exists. 
34
35         (Invocation::OverloadResolve): Store the converted implicit
36         expressions if we make them
37         
38 2001-09-24  Ravi Pratap  <ravi@ximian.com>
39
40         * class.cs (ConstructorInitializer): Take a Location argument.
41         (ConstructorBaseInitializer): Same here.
42         (ConstructorThisInitializer): Same here.
43
44         * cs-parser.jay : Update all calls accordingly.
45
46         * expression.cs (Unary, Binary, New): Take location argument.
47         Update accordingly everywhere.
48
49         * cs-parser.jay : Update all calls to the above to take a location
50         argument.
51
52         * class.cs : Ditto.
53
54 2001-09-24  Ravi Pratap  <ravi@ximian.com>
55
56         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
57         (Invocation::BetterConversion): Same here
58         (Invocation::ConversionExists): Ditto.
59
60         (Invocation::ConversionExists): Implement.
61
62 2001-09-22  Ravi Pratap  <ravi@ximian.com>
63
64         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
65         Also take an additional TypeContainer argument.
66
67         * All over : Pass in TypeContainer as argument to OverloadResolve.
68
69         * typemanager.cs (CSharpName): Update to check for the string type and return
70         that too.
71
72         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
73         a given method.
74         
75 2001-09-21  Ravi Pratap  <ravi@ximian.com>
76
77         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
78         (Invocation::BetterFunction): Implement.
79         (Invocation::BetterConversion): Implement.
80         (Invocation::ConversionExists): Skeleton, no implementation yet.
81
82         Okay, things work fine !
83
84 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
85
86         * typemanager.cs: declare and load enum_type, delegate_type and
87         void_type. 
88
89         * expression.cs (Expression::Emit): Now emit returns a value that
90         tells whether a value is left on the stack or not.  This strategy
91         might be reveted tomorrow with a mechanism that would address
92         multiple assignments.
93         (Expression::report118): Utility routine to report mismatches on
94         the ExprClass.
95
96         (Unary::Report23): Report impossible type/operator combination
97         utility function.
98
99         (Unary::IsIncrementableNumber): Whether the type can be
100         incremented or decremented with add.
101         (Unary::ResolveOperator): Also allow enumerations to be bitwise
102         complemented. 
103         (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
104
105         (Invocation::Emit): Deal with new Emit convetion.
106         
107         * All Expression derivatives: Updated their Emit method to return
108         whether they leave values on the stack or not.
109         
110         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
111         stack for expressions that are statements. 
112
113 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
114
115         * expression.cs (LValue): New interface.  Must be implemented by
116         LValue objects.
117         (LocalVariableReference, ParameterReference, FieldExpr): Implement
118         LValue interface.
119         
120         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
121         interface for generating code, simplifies the code.
122
123 2001-09-20  Ravi Pratap  <ravi@ximian.com>
124
125         * expression.cs (everywhere): Comment out return statements in ::Resolve
126         methods to avoid the warnings.
127
128 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
129
130         * driver.cs (parse): Report error 2001 if we can not open the
131         source file.
132
133         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
134         not resolve it.
135
136         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
137         object. 
138
139         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
140         otherwise nested blocks end up with the same index.
141
142         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
143
144         * expression.cs:  Instead of having FIXMEs in the Resolve
145         functions, throw exceptions so it is obvious that we are facing a
146         bug. 
147
148         * cs-parser.jay (invocation_expression): Pass Location information.
149
150         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
151         Use a basename for those routines because .NET does not like paths
152         on them. 
153
154         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
155         already defined.
156
157 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
158
159         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
160         are loading the correct data types (throws an exception if not).
161         (TypeManager::InitCoreTypes): Use CoreLookupType
162
163         * expression.cs (Unary::ResolveOperator): return the child
164         expression for expressions which are just +expr.
165         (Unary::ResolveOperator): Return negative literals for -LITERAL
166         expressions (otherwise they are Unary {Literal}).
167         (Invocation::Badness): Take into account `Implicit constant
168         expression conversions'.
169
170         * literal.cs (LongLiteral): Implement long literal class.
171         (IntLiteral): export the `Value' of the intliteral. 
172
173 2001-09-19  Ravi Pratap  <ravi@ximian.com>
174
175         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
176
177         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
178         instead of 'Operator'
179
180         * expression.cs (Binary::ResolveOperator): Update accordingly.
181         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
182         and 'Minus'
183
184         * cs-parser.jay (unary_expression): Update to use the new names.
185
186         * gen-treedump.cs (GetUnary): Same here.
187
188         * expression.cs (Unary::Resolve): Implement.
189         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
190         operators are found instead of making noise ;-)
191         (Unary::ResolveOperator): New method to do precisely the same thing which
192         Binary::ResolveOperator does for Binary expressions.
193         (Unary.method, .Arguments): Add.
194         (Unary::OperName): Implement.   
195         (Unary::ForceConversion): Copy and Paste !
196
197         * class.cs (Operator::Define): Fix a small bug for the case when we have 
198         a unary operator.
199
200         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
201         for the inbuilt operators. Only overloading works for now ;-)
202
203 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
204
205         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
206         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
207
208         * expression.cs (This::Emit): Implement. 
209         (This::Resolve): Implement.
210         (TypeOf:Resolve): Implement.
211         (Expression::ResolveSimpleName): Add an implicit this to instance
212         field references. 
213         (MemberAccess::Resolve): Deal with Parameters and Fields. 
214         Bind instance variable to Field expressions.
215         (FieldExpr::Instance): New field used to track the expression that
216         represents the object instance.
217         (FieldExpr::Resolve): Track potential errors from MemberLookup not
218         binding 
219         (FieldExpr::Emit): Implement.
220
221         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
222         the last instruction contains a return opcode to avoid generating
223         the last `ret' instruction (this generates correct code, and it is
224         nice to pass the peverify output).
225
226         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
227         initializer for static and instance variables.
228         (Constructor::Emit): Allow initializer to be null in the case of
229         static constructors.  Only emit initializer for instance
230         constructors. 
231
232         (TypeContainer::FindMembers): Return a null array if there are no
233         matches.
234
235         Also fix the code for the MemberTypes.Method branch, as it was not
236         scanning that for operators (or tried to access null variables before).
237
238         * assign.cs (Assign::Emit): Handle instance and static fields. 
239
240         * TODO: Updated.
241
242         * driver.cs: Stop compilation if there are parse errors.
243
244         * cs-parser.jay (constructor_declaration): Provide default base
245         initializer for non-static constructors.
246         (constructor_declarator): Do not provide a default base
247         initializers if none was specified.
248         Catch the fact that constructors should not have parameters.
249
250         * class.cs: Do not emit parent class initializers for static
251         constructors, that should be flagged as an error.
252
253 2001-09-18  Ravi Pratap  <ravi@ximian.com>
254
255         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
256         Move back code into TypeContainer::Populate.
257
258 2001-09-18  Ravi Pratap  <ravi@ximian.com>
259
260         * class.cs (TypeContainer::AddConstructor): Fix the check to
261         compare against Name, not Basename. 
262         (Operator::OpType): Change Plus and Minus to Add and Subtract.
263
264         * cs-parser.jay : Update accordingly.
265
266         * class.cs (TypeContainer::FindMembers): For the case where we are searching
267         for methods, don't forget to look into the operators too.
268         (RegisterMethodBuilder): Helper method to take care of this for
269         methods, constructors and operators.
270         (Operator::Define): Completely revamp.
271         (Operator.OperatorMethod, MethodName): New fields.
272         (TypeContainer::Populate): Move the registering of builders into
273         RegisterMethodBuilder.
274         (Operator::Emit): Re-write.
275
276         * expression.cs (Binary::Emit): Comment out code path to emit method
277         invocation stuff for the case when we have a user defined operator. I am
278         just not able to get it right !
279         
280 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
281
282         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
283         argument. 
284
285         (Expression::MemberLookup): Provide a version that allows to
286         specify the MemberTypes and BindingFlags. 
287
288         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
289         so it was not fetching variable information from outer blocks.
290
291         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
292         Beforefieldinit as it was buggy.
293
294         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
295         that Ravi put here.  
296
297         * class.cs (Constructor::Emit): Only emit if block is not null.
298         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
299         deal with this by semantically definining it as if the user had
300         done it.
301
302         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
303         constructors as we now "emit" them at a higher level.
304
305         (TypeContainer::DefineDefaultConstructor): Used to define the
306         default constructors if none was provided.
307
308         (ConstructorInitializer): Add methods Resolve and Emit. 
309         
310         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
311
312 2001-09-17  Ravi Pratap  <ravi@ximian.com>
313
314         * class.cs (TypeContainer::EmitDefaultConstructor): Register
315         the default constructor builder with our hashtable for methodbuilders
316         to methodcores.
317
318         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
319         and argument_count is 0 in which case we have a match.
320         (Binary::ResolveOperator): More null checking and miscellaneous coding
321         style cleanup.
322
323 2001-09-17  Ravi Pratap  <ravi@ximian.com>
324
325         * rootcontext.cs (IsNameSpace): Compare against null.
326
327         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
328
329         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
330         and Unary::Operator.
331
332         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
333         accordingly.
334
335         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
336         we have overloaded operators.
337         (Binary::ResolveOperator): Implement the part which does the operator overload
338         resolution.
339
340         * class.cs (Operator::Emit): Implement.
341         (TypeContainer::Emit): Emit the operators we have too.
342
343         * expression.cs (Binary::Emit): Update to emit the appropriate code for
344         the case when we have a user-defined operator.
345         
346 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
347
348         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
349
350 2001-09-16  Ravi Pratap  <ravi@ximian.com>
351
352         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
353         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
354         (Constructor::Emit): Implement.
355         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
356         if we have no work to do. 
357         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
358         Emit method.
359
360         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
361         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
362
363         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
364         of parent.parent.
365
366 2001-09-15  Ravi Pratap  <ravi@ximian.com>
367
368         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
369         in the source.
370         (Tree::RecordNamespace): Method to do what the name says ;-)
371         (Tree::Namespaces): Property to get at the namespaces hashtable.
372
373         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
374         keep track.
375
376         * rootcontext.cs (IsNamespace): Fixed it :-)
377
378 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
379
380         * class.cs (TypeContainer::FindMembers): Add support for
381         constructors. 
382         (MethodCore): New class that encapsulates both the shared aspects
383         of a Constructor and a Method.  
384         (Method, Constructor): Factored pieces into MethodCore.
385
386         * driver.cs: Added --fatal which makes errors throw exceptions.
387         Load System assembly as well as part of the standard library.
388
389         * report.cs: Allow throwing exceptions on errors for debugging.
390
391         * modifiers.cs: Do not use `parent', instead use the real type
392         container to evaluate permission settings.
393
394         * class.cs: Put Ravi's patch back in.  He is right, and we will
395         have to cope with the
396
397 2001-09-14  Ravi Pratap  <ravi@ximian.com>
398
399         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
400         FamORAssem, not FamANDAssem.
401         
402 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
403
404         * driver.cs: Added --parse option that only parses its input files
405         and terminates.
406
407         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
408         incorrect.  IsTopLevel is not used to tell whether an object is
409         root_types or not (that can be achieved by testing this ==
410         root_types).  But to see if this is a top-level *class* (not
411         necessarly our "toplevel" container). 
412
413 2001-09-14  Ravi Pratap  <ravi@ximian.com>
414
415         * enum.cs (Enum::Define): Modify to call the Lookup method on the
416         parent instead of a direct call to GetType.
417
418 2001-09-14  Ravi Pratap  <ravi@ximian.com>
419
420         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
421         Modifiers.TypeAttr. This should just be a call to that method.
422
423         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
424         object so that we can determine if we are top-level or not.
425
426         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
427         TypeContainer too.
428
429         * enum.cs (Enum::Define): Ditto.
430
431         * modifiers.cs (FieldAttr): Re-write.
432
433         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
434         (TypeContainer::HaveStaticConstructor): New property to provide access
435         to precisely that info.
436
437         * modifiers.cs (MethodAttr): Re-write.
438         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
439
440         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
441         of top-level types as claimed.
442         
443 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
444
445         * expression.cs (MemberLookup): Fruitless attempt to lookup
446         constructors.  Maybe I need to emit default constructors?  That
447         might be it (currently .NET emits this for me automatically).
448         (Invocation::OverloadResolve): Cope with Arguments == null.
449         (Invocation::EmitArguments): new function, shared by the new
450         constructor and us.
451         (Invocation::Emit): Handle static and instance methods.  Emit
452         proper call instruction for virtual or non-virtual invocations.
453         (New::Emit): Implement.
454         (New::Resolve): Implement.
455         (MemberAccess:Resolve): Implement.
456         (MethodGroupExpr::InstanceExpression): used conforming to the spec
457         to track instances.
458         (FieldExpr::Resolve): Set type.
459
460         * support.cs: Handle empty arguments.
461                 
462         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
463         SimpleLookup): Auxiliary routines to help parse a qualifier
464         identifier.  
465
466         Update qualifier_identifier rule.
467
468         * codegen.cs: Removed debugging messages.
469
470         * class.cs: Make this a global thing, this acts just as a "key" to
471         objects that we might have around.
472
473         (Populate): Only initialize method_builders_to_methods once.
474
475         * expression.cs (PropertyExpr): Initialize type from the
476         PropertyType. 
477
478         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
479         Resolve pattern.  Attempt to implicitly convert value to boolean.
480         Emit code.
481
482         * expression.cs: Set the type for the int32/int32 argument case.
483         (Binary::ResolveOperator): Set the return type to boolean for
484         comparission operators
485
486         * typemanager.cs: Remove debugging print code.
487
488         (Invocation::Resolve): resolve type.
489
490         * class.cs: Allocate a MemberInfo of the correct size, as the code
491         elsewhere depends on the test to reflect the correct contents.
492
493         (Method::) Keep track of parameters, due to System.Reflection holes
494
495         (TypeContainer::Populate): Keep track of MethodBuilders to Method
496         mapping here.
497
498         (TypeContainer::FindMembers): Use ArrayList and then copy an array
499         of the exact size and return that.
500
501         (Class::LookupMethodByBuilder): New function that maps
502         MethodBuilders to its methods.  Required to locate the information
503         on methods because System.Reflection bit us again.
504
505         * support.cs: New file, contains an interface ParameterData and
506         two implementations: ReflectionParameters and InternalParameters
507         used to access Parameter information.  We will need to grow this
508         as required.
509
510         * expression.cs (Invocation::GetParameterData): implement a cache
511         and a wrapper around the ParameterData creation for methods. 
512         (Invocation::OverloadResolve): Use new code.
513
514 2001-09-13  Ravi Pratap  <ravi@ximian.com>
515
516         * class.cs (TypeContainer::EmitField): Remove and move into 
517         (Field::Define): here and modify accordingly.
518         (Field.FieldBuilder): New member.
519         (TypeContainer::Populate): Update accordingly.
520         (TypeContainer::FindMembers): Implement.
521
522 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
523
524         * statement.cs: (VariableInfo::VariableType): New field to be
525         initialized with the full type once it is resolved. 
526
527 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
528
529         * parameter.cs (GetParameterInfo): Use a type cache to compute
530         things only once, and to reuse this information
531
532         * expression.cs (LocalVariableReference::Emit): Implement.
533         (OpcodeCast::Emit): fix.
534
535         (ParameterReference::Resolve): Implement.
536         (ParameterReference::Emit): Implement.
537
538         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
539         that are expressions need to stay as Expressions.
540
541         * typemanager.cs (CSharpName): Returns the C# name of a type if
542         possible. 
543
544         * expression.cs (Expression::ConvertImplicit): New function that
545         implements implicit type conversions.
546
547         (Expression::ImplicitReferenceConversion): Implements implicit
548         reference conversions.
549
550         (EmptyCast): New type for transparent casts.
551
552         (OpcodeCast): New type for casts of types that are performed with
553         a sequence of bytecodes.
554         
555         (BoxedCast): New type used for casting value types into reference
556         types.  Emits a box opcode.
557
558         (Binary::DoNumericPromotions): Implements numeric promotions of
559         and computation of the Binary::Type.
560
561         (Binary::EmitBranchable): Optimization.
562
563         (Binary::Emit): Implement code emission for expressions.
564         
565         * typemanager.cs (TypeManager): Added two new core types: sbyte
566         and byte.
567
568 2001-09-12  Ravi Pratap  <ravi@ximian.com>
569
570         * class.cs (TypeContainer::FindMembers): Method which does exactly
571         what Type.FindMembers does, only we don't have to use reflection. No
572         implementation yet.
573
574         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
575         typecontainer objects as we need to get at them.
576         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
577
578         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
579         typecontainer object.
580
581         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
582         of just a Report object.
583
584 2001-09-11  Ravi Pratap  <ravi@ximian.com>
585
586         * class.cs (Event::Define): Go back to using the prefixes "add_" and
587         "remove_"
588         (TypeContainer::Populate): Now define the delegates of the type too.
589         (TypeContainer.Delegates): Property to access the list of delegates defined
590         in the type.
591
592         * delegates.cs (Delegate::Define): Implement partially.
593
594         * modifiers.cs (TypeAttr): Handle more flags.
595
596 2001-09-11  Ravi Pratap  <ravi@ximian.com>
597
598         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
599         and not <=
600         (Operator::Define): Re-write logic to get types by using the LookupType method
601         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
602         (Indexer::Define): Ditto.
603         (Event::Define): Ditto.
604         (Property::Define): Ditto.
605         
606 2001-09-10  Ravi Pratap  <ravi@ximian.com>
607
608         * class.cs (TypeContainer::Populate): Now define operators too. 
609         (TypeContainer.Operators): New property to access the list of operators
610         in a type.
611         (Operator.OperatorMethodBuilder): New member to hold the method builder
612         for the operator we are defining.
613         (Operator::Define): Implement.
614
615 2001-09-10  Ravi Pratap  <ravi@ximian.com>
616
617         * class.cs (Event::Define): Make the prefixes of the accessor methods
618         addOn_ and removeOn_ 
619
620         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
621         of the location being passed in too. Ideally, this should go later since all
622         error reporting should be done through the Report object.
623
624         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
625         (Populate): Iterate thru the indexers we have and define them too.
626         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
627         for the get and set accessors.
628         (Indexer::Define): Implement.
629         
630 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
631
632         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
633         my previous implementation, did not work.
634
635         * typemanager.cs: Add a couple of missing types (the longs).
636
637         * literal.cs: Use TypeManager.bool_type instead of getting it.
638
639         * expression.cs (EventExpr): New kind of expressions.
640         (Expressio::ExprClassFromMemberInfo): finish
641
642 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
643
644         * assign.cs: Emit stores to static fields differently.
645
646 2001-09-08  Ravi Pratap  <ravi@ximian.com>
647
648         * Merge in changes and adjust code to tackle conflicts. Backed out my
649         code in Assign::Resolve ;-) 
650
651 2001-09-08  Ravi Pratap  <ravi@ximian.com>
652
653         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
654         instead Report.Error and also pass in the location.
655         (CSharpParser::Lexer): New readonly property to return the reference
656         to the Tokenizer object.
657         (declare_local_variables): Use Report.Error with location instead of plain 
658         old error.
659         (CheckDef): Ditto.
660
661         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
662         (Operator.CheckBinaryOperator): Ditto.
663
664         * cs-parser.jay (operator_declarator): Update accordingly.
665
666         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
667         (CheckBinaryOperator): Same here.
668
669         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
670         on the name without any prefixes of namespace names etc. This is because we
671         already might have something already fully qualified like 
672         'System.Console.WriteLine'
673
674         * assign.cs (Resolve): Begin implementation. Stuck ;-)
675
676 2001-09-07  Ravi Pratap  <ravi@ximian.com>
677
678         * cs-tokenizer.cs (location): Return a string which also contains
679         the file name.
680
681         * expression.cs (ElementAccess): New class for expressions of the
682         type 'element access.'
683         (BaseAccess): New class for expressions of the type 'base access.'
684         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
685         respectively.
686         
687         * cs-parser.jay (element_access): Implement action.
688         (base_access): Implement actions.
689         (checked_expression, unchecked_expression): Implement.
690
691         * cs-parser.jay (local_variable_type): Correct and implement.
692         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
693
694         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
695
696         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
697         name and the specifiers.
698
699         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
700         
701         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
702         making them all public ;-)
703
704         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
705         class anyways.
706         
707 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
708
709         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
710         PropertyExprs.
711         (FieldExpr, PropertyExprs): New resolved expressions.
712         (SimpleName::MemberStaticCheck): Perform static checks for access
713         to non-static fields on static methods. Maybe this should be
714         generalized for MemberAccesses. 
715         (SimpleName::ResolveSimpleName): More work on simple name
716         resolution. 
717
718         * cs-parser.jay (primary_expression/qualified_identifier): track
719         the parameter index.
720
721         * codegen.cs (CodeGen::Save): Catch save exception, report error.
722         (EmitContext::EmitBoolExpression): Chain to expression generation
723         instead of temporary hack.
724         (::EmitStatementExpression): Put generic expression code generation.
725
726         * assign.cs (Assign::Emit): Implement variable assignments to
727         local variables, parameters and fields.
728
729 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
730
731         * statement.cs (Block::GetVariableInfo): New method, returns the
732         VariableInfo for a variable name in a block.
733         (Block::GetVariableType): Implement in terms of GetVariableInfo
734
735         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
736         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
737
738 2001-09-06  Ravi Pratap  <ravi@ximian.com>
739
740         * cs-parser.jay (operator_declaration): Continue on my quest : update
741         to take attributes argument.
742         (event_declaration): Ditto.
743         (enum_declaration): Ditto.
744         (indexer_declaration): Ditto.
745         
746         * class.cs (Operator::Operator): Update constructor accordingly.
747         (Event::Event): Ditto.
748
749         * delegate.cs (Delegate::Delegate): Same here.
750
751         * enum.cs (Enum::Enum): Same here.
752         
753 2001-09-05  Ravi Pratap  <ravi@ximian.com>
754
755         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
756
757         * ../tests/cs0658.cs : New file to demonstrate error 0658.
758
759         * attribute.cs (Attributes): New class to encapsulate all attributes which were
760         being passed around as an arraylist.
761         (Attributes::AddAttribute): Method to add attribute sections.
762
763         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
764         (struct_declaration): Update accordingly.
765         (constant_declaration): Update.
766         (field_declaration): Update.
767         (method_header): Update.
768         (fixed_parameter): Update.
769         (parameter_array): Ditto.
770         (property_declaration): Ditto.
771         (destructor_declaration): Ditto.
772         
773         * class.cs (Struct::Struct): Update constructors accordingly.
774         (Class::Class): Ditto.
775         (Field::Field): Ditto.
776         (Method::Method): Ditto.
777         (Property::Property): Ditto.
778         (TypeContainer::OptAttribute): update property's return type.
779         
780         * interface.cs (Interface.opt_attributes): New member.
781         (Interface::Interface): Update to take the extra Attributes argument.
782
783         * parameter.cs (Parameter::Parameter): Ditto.
784
785         * constant.cs (Constant::Constant): Ditto.
786
787         * interface.cs (InterfaceMemberBase): New OptAttributes field.
788         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
789         the attributes as a parameter.
790         (InterfaceProperty): Update constructor call.
791         (InterfaceEvent): Ditto.
792         (InterfaceMethod): Ditto.
793         (InterfaceIndexer): Ditto.
794
795         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
796         pass the attributes too.
797         (interface_event_declaration): Ditto.
798         (interface_property_declaration): Ditto.
799         (interface_method_declaration): Ditto.
800         (interface_declaration): Ditto.
801
802 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
803
804         * class.cs (Method::Define): Track the "static Main" definition to
805         create an entry point. 
806
807         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
808         EntryPoint if we find it. 
809
810         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
811         (EmitContext::ig): Make this variable public.
812
813         * driver.cs: Make the default output file be the first file name
814         with the .exe extension.  
815
816         Detect empty compilations
817
818         Handle various kinds of output targets.  Handle --target and
819         rename -t to --dumper.
820
821         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
822         methods inherited from Expression return now an Expression.  This
823         will is used during the tree rewriting as we resolve them during
824         semantic analysis.
825
826         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
827         the spec.  Missing entirely is the information about
828         accessability of elements of it.
829
830         (Expression::ExprClassFromMemberInfo): New constructor for
831         Expressions that creates a fully initialized Expression based on
832         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
833         a Type.
834
835         (Invocation::Resolve): Begin implementing resolution of invocations.
836         
837         * literal.cs (StringLiteral):  Implement Emit.
838
839 2001-09-05  Ravi Pratap  <ravi@ximian.com>
840
841         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
842         member.
843         
844 2001-09-04  Ravi Pratap  <ravi@ximian.com>
845
846         * cs-parser.jay (attribute_arguments): Implement actions.
847         (attribute): Fix bug in production. Implement action.
848         (attribute_list): Implement.
849         (attribute_target): Implement.
850         (attribute_target_specifier, opt_target_specifier): Implement
851         (CheckAttributeTarget): New method to check if the attribute target
852         is valid.
853         (attribute_section): Implement.
854         (opt_attributes): Implement.
855
856         * attribute.cs : New file to handle attributes.
857         (Attribute): Class to hold attribute info.
858
859         * cs-parser.jay (opt_attribute_target_specifier): Remove production
860         (attribute_section): Modify production to use 2 different rules to 
861         achieve the same thing. 1 s/r conflict down !
862         Clean out commented, useless, non-reducing dimension_separator rules.
863         
864         * class.cs (TypeContainer.attributes): New member to hold list
865         of attributes for a type.
866         (Struct::Struct): Modify to take one more argument, the attribute list.
867         (Class::Class): Ditto.
868         (Field::Field): Ditto.
869         (Method::Method): Ditto.
870         (Property::Property): Ditto.
871         
872         * cs-parser.jay (struct_declaration): Update constructor call to
873         pass in the attributes too.
874         (class_declaration): Ditto.
875         (constant_declaration): Ditto.
876         (field_declaration): Ditto.
877         (method_header): Ditto.
878         (fixed_parameter): Ditto.
879         (parameter_array): Ditto.
880         (property_declaration): Ditto.
881
882         * constant.cs (Constant::Constant): Update constructor similarly.
883         Use System.Collections.
884
885         * parameter.cs (Parameter::Parameter): Update as above.
886
887 2001-09-02  Ravi Pratap  <ravi@ximian.com>
888
889         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
890         (TypeContainer.delegates): New member to hold list of delegates.
891
892         * cs-parser.jay (delegate_declaration): Implement the action correctly 
893         this time as I seem to be on crack ;-)
894
895 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
896
897         * rootcontext.cs (RootContext::IsNamespace): new function, used to
898         tell whether an identifier represents a namespace.
899
900         * expression.cs (NamespaceExpr): A namespace expression, used only
901         temporarly during expression resolution.
902         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
903         utility functions to resolve names on expressions.
904
905 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
906
907         * codegen.cs: Add hook for StatementExpressions. 
908
909         * class.cs: Fix inverted test for static flag in methods.
910
911 2001-09-02  Ravi Pratap  <ravi@ximian.com>
912
913         * class.cs (Operator::CheckUnaryOperator): Correct error number used
914         to make it coincide with MS' number.
915         (Operator::CheckBinaryOperator): Ditto.
916
917         * ../errors/errors.txt : Remove error numbers added earlier.
918
919         * ../errors/cs1019.cs : Test case for error # 1019
920
921         * ../errros/cs1020.cs : Test case for error # 1020
922
923         * cs-parser.jay : Clean out commented cruft.
924         (dimension_separators, dimension_separator): Comment out. Ostensibly not
925         used anywhere - non-reducing rule.
926         (namespace_declarations): Non-reducing rule - comment out.
927
928         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
929         with TypeContainer::AddEnum.
930
931         * delegate.cs : New file for delegate handling classes.
932         (Delegate): Class for declaring delegates.
933
934         * makefile : Update.
935
936         * cs-parser.jay (delegate_declaration): Implement.
937
938 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
939
940         * class.cs (Event::Define): Implement.
941         (Event.EventBuilder): New member.
942
943         * class.cs (TypeContainer::Populate): Update to define all enums and events
944         we have.
945         (Events): New property for the events arraylist we hold. Shouldn't we move to using
946         readonly fields for all these cases ?
947
948 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
949
950         * class.cs (Property): Revamp to use the convention of making fields readonly.
951         Accordingly modify code elsewhere.
952
953         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
954         the Define method of the Property class.
955
956         * class.cs : Clean up applied patch and update references to variables etc. Fix 
957         trivial bug.
958         (TypeContainer::Populate): Update to define all the properties we have. Also
959         define all enumerations.
960
961         * enum.cs (Define): Implement.
962         
963 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
964
965         * cs-parser.jay (overloadable_operator): The semantic value is an
966         enum of the Operator class.
967         (operator_declarator): Implement actions.
968         (operator_declaration): Implement.
969
970         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
971         validity of definitions.
972         (Operator::CheckBinaryOperator): Static method to check for binary operators
973         (TypeContainer::AddOperator): New method to add an operator to a type.
974
975         * cs-parser.jay (indexer_declaration): Added line to actually call the
976         AddIndexer method so it gets added ;-)
977
978         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
979         already taken care of by the MS compiler ?  
980
981 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
982
983         * class.cs (Operator): New class for operator declarations.
984         (Operator::OpType): Enum for the various operators.
985
986 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
987
988         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
989         ostensibly handle this in semantic analysis.
990
991         * cs-parser.jay (general_catch_clause): Comment out
992         (specific_catch_clauses, specific_catch_clause): Ditto.
993         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
994         (catch_args, opt_catch_args): New productions.
995         (catch_clause): Rewrite to use the new productions above
996         (catch_clauses): Modify accordingly.
997         (opt_catch_clauses): New production to use in try_statement
998         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
999         and re-write the code in the actions to extract the specific and
1000         general catch clauses by being a little smart ;-)
1001
1002         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
1003         Hooray, try and catch statements parse fine !
1004         
1005 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
1006
1007         * statement.cs (Block::GetVariableType): Fix logic to extract the type
1008         string from the hashtable of variables.
1009
1010         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
1011         I end up making that mistake ;-)
1012         (catch_clauses): Fixed gross error which made Key and Value of the 
1013         DictionaryEntry the same : $1 !!
1014
1015 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
1016
1017         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
1018
1019         * cs-parser.jay (event_declaration): Correct to remove the semicolon
1020         when the add and remove accessors are specified. 
1021
1022 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
1023
1024         * cs-parser.jay (IndexerDeclaration): New helper class to hold
1025         information about indexer_declarator.
1026         (indexer_declarator): Implement actions.
1027         (parsing_indexer): New local boolean used to keep track of whether
1028         we are parsing indexers or properties. This is necessary because 
1029         implicit_parameters come into picture even for the get accessor in the 
1030         case of an indexer.
1031         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
1032
1033         * class.cs (Indexer): New class for indexer declarations.
1034         (TypeContainer::AddIndexer): New method to add an indexer to a type.
1035         (TypeContainer::indexers): New member to hold list of indexers for the
1036         type.
1037
1038 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
1039
1040         * cs-parser.jay (add_accessor_declaration): Implement action.
1041         (remove_accessor_declaration): Implement action.
1042         (event_accessors_declaration): Implement
1043         (variable_declarators): swap statements for first rule - trivial.
1044
1045         * class.cs (Event): New class to hold information about event
1046         declarations.
1047         (TypeContainer::AddEvent): New method to add an event to a type
1048         (TypeContainer::events): New member to hold list of events.
1049
1050         * cs-parser.jay (event_declaration): Implement actions.
1051
1052 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
1053
1054         * cs-parser.jay (dim_separators): Implement. Make it a string
1055         concatenating all the commas together, just as they appear.
1056         (opt_dim_separators): Modify accordingly
1057         (rank_specifiers): Update accordingly. Basically do the same
1058         thing - instead, collect the brackets here.
1059         (opt_rank_sepcifiers): Modify accordingly.
1060         (array_type): Modify to actually return the complete type string
1061         instead of ignoring the rank_specifiers.
1062         (expression_list): Implement to collect the expressions
1063         (variable_initializer): Implement. We make it a list of expressions
1064         essentially so that we can handle the array_initializer case neatly too.
1065         (variable_initializer_list): Implement.
1066         (array_initializer): Make it a list of variable_initializers
1067         (opt_array_initializer): Modify accordingly.
1068
1069         * expression.cs (New::NType): Add enumeration to help us
1070         keep track of whether we have an object/delegate creation
1071         or an array creation.
1072         (New:NewType, New::Rank, New::Indices, New::Initializers): New
1073         members to hold data about array creation.
1074         (New:New): Modify to update NewType
1075         (New:New): New Overloaded contructor for the array creation
1076         case.
1077
1078         * cs-parser.jay (array_creation_expression): Implement to call
1079         the overloaded New constructor.
1080         
1081 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
1082
1083         * class.cs (TypeContainer::Constructors): Return member
1084         constructors instead of returning null.
1085
1086 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
1087
1088         * typemanager.cs (InitCoreTypes): Initialize the various core
1089         types after we have populated the type manager with the user
1090         defined types (this distinction will be important later while
1091         compiling corlib.dll)
1092
1093         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
1094         on Expression Classification.  Now all expressions have a method
1095         `Resolve' and a method `Emit'.
1096
1097         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
1098         generation from working.     Also add some temporary debugging
1099         code. 
1100         
1101 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
1102
1103         * codegen.cs: Lots of code generation pieces.  This is only the
1104         beginning, will continue tomorrow with more touches of polish.  We
1105         handle the fundamentals of if, while, do, for, return.  Others are
1106         trickier and I need to start working on invocations soon.
1107         
1108         * gen-treedump.cs: Bug fix, use s.Increment here instead of
1109         s.InitStatement. 
1110
1111         * codegen.cs (EmitContext): New struct, used during code
1112         emission to keep a context.   Most of the code generation will be
1113         here. 
1114
1115         * cs-parser.jay: Add embedded blocks to the list of statements of
1116         this block.  So code generation proceeds in a top down fashion.
1117
1118 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
1119
1120         * statement.cs: Add support for multiple child blocks.
1121
1122 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
1123
1124         * codegen.cs (EmitCode): New function, will emit the code for a
1125         Block of code given a TypeContainer and its ILGenerator. 
1126
1127         * statement.cs (Block): Standard public readonly optimization.
1128         (Block::Block constructors): Link children. 
1129         (Block::Child): Child Linker.
1130         (Block::EmitVariables): Emits IL variable declarations.
1131
1132         * class.cs: Drop support for MethodGroups here, delay until
1133         Semantic Analysis.
1134         (Method::): Applied the same simplification that I did before, and
1135         move from Properties to public readonly fields.
1136         (Method::ParameterTypes): Returns the parameter types for the
1137         function, and implements a cache that will be useful later when I
1138         do error checking and the semantic analysis on the methods is
1139         performed.
1140         (Constructor::GetCallingConvention): Renamed from CallingConvetion
1141         and made a method, optional argument tells whether this is a class
1142         or a structure to apply the `has-this' bit.
1143         (Method::GetCallingConvention): Implement, returns the calling
1144         convention. 
1145         (Method::Define): Defines the type, a second pass is performed
1146         later to populate the methods.
1147
1148         (Constructor::ParameterTypes): implement a cache similar to the
1149         one on Method::ParameterTypes, useful later when we do semantic
1150         analysis. 
1151
1152         (TypeContainer::EmitMethod):  New method.  Emits methods.
1153
1154         * expression.cs: Removed MethodGroup class from here.
1155         
1156         * parameter.cs (Parameters::GetCallingConvention): new method.
1157
1158 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
1159
1160         * class.cs (TypeContainer::Populate): Drop RootContext from the
1161         argument. 
1162
1163         (Constructor::CallingConvention): Returns the calling convention.
1164         (Constructor::ParameterTypes): Returns the constructor parameter
1165         types. 
1166         
1167         (TypeContainer::AddConstructor): Keep track of default constructor
1168         and the default static constructor.
1169
1170         (Constructor::) Another class that starts using `public readonly'
1171         instead of properties. 
1172
1173         (Constructor::IsDefault): Whether this is a default constructor. 
1174
1175         (Field::) use readonly public fields instead of properties also.
1176
1177         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
1178         track of static constructors;  If none is used, turn on
1179         BeforeFieldInit in the TypeAttributes. 
1180
1181         * cs-parser.jay (opt_argument_list): now the return can be null
1182         for the cases where there are no arguments. 
1183
1184         (constructor_declarator): If there is no implicit `base' or
1185         `this', then invoke the default parent constructor. 
1186         
1187         * modifiers.cs (MethodAttr): New static function maps a set of
1188         modifiers flags into a MethodAttributes enum
1189         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
1190         MethodAttr, TypeAttr to represent the various mappings where the
1191         modifiers are used.
1192         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
1193
1194 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
1195
1196         * parameter.cs (GetParameterInfo): Fix bug where there would be no
1197         method arguments.
1198
1199         * interface.cs (PopulateIndexer): Implemented the code generator
1200         for interface indexers.
1201
1202 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
1203
1204         * interface.cs (InterfaceMemberBase): Now we track the new status
1205         here.  
1206
1207         (PopulateProperty): Implement property population.  Woohoo!  Got
1208         Methods and Properties going today. 
1209
1210         Removed all the properties for interfaces, and replaced them with
1211         `public readonly' fields. 
1212
1213 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
1214
1215         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
1216         initialize their hashtables/arraylists only when they are needed
1217         instead of doing this always.
1218
1219         * parameter.cs: Handle refs and out parameters.
1220
1221         * cs-parser.jay: Use an ArrayList to construct the arguments
1222         instead of the ParameterCollection, and then cast that to a
1223         Parameter[] array.
1224
1225         * parameter.cs: Drop the use of ParameterCollection and use
1226         instead arrays of Parameters.
1227
1228         (GetParameterInfo): Use the Type, not the Name when resolving
1229         types. 
1230
1231 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
1232
1233         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
1234         and instead use public readonly fields.
1235
1236         * class.cs: Put back walking code for type containers.
1237
1238 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
1239
1240         * class.cs (MakeConstant): Code to define constants.
1241
1242         * rootcontext.cs (LookupType): New function.  Used to locate types 
1243
1244         
1245 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
1246
1247         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
1248         this System.Reflection code is.  Kudos to Microsoft
1249         
1250         * typemanager.cs: Implement a type cache and avoid loading all
1251         types at boot time.  Wrap in LookupType the internals.  This made
1252         the compiler so much faster.  Wow.  I rule!
1253         
1254         * driver.cs: Make sure we always load mscorlib first (for
1255         debugging purposes, nothing really important).
1256
1257         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
1258         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
1259
1260         * rootcontext.cs: Lookup types on their namespace;  Lookup types
1261         on namespaces that have been imported using the `using' keyword.
1262
1263         * class.cs (TypeContainer::TypeAttr): Virtualize.
1264         (Class::TypeAttr): Return attributes suitable for this bad boy.
1265         (Struct::TypeAttr): ditto.
1266         Handle nested classes.
1267         (TypeContainer::) Remove all the type visiting code, it is now
1268         replaced with the rootcontext.cs code
1269
1270         * rootcontext.cs (GetClassBases): Added support for structs. 
1271
1272 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
1273
1274         * interface.cs, statement.cs, class.cs, parameter.cs,
1275         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
1276         Drop use of TypeRefs, and use strings instead.
1277
1278 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
1279
1280         * rootcontext.cs: 
1281
1282         * class.cs (Struct::Struct): set the SEALED flags after
1283         checking the modifiers.
1284         (TypeContainer::TypeAttr): new property, returns the
1285         TypeAttributes for a class.  
1286
1287         * cs-parser.jay (type_list): Oops, list production was creating a
1288         new list of base types.
1289
1290         * rootcontext.cs (StdLib): New property.
1291         (GetInterfaceTypeByName): returns an interface by type name, and
1292         encapsulates error handling here.
1293         (GetInterfaces): simplified.
1294         (ResolveTree): Encapsulated all the tree resolution here.
1295         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
1296         types. 
1297         
1298         * driver.cs: Add support for --nostdlib, to avoid loading the
1299         default assemblies.
1300         (Main): Do not put tree resolution here. 
1301
1302         * rootcontext.cs: Beginning of the class resolution.
1303
1304 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
1305
1306         * rootcontext.cs: Provide better error reporting. 
1307
1308         * cs-parser.jay (interface_base): set our $$ to be interfaces.
1309
1310         * rootcontext.cs (CreateInterface): Handle the case where there
1311         are no parent interfaces.
1312         
1313         (CloseTypes): Routine to flush types at the end.
1314         (CreateInterface): Track types.
1315         (GetInterfaces): Returns an array of Types from the list of
1316         defined interfaces.
1317
1318         * typemanager.c (AddUserType): Mechanism to track user types (puts
1319         the type on the global type hash, and allows us to close it at the
1320         end). 
1321         
1322 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
1323
1324         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
1325         RecordInterface instead.
1326
1327         * cs-parser.jay: Updated to reflect changes above.
1328
1329         * decl.cs (Definition): Keep track of the TypeBuilder type that
1330         represents this type here.  Not sure we will use it in the long
1331         run, but wont hurt for now.
1332
1333         * driver.cs: Smaller changes to accomodate the new code.
1334
1335         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
1336         when done. 
1337
1338         * rootcontext.cs (CreateInterface):  New method, used to create
1339         the System.TypeBuilder type for interfaces.
1340         (ResolveInterfaces): new entry point to resolve the interface
1341         hierarchy. 
1342         (CodeGen): Property, used to keep track of the code generator.
1343
1344 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
1345
1346         * cs-parser.jay: Add a second production for delegate_declaration
1347         with `VOID'.
1348
1349         (enum_body): Put an opt_comma here instead of putting it on
1350         enum_body or enum_member_declarations so we can handle trailing
1351         commas on enumeration members.  Gets rid of a shift/reduce.
1352         
1353         (type_list): Need a COMMA in the middle.
1354
1355         (indexer_declaration): Tell tokenizer to recognize get/set
1356
1357         * Remove old targets.
1358
1359         * Re-add the parser target.
1360
1361 2001-07-13  Simon Cozens <simon@simon-cozens.org>
1362
1363         * cs-parser.jay: Add precendence rules for a number of operators
1364         ot reduce the number of shift/reduce conflicts in the grammar.
1365         
1366 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
1367
1368         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
1369         and put it here.
1370
1371         Get rid of old crufty code.
1372
1373         * rootcontext.cs: Use this to keep track of the parsed
1374         representation and the defined types available to the program. 
1375
1376         * gen-treedump.cs: adjust for new convention.
1377
1378         * type.cs: Split out the type manager, and the assembly builder
1379         from here. 
1380
1381         * typemanager.cs: the type manager will live here now.
1382
1383         * cil-codegen.cs: And the code generator here. 
1384
1385 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
1386
1387         * makefile: Fixed up for easy making.
1388
1389 2001-07-13  Simon Cozens <simon@simon-cozens.org>
1390
1391         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
1392         the 
1393
1394         (unary_expression): Expand pre_increment_expression and
1395         post_decrement_expression to reduce a shift/reduce.
1396
1397 2001-07-11  Simon Cozens
1398
1399         * cs-tokenizer.cs: Hex numbers should begin with a 0.
1400
1401         Improve allow_keyword_as_indent name.
1402
1403 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
1404
1405         * Adjustments for Beta2. 
1406
1407 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
1408
1409         * decl.cs: Added `Define' abstract method.
1410         (InTransit): new property, used to catch recursive definitions. 
1411
1412         * interface.cs: Implement `Define'. 
1413
1414         * modifiers.cs: Map Modifiers.constants to
1415         System.Reflection.TypeAttribute flags.
1416
1417         * class.cs: Keep track of types and user-defined types.
1418         (BuilderInit): New method for creating an assembly
1419         (ResolveType): New function to launch the resolution process, only
1420         used by interfaces for now.
1421
1422         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
1423         that are inserted into the name space. 
1424
1425 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
1426
1427         * ARGH.  I have screwed up my tree so many times due to the use of
1428         rsync rather than using CVS.  Going to fix this at once. 
1429
1430         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
1431         load types.
1432
1433 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
1434
1435         * Experiment successful: Use System.Type rather that our own
1436         version of Type.  
1437
1438 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
1439
1440         * cs-parser.jay: Removed nsAliases from here.
1441
1442         Use new namespaces, handle `using XXX;' 
1443
1444         * namespace.cs: Reimplemented namespace handling, use a recursive
1445         definition of the class.  Now we can keep track of using clauses
1446         and catch invalid using clauses.
1447
1448 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
1449
1450         * gen-treedump.cs: Adapted for all the renaming.
1451
1452         * expression.cs (Expression): this class now has a Type property
1453         which returns an expression Type.
1454
1455         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
1456         `Type', as this has a different meaning now in the base
1457
1458 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
1459
1460         * interface.cs, class.cs: Removed from all the sources the
1461         references to signature computation, as we can not do method
1462         signature computation during the parsing time, as we are not
1463         trying to solve at that point distinguishing:
1464
1465         class X {
1466                 void a (Blah x) {}
1467                 void a (NS.Blah x) {}
1468         }
1469
1470         Which depending on the context might be valid or not, as we do not
1471         know if Blah is the same thing as NS.Blah at that point.
1472
1473         * Redid everything so the code uses TypeRefs now instead of
1474         Types.  TypeRefs are just temporary type placeholders, that need
1475         to be resolved.  They initially have a pointer to a string and the
1476         current scope in which they are used.  This is used later by the
1477         compiler to resolve the reference to an actual Type. 
1478
1479         * DeclSpace is no longer a CIR.Type, and neither are
1480         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
1481         are all DeclSpaces, but no Types. 
1482
1483         * type.cs (TypeRefManager): This implements the TypeRef manager,
1484         which keeps track of all the types that need to be resolved after
1485         the parsing has finished. 
1486
1487 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
1488
1489         * ARGH.  We are going to have to store `foreach' as a class rather
1490         than resolving it, as we need to verify error 1579 after name
1491         resolution.   *OR* we could keep a flag that says `This request to
1492         IEnumerator comes from a foreach statement' which we can then use
1493         to generate the error.
1494
1495 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
1496
1497         * class.cs (TypeContainer.AddMethod): we now add methods to the
1498         MethodGroup instead of the method hashtable.  
1499
1500         * expression.cs: Add MethodGroup abstraction, which gets us one
1501         step closer to the specification in the way we handle method
1502         declarations.  
1503
1504         * cs-parser.jay (primary_expression): qualified_identifier now
1505         tried to match up an identifier to a local variable reference or
1506         to a parameter reference.
1507
1508         current_local_parameters is now a parser global variable that
1509         points to the current parameters for the block, used during name
1510         lookup.
1511
1512         (property_declaration): Now creates an implicit `value' argument to
1513         the set accessor.
1514
1515 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
1516
1517         * parameter.cs: Do not use `param' arguments as part of the
1518         signature, per the spec.
1519
1520 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
1521
1522         * decl.cs: Base class for classes, structs and interfaces.  This
1523         is the "Declaration Space" 
1524
1525         * cs-parser.jay: Use CheckDef for checking declaration errors
1526         instead of having one on each function.
1527
1528         * class.cs: Factor out some code for handling error handling in
1529         accordance to the "Declarations" section in the "Basic Concepts"
1530         chapter in the ECMA C# spec.
1531
1532         * interface.cs: Make all interface member classes derive from
1533         InterfaceMemberBase.
1534
1535 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
1536
1537         * Many things: all interfaces are parsed and generated in
1538         gen-treedump.  Support for member variables, constructors,
1539         destructors, properties, constants is there.
1540
1541         Beginning of the IL backend, but very little done, just there for
1542         testing purposes. 
1543
1544 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
1545
1546         * cs-parser.jay: Fix labeled statement.
1547
1548         * cs-tokenizer.cs (escape): Escape " and ' always.
1549         ref_line, ref_name: keep track of the line/filename as instructed
1550         by #line by the compiler.
1551         Parse #line.
1552
1553 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
1554
1555         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
1556         to match the values in System.CodeDOM.
1557
1558         Divid renamed to Divide.
1559
1560         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
1561         statements. 
1562         (Statements.set): remove.
1563
1564         * System.CodeDOM/CodeCatchClause.cs: always have a valid
1565         statements. 
1566
1567         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
1568         falseStatements always have valid values. 
1569
1570         * cs-parser.jay: Use System.CodeDOM now.
1571