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