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